-
-
Notifications
You must be signed in to change notification settings - Fork 454
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GeoDjango spatial reference fixes #1265
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can say honestly, that I don't have any clue how any of this works :)
Maybe some other maintainers have experience with geo module?
@@ -0,0 +1,20 @@ | |||
- case: test_transform |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, but I don't think this is worth adding a new test case.
We add tests for plugin related things / complex overloads.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed!
I hesitated myself after I wrote it, but when I saw gis_tests in the ignored test modules i decided to keep it in.
If it's of any help, the Django code is pretty clear with what types it expects:
Finally, the Django documentation has an example of creating a SpatialReference from an integer. This is what triggered this PR since it causes an error in mypy. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry that this got delayed for so long. None of the regular TypedDjango reviewers are familiar with GeoDango. But this looks good to me.
I have made things!
django.contrib.gis.gdal.srs.SpatialReference()
accept an EPSG code as anint
, not just a string.django.contrib.gis.gdal.srs.CoordTransform()
only acceptSpatialReference
s as arguments.django.contrib.gis.geos.GEOSGeometryBase.transform()
anddjango.contrib.gis.gdal.OGRGeometry.transform()
to acceptCoordTransform
,SpatialReference
,int
, orstr
instead ofAny
.All changes should be according to Django's documentation. A test case is included.
Related issues
None that I am aware of.