[Oracle]在数据库中实现地图匹配

The method to do the map match

1 The algorithm procedures

First ,we should find the most nearest road to the point from all roads in haerbin;

Second, we should find the most nearest point to the point from the road.

For example, as figure 1 ,we will do the map match for the point O.

First ,we choose the most nearest road A by compare the distance between O and A with the distance between O and B.

Second, we choose the most nearest point A3 by compare the distance between O and A1,

the distance between O and A2, the distance between O and A3 with the distance between O and A4.

 

 

  

                   Figure 1

2 The algorithm code – oracle

select g.id into abcid from h_gl g  where

sdo_nn(g.geom,SDO_GEOMETRY(2001,8307,SDO_POINT_TYPE(In_X,In_Y, null),NULL,NULL),'SDO_NUM_RES=1')='TRUE';

 Select sdo_lrs.convert_to_lrs_geom(sdo_lrs.project_pt(g.geom,m.DIMINFO, sdo_geometry(3001, 8307,                                

                                                       null, sdo_elem_info_array(1, 1,1), sdo_ordinate_array(In_X, In_Y, null))))

v_sql :='update table t set t.road_id='||abcid||',t.longtitude_newgps ='||v_taxi_pt.SDO_ORDINATES(1) ||',

t.latitude_newgps='||v_taxi_pt.SDO_ORDINATES(2)||' where t.gpsdata_id ='||IN_GPSDATA_ID;

        

转载于:https://www.cnblogs.com/liyong-hit/p/4501381.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值