osm2pgrouting icon indicating copy to clipboard operation
osm2pgrouting copied to clipboard

What is the bare minimum required on Overpass API do get an osm file that osm2pgrouting can use?

Open iboates opened this issue 8 years ago • 5 comments

I working on an automated process of generating routing databases and I am thinking that I can save some time and resources if I use Overpass API to download just the data that is required, rather than the entire region or subregion from Geofabrik. Is there already a query defined, or maybe some kind of list that details exactly the features that are required to generate the routing database?

iboates avatar Aug 31 '17 14:08 iboates

There is no such list or instructions, that I'm aware of.

dkastl avatar Sep 01 '17 00:09 dkastl

@iboates Yes, there are no instructions about this, but what you think make sense. So, taking your line of thought: after downloading the file from your favourite downloader that has nodes, ways & relations use osmium-tools to create a new file with:

  • the BBOX that you need
  • that only keeps the nodes, ways & relations that you are using in the configuration file, for example: https://github.com/pgRouting/osm2pgrouting/blob/master/mapconfig_for_cars.xml use only the "highway" tag, so keep all the ways with that tag other example https://github.com/pgRouting/osm2pgrouting/blob/master/mapconfig_for_bicycles.xml use cycleway and highway, so make sure that those tags are kept in the new file

and process the new file with osm2pgrouting (if you are on this, I will release 2.3 soon, you can find it in develop branch, if you want to give it a try)

PS, I haven't tested this idea

cvvergara avatar Sep 01 '17 02:09 cvvergara

Thanks, @cvvergara

I will let you know how it goes

iboates avatar Sep 01 '17 18:09 iboates

After headache after headache I have decided that I will put off trying to use bounding boxes on overpass to collect data. Despite the very general query of

[out:xml]; way({0},{1},{2},{3}); node({0},{1},{2},{3}); relation({0},{1},{2},{3}); (._;>;); out body;

(the braced numbers representing the bounding box parameters)

I continuously get not well-formed (invalid token) at line 1394*** Error in 'osm2pgrouting': double free or corruption (!prev): 0x0000000001225da0 ***

I would like to revisit this at some point, because i find the process of downloading an entire subregion and then performing a bounding box to be needlessly inefficient, but in the meantime it will just have to do.

iboates avatar Sep 02 '17 10:09 iboates

@iboates Please try the one on develop On that version I removed the C pointers and I am using C++ containers

cvvergara avatar Sep 03 '17 02:09 cvvergara