omniscale / imposm3

Imposm imports OpenStreetMap data into PostGIS
http://imposm.org/docs/imposm3/latest/
Apache License 2.0
711 stars 156 forks source link

expiretiles_zoom in config file is not used by imposm run #181

Closed fritruc closed 1 year ago

fritruc commented 5 years ago

Context

When setting expiretiles_zoom in config file (ie: 10), imposm always generate expire tiles file with zoom 14. If I set -expiretiles-zoom on cmdline, everything works.

Expected Behavior

When expiretiles_zoom is set in config file, imposm run should use this value

Actual Behavior

When expiretiles_zoom is set in config file, imposm run use 14

Possible Fix

I think the bug is in https://github.com/omniscale/imposm3/blob/c87a9a2b5761787a637e0fa73df9d4331846587d/config/config.go#L274

expiretiles-zoom has a default value of 14 but in updateFromConfig(), the value is updated from config file only if ExpireTilesZoom is equal to 0 (from cmdline)

https://github.com/omniscale/imposm3/blob/c87a9a2b5761787a637e0fa73df9d4331846587d/config/config.go#L119-L124

I thing you should not set a default value (or 0) on cmdline argument, since it would be set to 14 if the value is invalid anyway.

eheu commented 2 years ago

Is there any reason why the allowed value range is limited in the line with o.ExpireTilesZoom < 6 || o.ExpireTilesZoom > 18?