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

Lots of misconnected lines on develop branch #183

Open iboates opened 7 years ago

iboates commented 7 years ago

I am testing out the develop in the application i am developing and this is the output i get when running on an osm file that has been clipped by a bounding box using osmosis:

https://imgur.com/a/JIGgt

It looks like a lot of the lines are being misconnected. I tried it again using no bounding box and it seems to work fine.

This does not happen when using the master branch.

Here is the output of the run:

***************************************************
           COMMAND LINE CONFIGURATION             *
***************************************************
Filename = data/routing_data_bb.osm
Configuration file = osm2pgrouting/mapconfig_for_cars.xml
host = localhost
port = 5432
dbname = routing3
username = isaac
password = isaac
schema= 
prefix = 
suffix = 
Don't Install postgis if not found
Drop tables
Don't create indexes
Don't add nodes
Don't add ways
Don't add relations
Don't fork
***************************************************
Testing database connection: routing3
database connection successfull: routing3
Connecting to the database
connection success

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

Creating tables...
TABLE: ways_vertices_pgr created OK.
TABLE: ways created OK.
TABLE: pointsofinterest created OK.
TABLE: configuration created OK.
TABLE: osm_nodes created OK.
TABLE: osm_ways created OK.
TABLE: osm_relations created OK.
Opening configuration file: osm2pgrouting/mapconfig_for_cars.xml
    Parsing configuration

Exporting configuration ...
  - Done 
Counting lines ...
  - Done 
Opening data file: data/routing_data_bb.osm total lines: 967178
    Parsing data

    Finish Parsing data

Adding auxiliary tables to database...

Export Ways ...
    Processing 44585 ways:

[**********************|                            ] (44%) Total porcessed: 20000   Vertices inserted: 6309    Split ways inserted 8547

[********************************************|      ] (89%) Total porcessed: 40000   Vertices inserted: 624 Split ways inserted 1318

[**************************************************|] (100%) Total porcessed: 44585  Vertices inserted: 250 Split ways inserted 450

Creating indexes ...

Processing Points of Interest ...
#########################
size of streets: 44585
#########################
dkastl commented 7 years ago

@iboates , how do you clip using Osmosis? When I clipped a polygon area, there was no problem as far as I remember. I'm not anymore 100% sure anymore, if it was develop branch and not master, but I will try again.

This was the command I used:

osmosis --read-pbf ./europe-latest.osm.pbf --bounding-polygon \
  file="boundary.poly" --write-xml file="clipped.osm"

If you can post your Osmosis command we can try to reproduce.

iboates commented 7 years ago

@dkastl I used this command:

osmosis/bin/osmosis --read-xml data/routing_data.osm bounding-box top={0} left={0} right={0} bottom={0} --write-xml data/routing_data_bb.osm

The {0} are the extent values that get automatically inserted.

damiaan commented 6 years ago

I see the same on development 2.3.1, although

an example is

    <way id="7824261" version="18" timestamp="2017-08-28T18:33:42Z" changeset="51518580" uid="209796" user="LudovicG">
        <nd ref="2522436537"/>
        <nd ref="296145012"/>
        <nd ref="57309342"/>
        <tag k="highway" v="primary"/>
        <tag k="lanes" v="2"/>
        <tag k="name" v="Pont Mirabeau"/>
        <tag k="oneway" v="yes"/>
        <tag k="surface" v="asphalt"/>
    </way>

which enters the database with source_osm 2522436537 target_osm 296146263

this is when using these commands:

wget -O europe.osm.pbf http://download.geofabrik.de/europe-latest.osm.pbf
# osmconvert is 0.8.5
osmconvert europe.osm.pbf --drop-author -o=europe.o5m
#osmfilter is 1.4.3
./osmfilter europe.o5m --keep=" ( highway=motorway =motorway_link = motorway_junction =trunk =trunk_link =primary =primary_link ) or ( route=ferry ) " --drop="access=no"  -o=roads/europe-roads.osm
# osm2pgrouting Version 2.3.1
osm2pgrouting  --tags --f roads/europe-roads_small.osm --conf mapconfig.xml --dbname routing --username damiaan --clean
sirwoetang commented 6 years ago

Also having this issue from the osm2pgrouting 2.3.3 installed via homebrew on mac.

osmosis --read-xml latest.osm --bb left=1 right=2top=1 bottom=2 --write-xml subset.osm osm2pgrouting --f subset.osm --conf mapconfig.xml --dbname postgres --username postgres --clean