Sign in
Log inSign up
Nayan Das

56 likes

·

6.2K reads

2 comments

Tawanda K
Tawanda K
Jul 24, 2021

Hi, Thanks for the write up. You say

  • Bangalore city: It can be represented as (12.9716°N, 77.5946°E) in SRID 4326 ... We would use SRID 4326 which is used by GeoDjango by default

In the above you imply (northerly, easterly) ordering i.e (latitude, longitude) And in your examples you have the ordering latitude, longitude

However GeoDjango says in its docs

REF 1

The default spatial reference system for geometry fields is WGS84 (meaning the SRID is 4326) – in other words, the field coordinates are in longitude, latitude pairs in units of degrees.

Also the GeoJson spec specifies the order longitude, latitude

REF 2

A position is an array of numbers.  There MUST be two or more
   elements.  The first two elements are longitude and latitude, or
   easting and northing

You seem to be storing this in the wrong order in your database, anything I am missing that could help?

·
Paul Onteri
Paul Onteri
Sep 9, 2022

Good read!

·