pgRouting / osm2pgrouting

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

Division by zero #202

Closed Darioda closed 6 years ago

Darioda commented 6 years ago

Hello,

I have an issue when I execute this command : /osm/osm2pgrouting/usr/bin/osm2pgrouting --file=/osm/osmconvert/rhone-alpes-latest.osm --conf=/osm/osm2pgrouting/osm2pgrouting/mapconfig.xml --dbname=ralpes-routing --username=postgres --password=postgres --clean

Here is the output :

***************************************************
           COMMAND LINE CONFIGURATION             *
***************************************************
Filename = /osm/osmconvert/rhone-alpes-latest.osm
Configuration file = /osm/osm2pgrouting/osm2pgrouting/mapconfig.xml
host = localhost
port = 5432
dbname = ralpes-routing
username = postgres
password = postgres
schema=
prefix =
suffix =
Drop tables
Dont create indexes
Dont add OSM nodes
***************************************************
Testing database connection: ralpes-routing
database connection successful: ralpes-routing
Connecting to the database
connection success

Dropping tables...
TABLE: ways dropped ... OK.
TABLE: ways_vertices_pgr dropped ... OK.
TABLE: pointsofinterest dropped ... OK.
TABLE: configuration dropped ... OK.
TABLE: osm_nodes dropped ... OK.
TABLE: osm_ways dropped ... OK.
TABLE: osm_relations dropped ... OK.

Creating tables...
TABLE: ways_vertices_pgr created ... OK.
TABLE: ways created ... OK.
TABLE: pointsofinterest created ... OK.
TABLE: configuration created ... OK.
Opening configuration file: /osm/osm2pgrouting/osm2pgrouting/mapconfig.xml
    Parsing configuration

Exporting configuration ...
  - Done
Counting lines ...
  - Done
Opening data file: /osm/osmconvert/rhone-alpes-latest.osm       total lines: 113003712
    Parsing data

    ...

[***********************|                           ] (46%) Total processed: 2340000     Vertices inserted: 1148        Split ways inserted 1344
[***********************|                           ] (46%) Total processed: 2360000     Vertices inserted: 2225        Split ways inserted 2494
[***********************|                           ] (46%) Total processed: 2380000     Vertices inserted: 3393        Split ways inserted 3839
[***********************|                           ] (47%) Total processed: 2400000
ERROR:  division by zero

While processing FROM 2380000th          to: 2400000th way
count2400000 While processing FROM 2380000th     to: 2400000th way
[***********************|                           ] (47%) Total processed: 2420000
ERROR:  division by zero

While processing FROM 2400000th          to: 2420000th way
count2420000 While processing FROM 2400000th     to: 2420000th way
[************************|                          ] (48%) Total processed: 2440000

I have tried and have got this issue with the branch master and the tag v2.3.2

Thanks for your help !

cvvergara commented 6 years ago

@Darioda To replicate your problem, the osm data is needed. can you send the:

se7kazi commented 6 years ago

./osm2pgrouting -f ~/Downloads/turkey-latest.osm/turkey-latest.osm -c ~/Downloads/osm2pgrouting-master/mapconfig.xml -h localhost -d postgis --user postgres --schema turkey --clean was my command, and the data is from https://download.geofabrik.de/europe.html, Turkey dataset. I get the same error, "Division by zero". It is still running, so not sure what will show up in the final tables. Attaching some screenshots. selection_044 selection_042

cvvergara commented 6 years ago

To reproduce, we need a much smaller sample than a whole country, can you use osmium to try to determine the smallest area possible withing the Turkey data that has the problem.

cayetanobv commented 6 years ago

cc: @Darioda @dulljester @cvvergara I have finally found where this recurring error occurs. This error is fixed by PR #226