Skip to content

Commit

Permalink
Add option to set tile extent to generate-sqltomvt (#436)
Browse files Browse the repository at this point in the history
Increasing extent can help mitigate it, but currently, there is no easy way to do this. This PR adds the option to `generate-sqltomvt` so it's possible to override the default (4096) tile extent.
  • Loading branch information
Arvamer authored Feb 19, 2024
1 parent 50be0b8 commit a53b2b1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion bin/generate-sqltomvt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Usage:
[--function | --prepared | --query | --psql | --raw]
[--layer=<layer>]... [--exclude-layers] [--key]
[--gzip [<gzlevel>]] [--no-feature-ids]
[--test-geometry]
[--test-geometry] [--extent=<extent>]
generate-sqltomvt --help
generate-sqltomvt --version
Expand All @@ -31,6 +31,7 @@ Options:
--no-feature-ids Disable feature ID generation, e.g. from osm_id.
You must use this flag when generating SQL for PostGIS before v3
-g --test-geometry Validate all geometries produced by ST_AsMvtGeom(), and warn.
--extent=<extent> MVT tile extent [default: 4096].
--help Show this screen.
--version Show version.
"""
Expand All @@ -49,6 +50,8 @@ if __name__ == '__main__':
else:
zoom, x, y = 'zoom', 'x', 'y'

extent = int(args['--extent']) if args['--extent'] is not None else 4096

mvt = MvtGenerator(
tileset=args['<tileset>'],
postgis_ver=args['--postgis-ver'],
Expand All @@ -59,6 +62,7 @@ if __name__ == '__main__':
gzip=args['--gzip'] and (args['<gzlevel>'] or True),
use_feature_id=False if args['--no-feature-ids'] else None,
test_geometry=args['--test-geometry'],
extent=extent,
)

if args['--prepared']:
Expand Down

0 comments on commit a53b2b1

Please sign in to comment.