Created
February 24, 2017 15:59
-
-
Save koslib/ef232cacc093380e1bde0d036fea501e to your computer and use it in GitHub Desktop.
Check if specific geo point lies inside a MultiPolynomial area (Django & GeoDjango)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.contrib.gis.geos import GEOSGeometry | |
p = GEOSGeometry("Point(-3.735295 21.624602)", srid=4326) # 4326 for standard lng/lat coordinates | |
# Transform to same coordinate system as maps | |
p.transform(27700) | |
RegionBorder.objects.filter(mpoly__contains=p) | |
[<RegionBorder: Athens>] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment