[Django]-Converting geometry point to lat/long in Geodjango app

7👍

Ah, I figured it out and it was so simple. You can access the Lat and Long values simply by adding ‘.x’ or ‘.y’ to the end of the django query as follows:

centroid = LGA.objects.get(name=lga).geom.centroid.x

0👍

What is your geometry point formatting? Can you provide us an example?
In my understanding, your geometry point is not in projection EPSG:4236(which is for Latitude and Longitude) but other formatting (projection) right? The normal way is convert projection in Openlayers using Point.transform method, but not be calculated in GeoDjango.

👤JSC

Leave a comment