Open submarcos opened 3 years ago
Stackoverflow has a question on this here: https://stackoverflow.com/questions/65508291/how-to-create-mapbox-vector-tiles-with-django-orm-and-postgis
It's possible to write a custom aggregate, but
It seems not to be simple to resolve that, because aggregation and column rename are define in SQLAggregate Compiler which can't be override
-> Feature.objects.filter(xxx).annotate(geom_prepared=AsMVTGeom('geom', xxx)).aggregate(tile=AsMVT(xxx))
-> Layer.objects.values('name').aggregate(tile=AsMVT(Feature.objects.annotate(geom_prepared=AsMVTGeom('geom', xxx)).filter(layer_id=OuterRef('pk')), xxx))