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
- [Django]-Django: How can I implement Hierarchy of classes in Django?
- [Django]-Django: Display contents of txt file on the website
- [Django]-Django: after form.is_valid check, cleaned_data is missing the image field
- [Django]-Django admin – how to display thumbnail instead of path to file
Source:stackexchange.com