[Oracle] implements map matching in the database

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.