submarcos / django-vectortiles

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

Make working with other internal SRID #3

Closed submarcos closed 3 years ago

submarcos commented 3 years ago

It's working on SRID 4326 on geometry columns.

Make it working with 3857 at least without transformation, and any other SRID

StefanBrand commented 3 years ago

What Django now does for geometry columns other than 4326: It automatically appends an additional ST_Transform:

ST_Transform(ST_Transform(
  ST_MAKEENVELOPE(
    1583775.2260688506,
    6097840.368478221,
    1584386.722295132,
    6098451.864704503,
    3857),
  4326),
31287))
StefanBrand commented 3 years ago

Actually, since Geodjango implicitly transforms the envelope, the explicit transform to 4326 could be removed. What do you think @submarcos ? I'd be happy to submit a patch.

submarcos commented 3 years ago

Hello, yes you could submit a patch ! I didn't know someone use this. I see that I forgot to make a githubaction CI and test validation. So submit your patch and I'll check your pull request and make a new release for this

StefanBrand commented 3 years ago

This package is exactly what we were looking for and I especially like the modularity with the mixins. Thanks for creating and open-sourcing this project! :+1: