The method to do the map match1 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'll 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 to 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, (), 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] implements map matching in the database