SomeoneElseOSM / SomeoneElse-style

An "England and Wales rural pedestrian" focused OSM-based map style. Example at https://map.atownsend.org.uk/maps/map/map.html . This is the tag preprocessing part of the style.
GNU General Public License v3.0
9 stars 3 forks source link

Osm2pgsql failed due to ERROR: Failed to execute lua function #5

Closed fosiul closed 6 years ago

fosiul commented 6 years ago

Hello, not sure what I am doing wrong but please see the out put, its giving me bellow, Can you please help me with this.


:~/data$ osm2pgsql -d gis --create --slim -C 2500 --number-processes 4 -S ~/src/openstreetmap-carto-AJT/openstreetmap-carto.style --multi-geometry --tag-transform-script ~/src/SomeoneElse-style/style.lua ~/data/bangladesh-latest.osm.pbf
osm2pgsql version 0.96.0 (64 bit id space)

Using lua based tag processing pipeline with script /src/SomeoneElse-style/style.lua
Using projection SRS 3857 (Spherical Mercator)
Setting up table: planet_osm_point
Setting up table: planet_osm_line
Setting up table: planet_osm_polygon
Setting up table: planet_osm_roads
Allocating memory for dense node cache
Allocating dense node cache in one big chunk
Allocating memory for sparse node cache
Sharing dense sparse
Node-cache: cache=2500MB, maxblocks=40000*65536, allocation method=11
Mid: pgsql, cache=2500
Setting up table: planet_osm_nodes
Setting up table: planet_osm_ways
Setting up table: planet_osm_rels

Reading in file: /data/bangladesh-latest.osm.pbf
Using PBF parser.
Processing: Node(30674k 45.2k/s) Way(38k 4.75k/s) Relation(0 0.00/s)node cache:                                                                                         stored: 30674137(100.00%), storage efficiency: 50.51% (dense blocks: 400, sparse                                                                                         nodes: 28723161), hit rate: 100.00%
Osm2pgsql failed due to ERROR: Failed to execute lua function for basic tag proc                                                                                        essing: /src/SomeoneElse-style/style.lua:16: attempt to perform arithm                                                                                        etic on field 'layer' (a string value)
SomeoneElseOSM commented 6 years ago

According to the comments at https://github.com/openstreetmap/osm2pgsql/pull/845#issuecomment-398529869 a recent change to osm2pgsql has caused this problem. As a temporary workaround you could try a version of osm2pgsql that predates that change.

mmd-osm commented 6 years ago

You need to incorporate the following upstream code in your style:

https://github.com/openstreetmap/osm2pgsql/blob/master/style.lua#L125-L127

The current code doesn't work properly and needs to be fixed...