From a53b2b1c30838e30790685c8fcaea22ed4e661d2 Mon Sep 17 00:00:00 2001 From: Arvamer Date: Mon, 19 Feb 2024 13:19:27 +0100 Subject: [PATCH] Add option to set tile extent to generate-sqltomvt (#436) 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. --- bin/generate-sqltomvt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/generate-sqltomvt b/bin/generate-sqltomvt index 37ea2852..056f3e2e 100755 --- a/bin/generate-sqltomvt +++ b/bin/generate-sqltomvt @@ -8,7 +8,7 @@ Usage: [--function | --prepared | --query | --psql | --raw] [--layer=]... [--exclude-layers] [--key] [--gzip []] [--no-feature-ids] - [--test-geometry] + [--test-geometry] [--extent=] generate-sqltomvt --help generate-sqltomvt --version @@ -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= MVT tile extent [default: 4096]. --help Show this screen. --version Show version. """ @@ -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[''], postgis_ver=args['--postgis-ver'], @@ -59,6 +62,7 @@ if __name__ == '__main__': gzip=args['--gzip'] and (args[''] or True), use_feature_id=False if args['--no-feature-ids'] else None, test_geometry=args['--test-geometry'], + extent=extent, ) if args['--prepared']: