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

Relations Exporting #151

Closed cvvergara closed 7 years ago

cvvergara commented 7 years ago

Bug in develop

Master, well relations didnt even work at all, so no bother. (related to #150)

theoretically I fixed it in develop but this should not happen:

Export Relations ...
    Processing 0 relations:7Inserting to osm_relations failed
ERROR:  relation "osm2pgrosm_relations" does not exist
LINE 1: ... ( SELECT a.*  FROM  __relations_temp a LEFT JOIN osm2pgrosm...
cvvergara commented 7 years ago

@markjd84 Can you give me the exact query you were using that was not working?

markjd84 commented 7 years ago

No query just running from command:

/path/to/osm2pgrouting/build/osm2pgrouting \
  -c /path/to/osm2pgrouting/mapconfig_for_cars.xml \
  -f brussels.osm \
  --dbname o2ptest \
  --username XXX \
  --password YYY \
  --prefix osm2pgr \
  --clean

I had wondered if it was something to do with an unwanted Django migration (as that's what I'm using), but running the above on a fresh db, with full privs, PostGIS and pgR, produces same error as above.

osm2pgrouting-2.1.0-115-g2734c01

cvvergara commented 7 years ago

@markjd84 can you run:

SELECT DISTINCT maxspeed_forward, maxspeed_backward FROM ways;

and post the results please

markjd84 commented 7 years ago

Ok here's what the behaviour appears to be:

Prior to ae2f4271875170f114ac0f662414c35d05196b6c

Since the fix:

Output of query above for prefixed table:

 SELECT DISTINCT maxspeed_forward, maxspeed_backward FROM osm2pgrways;
 maxspeed_forward | maxspeed_backward
------------------+-------------------
(0 rows)

This is ok for me for now as I don't particularly need the prefix, I can code around it not being there by just using the ways table in my app, but worth you knowing it's still not quite right (at least for me)

Cheers (and sorry for the delay)

cvvergara commented 7 years ago

Thanks, I need to work on this more, there still a bug.

cvvergara commented 7 years ago

@markjd84 I think the prefix & suffix should work now, (at least it works in my computer but if its not much trouble can you try again? And give me your opinion

markjd84 commented 7 years ago

Yep that seems to work for me now too. Thanks!

markjd84 commented 7 years ago

Well, kind of. It works on a fresh database, but can't seem to handle a Django-managed one. No idea why as all privs granted etc. I suspect this is Django's problem as opposed to an issue with osm2pgr, but thought I'd document. Also not a major problem as I can work around with a second database.

Creating tables...
 Exists: 'osm2pgrways_vertices_pgr': OK
 Exists: 'osm2pgrways': OK
 Exists: 'osm2pgrrelations_ways': OK
 Exists: 'osm_nodes': OK
 Exists: 'osm_relations': OK
 Exists: 'osm_way_types': OK
 Exists: 'osm_way_classes': OK
Adding auxiliary tables to database...

Export Types ...
    Processing 1 way types:      Inserted: 0 in osm_way_types

Export Classes ...
    Processing way's classes:    Inserted: 0 in osm_way_classes

Export Relations ...
    Processing 0 relations:     Inserted: 0 in osm_relations

Export RelationsWays ...
    Processing way's relations:          Inserted: 0 in osm2pgrrelations_ways

Export Ways ...
    Processing 245874 ways:
[*************************************************| ] (99%)    Ways Processed: 245874       Split Ways generated: 38079 Vertices inserted  Inserted  split ways
Creating Foreign Keys ...
Foreign keys for osm_way_classes table created
7foreign keys for osm_way_tags failed: ERROR:  relation "osm_way_tags" does not exist

Foreign keys for osm2pgrrelations_ways table created
Foreign keys for Ways table created
#########################
size of streets: 245874
Execution started at: Thu Nov  3 14:25:36 2016
Execution ended at:   Thu Nov  3 14:26:21 2016
Elapsed time: 45.288 Seconds.
User CPU time: -> 42.4164 seconds
#########################

Note the error message and the 'Inserted <??> split ways'. I tried this with and without --clean but to no avail.

cvvergara commented 7 years ago

fixed the error ERROR: relation "osm_way_tags" does not exist on this (#154) pull request