3

I am new to GIS, so please do not hesitate to call me out in providing limited information.

I have a .tiff Terrain (elevation) data file for the east coast of the US and a .osm.pbf OSM file for North America. My objective in Python is as follows:

  1. Using a gps coordinate, get the closest road a vehicle could be on (using the .osm.pbf OSM data?)
  2. Get the gps coordinates for this road for the next and previous 5 miles
  3. Finally, use these future road gps coordinates to get the estimated elevation data for the road (using the .tiff Terrain data?).

Requirements: Only offline use. (Ex. Can't use Google snap to road APIs)

I've been playing with the .tiff in QGIS and using the profile tool to draw polylines and seeing the elevation over the line. I've also been reading up on programming with it using Python.

I'm looking for some advice on completing #1 and #2 and if it is doable with QGIS (is there QGIS compatible road data?) or will I have to interface with a pbf analyzer like "imposm.parser"?

There is a similar question, but it deals with different file types and is geared more towards step 3: Extract Elevation of Points from DEM using Python QGIS or GRASS

  • 1
    That post should work for you as every geometry can be broken down into coordinate pairs. What API are you using to query the geometries and raster? you mention QGIS, is that definitely what you want to use? – Michael Stimson Oct 19 '15 at 22:42
  • I am mainly using QGIS to get a better grasp on the data inside files (the terrain data in this case). I am not yet at querying the geometries and raster. Is #1 & #2 doable with the .osm.pbf files? Perhaps I don't understand their file format enough to know what they contain and how to query the correct information from the open street data. – Morgan Culbertson Oct 19 '15 at 22:58
  • It seems the best method to query and manage the osm data is to put it in a PostgreSQL? Would help with step #1 and #2? – Morgan Culbertson Oct 19 '15 at 23:06
  • 1
    PostGis is a big step and more information is needed to decide if it's worthwhile.. Geometry objects are handled in QGIS the same regardless of where they come from so PostGis and Esri Shape work the same... shapefiles have a size limit so may be unsuitable but I would only go with PostGis if you're expecting a lot of users to be polling the data at the same time but yes it would help - as well as opening up an entire new API to work with if you want to go that way. – Michael Stimson Oct 19 '15 at 23:14
  • Understood. If I only have about 2-3 queries (for step 1&2 together) every 5 seconds, would you suggest using PostGis and using a query like http://gis.stackexchange.com/questions/126915/how-do-i-get-the-closest-point-on-a-road-to-a-point-when-i-have-imported-osm-dat or attempting to query through a python/c api such as "imposm.parser"? – Morgan Culbertson Oct 20 '15 at 16:36
  • I don't know about imposm.parser I would use OGR or ArcObjects in C# or C++ but that's because I know them. If you have 2-3 queries in a 5 minute interval (sustained) then I would think that PostGis is the database for you... there's a few steps to setting it up but thankfully now the releases are mature enough to have good help; first install PostgreSQL then download and install PostGis (I also reccomend PGAdminIII), you can manipulate/view your data via QGIS - all open source products. PostgreSQL is multi threading so even on a low spec server it could easily handle that sort of load. – Michael Stimson Oct 20 '15 at 21:27

0 Answers0