3

I want to snap the GPX-track to the road network as the image below shows. I found out, that "Hausdorff Distance" is exactly what I need and that it is usable with PostGIS. But unfortunately I have no idea how to work with it and even I don't know where to start. I'm not very familiar with PostGIS.

How do I use ST_HausdorffDistance (http://postgis.net/docs/ST_HausdorffDistance.html)? Is there any tutorial or workshop?

Im using qgis. The road-network comes from OSM (osm2pgsql).

enter image description here

underdark
  • 84,148
  • 21
  • 231
  • 413
MartinMap
  • 8,262
  • 7
  • 50
  • 114
  • 1
    ST_Snap http://postgis.net/docs/ST_Snap.html would be a better choice? – Mapperz Oct 11 '14 at 21:43
  • That seem to be a better approach. But I really have no Idea, how to perform the script. I'm not familiar with sql-scripting. And the examples at postgis.net/docs/ST_Snap.html are not helping me. I have two sql tables: one (planet_osm_lines from osm2pgsql) and one (track_table) I made from a gpx-file. I need the result as a new polyline in "track_table". – MartinMap Oct 13 '14 at 08:39
  • Here is an example to use PostGIS with ST_Snap http://gis.stackexchange.com/questions/52232/how-to-snap-lines-to-points-automatically/52301#52301 – Mapperz Oct 14 '14 at 13:29

1 Answers1

4

Let me respectfully disagree, but I don't think that the Hausdorff distance function is the appropriate way to snap a GPX track to a street network. Rather you should be looking into methods for map matching, e.g.

Different approaches for map matching : links / ideas?

underdark
  • 84,148
  • 21
  • 231
  • 413
  • I found in that post, that "Hausdorff Distance" could be the right thing for me - but now it seems, it isnt :-) – MartinMap Oct 13 '14 at 08:44