在oracle中这么匹配数据库,[Oracle]在数据库中实现地图匹配

该博客介绍了在Oracle数据库中实现地图匹配的算法步骤,首先找到离给定点最近的公路,然后从该公路中选取最接近的点。通过SQL查询语句进行操作,包括使用SDO_GEOMETRY和SDO_LRS等函数进行空间数据操作。
摘要由CSDN通过智能技术生成

5268f80b9b1e01f982625ef6fac83ca1.png

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.

b91a64b9df27b4d69b490c48a482cae0.gif

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;

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

标签:

1428d0e076c3959ab11d28a39bc84fab.png

5268f80b9b1e01f982625ef6fac83ca1.png

本条技术文章来源于互联网,如果无意侵犯您的权益请点击此处反馈版权投诉

本文系统来源:http://www.cnblogs.com/liyong-hit/p/4501381.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值