Skip to content

Conversation

@odilxon
Copy link

@odilxon odilxon commented May 29, 2022

I had ready geofiled with SRID: 3857
and i have data on it
geometry = db.Column(Geometry(geometry_type="MULTIPOLYGON", srid=3857), nullable = True)

When i used flask admin with Leaflet, geometry transformed incorrectly,
i need: [69.224854,41.268517], but i got [0.00069224854,0.00004268517]
Then i saw query in debug toolbar
SELECT ST_AsGeoJSON(ST_Transform(ST_GeomFromEWKB(%(ST_GeomFromEWKB_1)s), %(ST_Transform_1)s)) AS "ST_AsGeoJSON_1"
He is transforming coordinates systems
in code i saw that he is always transforming from 4326 to 3857 in my case
But i don't need transforming, because of my srid in db is 3857, not 4326
Then i changed self.web_srid = self.srid, to use my srid wheli converting

IF there were other method to fix that, comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant