I'm trying to extract GPS points on roads in a region. For each road, I need a GPS point on that road every 10 meters.
I'm aware that Google Map API offer such way points, but due to the latency-sensitive nature of this application and amount of data needed, I cannot afford to do network communications to Google server.
I came across OSM but as someone new, it's very unclear how I can extract GPS points on roads from OSM. I know roads are stored as "line string" with keyword "highway".
Some GeoJSON file includes start and end gps locations for each road but how do I extract all GPS points (Lat,Lng) along the road?
Best Answer
In my answer here I use a query to create points along lines with a distinct distance
So, obviously you are using a PostGIS/PostgreSQL database, You can import OSM data (with osm2pgsql, osmosis, etc.).
Important is an unique ID. You can use the osm_id coming along when you import the OSM data.
When you have data in geojson format you can use the postgis function ST_GeomFromGeoJSON. Another way: Here is a howTo to convert geojson data to a shapefile. The shapefile you can easily import to postgres/postgis with gdal/ogr, pgadmin or QGIS.
After that you can export your point data as GPX with ogr2ogr. The comments for this GIS SE answer have some useful Information.