Closed cayetanobv closed 6 years ago
while I make time to fix it, can you make:
perl -pi -e 's/sport pitch/sport_ptich'/g' /tmp/output_data.osm
I misunderstood and thought osm tags didn't have spaces
Thanks @cvvergara. I think whitespaces in osm tag keys is a very bad practice but you can find it because is legal. You can read here about it: https://taginfo.openstreetmap.org/reports/characters_in_keys#space
On the other hand what do you think about the bad_alloc
error with osm_relations? This error stops the process.
I really need time for checking exactly what is causing the error, I removed as much as possible the use of pointers, is obvious that something I missed. I might have some time on November to review this issue. But, as a test without using the --add nodes flag do you have the bad alloc problem?
Hello @cayetanobv
Finally weekend arrived and time was found and a PR #190 is there. I will merge tonight and make the new micro release 2.3.1 Feel free to double check this branch: https://github.com/cvvergara/pgrouting/tree/fix/issue984
I tested using your data I am getting this output:
osm2pgrouting --file output_data.osm --clean --dbname issue189 --port 5432 --host localhost --schema bcn_tags_demo2 --addnodes --tags
Execution starts at: Sat Oct 14 11:57:09 2017
***************************************************
COMMAND LINE CONFIGURATION *
***************************************************
Filename = output_data.osm
Configuration file = /usr/share/osm2pgrouting/mapconfig.xml
host = localhost
port = 5432
dbname = issue189
username =
password =
schema= bcn_tags_demo2
prefix =
suffix =
Don't Install postgis if not found
Drop tables
Don't create indexes
Add OSM nodes
Don't add OSM ways
Don't add OSM relations
***************************************************
Testing database connection: issue189
database connection successful: issue189
Connecting to the database
connection success
Dropping tables...
TABLE: bcn_tags_demo2.ways dropped ... OK.
TABLE: bcn_tags_demo2.ways_vertices_pgr dropped ... OK.
TABLE: bcn_tags_demo2.pointsofinterest dropped ... OK.
TABLE: bcn_tags_demo2.configuration dropped ... OK.
TABLE: bcn_tags_demo2.osm_nodes dropped ... OK.
TABLE: bcn_tags_demo2.osm_ways dropped ... OK.
TABLE: bcn_tags_demo2.osm_relations dropped ... OK.
Creating tables...
TABLE: bcn_tags_demo2.ways_vertices_pgr created ... OK.
TABLE: bcn_tags_demo2.ways created ... OK.
TABLE: bcn_tags_demo2.pointsofinterest created ... OK.
TABLE: bcn_tags_demo2.configuration created ... OK.
TABLE: bcn_tags_demo2.osm_nodes created ... OK.
TABLE: bcn_tags_demo2.osm_ways created ... OK.
TABLE: bcn_tags_demo2.osm_relations created ... OK.
Opening configuration file: /usr/share/osm2pgrouting/mapconfig.xml
Parsing configuration
Exporting configuration ...
- Done
Counting lines ...
- Done
Opening data file: output_data.osm total lines: 5075288
Parsing data
Current osm_nodes: 1580000
Final osm_nodes: 1582048
Current osm_ways: 160000
Final osm_ways: 173513
Current osm_relations: 0
Final osm_relations: 94
End Of file
Finish Parsing data
Adding auxiliary tables to database...
Export Ways ...
Processing 173513 ways:
[*****| ] (11%) Total porcessed: 20000 Vertices inserted: 38005 Split ways inserted 37861
[***********| ] (23%) Total porcessed: 40000 Vertices inserted: 19117 Split ways inserted 23542
[*****************| ] (34%) Total porcessed: 60000 Vertices inserted: 18531 Split ways inserted 23174
[***********************| ] (46%) Total porcessed: 80000 Vertices inserted: 11884 Split ways inserted 18771
[****************************| ] (57%) Total porcessed: 100000 Vertices inserted: 8028 Split ways inserted 14329
[**********************************| ] (69%) Total porcessed: 120000 Vertices inserted: 7205 Split ways inserted 12944
[****************************************| ] (80%) Total porcessed: 140000 Vertices inserted: 6712 Split ways inserted 12292
[**********************************************| ] (92%) Total porcessed: 160000 Vertices inserted: 4941 Split ways inserted 9303
[**************************************************|] (100%) Total porcessed: 173513 Vertices inserted: 2917 Split ways inserted 6845
Creating indexes ...
Processing Points of Interest ...
Adding functions for processing Points of Interest ...
To process pointsOfInterest table:
osm2pgr_pois_update(radius default 200, within default 50)
- Using areas of (radius)mts on POIS
- Using edges that are at least (within) mts of each POI
POIS that do not have a closest edge is considered as too far
#########################
size of streets: 173513
Execution started at: Sat Oct 14 11:57:09 2017
Execution ended at: Sat Oct 14 12:00:04 2017
Elapsed time: 174.6 Seconds.
User CPU time: -> 56.2753 seconds
#########################
Awesome @cvvergara !!
I've just compiled your branch https://github.com/cvvergara/pgrouting/tree/fix/issue984 and it works well.
Two errors solved with PR #190:
Thanks!!
Hi,
If I use the new flags (added in v.2.3)
--addnodes
and--tags
and OSM input file has tag keys containing spaces it raises an error (you can see below the details). I think this is because HSTORE keys can not include spaces in PostgreSQL . Moreover when osm_ways processing has finished it raises a failure allocating memory with osm_relations :std::bad_alloc
. The process is stopped and the main table to use with Pgrouting (ways) remains empty.HSTORE keys error disappears removing tags with spaces from osm input file but
bad_alloc
exception raises anyway with osm_relations.OSM file to reproduce this error (downloaded with Overpass API): https://drive.google.com/file/d/0B8PuZrBkyPBuVk9KUE93SVZqWVE/view?usp=sharing
Error details ("sport pitch" is a OSM tag key with spaces):
Thanks, Cayetano