码迷,mamicode.com
首页 > 数据库 > 详细

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

时间:2015-05-13 21:17:38      阅读:164      评论:0      收藏:0      [点我收藏+]

标签:

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;

        

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

标签:

原文地址:http://www.cnblogs.com/liyong-hit/p/4501381.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!