submarcos / django-vectortiles

Mapbox VectorTiles for django, with PostGIS or Python
https://django-vectortiles.readthedocs.io
MIT License
38 stars 11 forks source link

Limit features in one tile #11

Closed StefanBrand closed 3 years ago

StefanBrand commented 3 years ago

I tried to slice the input QuerySet like this: self.queryset = input_queryset[:10000] to limit features per tile. I got this error:

Fail: AssertionError: Cannot filter a query once a slice has been taken.

Thinking about it, it does not make sense to slice before the spatial intersection, of course. So this would have to be done after this line:

https://github.com/submarcos/django-vectortiles/blob/fb2ad8ca8ea9c4384a5325599c95f363ce9e89f9/vectortiles/postgis/mixins.py#L20

FYI: pg_tileserv has a default features per tile of 10000.

submarcos commented 3 years ago

ok, maybe by adding default vector_tile_feature_limit = None and passing it to get_tile