pgRouting / osm2pgrouting

Import tool for OpenStreetMap data to pgRouting database
https://pgrouting.org
GNU General Public License v2.0
293 stars 110 forks source link

untyped (default type: signed int) id's during export #176

Open verdy-p opened 7 years ago

verdy-p commented 7 years ago

The code is not clean: even though the osm_elements are declared with an int64 type correctly set and returned by the accessor method), several methods handling the parsed geometry to export data are incorrectly converting them silently to signed ints (32 bit by default if the code is compield for a 32-bit system). This causes truncation of id's and failures during import, or broken geometries with unrelated objects. Linting the code would find these occurences, notably in classes related to the DB exporting feature: they declare local variables only with "auto" without specifying any type, so they take a default "int" type from the compiler. So for example, you need to replace "auto id = ..." (default type), by "auto int64_t id = ...;" (explicitly typed variables)

cvvergara commented 7 years ago

@verdy-p Can you send me an osm BBOX that I can use to reproduce the issue please?

I wonder if this applies for the develop branch. It has a lot of changes, maybe its has being fixed there. Can you verify?