shortbread-tiles / shortbread-tilemaker

Tilemaker configuration to generate Shortbread vector tiles
https://shortbread-tiles.org/make-vectortiles/
19 stars 9 forks source link

lua runtime error: z_order is limited to 1 byte signed integer. #17

Closed rrrnld closed 1 year ago

rrrnld commented 1 year ago

I wanted to give this a spin with tilemaker 2.4.0 but hit the following error:

# tilemaker --bbox (osmium fileinfo ../berlin-latest-fixed.osm.pbf | rg Bounding -A1 | tail -1 | string replace -ra '[ ()]' '') --input ../brandenburg-latest.osm.pbf --store tilemaker-berlin-cache --config config.json --process process.lua --output berlin
[…]
Layer pois (z14-14)
Bounding box 13.0828, 52.3345, 13.7622, 52.6783
Using osm store file: tilemaker-berlin-cache
Filename: tilemaker-berlin-cache/mmap_0.dat, size: 1024000000
Reading .shp boundary_labels
Reading .shp ocean
Reading .shp ocean-low
Unable to open data/simplified-water-polygons-split-4326/simplified_water_polygons.shp or data/simplified-water-polygons-split-4326/simplified_water_polygons.SHP.
Sorting loaded shapes
Reading .pbf ../brandenburg-latest.osm.pbf
stack traceback:
    [C]: in function 'ZOrder'
    process.lua:262: in function 'process_place_layer'
    process.lua:317: in function <process.lua:314>
terminate called after throwing an instance of 'kaguya::LuaTypeMismatch'
  what():  type mismatch!!

The line in question is refering to node:ZOrder(populationNum). Commenting this out and re-running the above command a similar problem appears (this time referring to way:ZOrder(way_area)):

terminate called after throwing an instance of 'kaguya::LuaRuntimeError'
  what():  z_order is limited to 1 byte signed integer.
stack traceback:
    [C]: in function 'ZOrder'
    process.lua:409: in function 'process_water_polygons'
    process.lua:1018: in function <process.lua:998>

I'm not too clear on what this means. The values used for z-order seem to be too large, is this a new restriction? It appears that a population size greater than 127 should have happened before. :) Are the lines in question used for sorting the geometries, or do they do anything else?

rrrnld commented 1 year ago

I just realized you are suggesting to use a fork of tilemaker. Sorry, it seems I didn't read the docs closely enough. It looks like that's the reason for the above error (see https://github.com/geofabrik/tilemaker/commit/381571f108d3eac9d1e327bad843b45f8c012cc5). Are there any plans to upstream these changes?

rrrnld commented 1 year ago

Found my answer in https://github.com/systemed/tilemaker/pull/393. Sorry for the noise!