Created
May 28, 2016 19:11
-
-
Save Xowap/c478d259a157ef35d4130c2182ad8b2a to your computer and use it in GitHub Desktop.
This file contains 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
point = geometry.centroid | |
if point.srid is not None: | |
point.transform(4326) | |
try: | |
tzid = self.filter(zone__contains=point)[0].tzid | |
return tzid, point | |
except IndexError: | |
return None, point |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment