Opened 5 years ago
Closed 4 years ago
#31713 closed New feature (fixed)
Adding srs parameter to GDALRaster.transform().
Reported by: | Riccardo | Owned by: | Riccardo |
---|---|---|---|
Component: | GIS | Version: | dev |
Severity: | Normal | Keywords: | GDALRaster; GIS; SpatialReference |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Current Limitation:
Currently a GDALRaster object can only be transformed given an integer target SRID value.
However, within GDALRaster.transform this value is used to construct a SpatialReference object which is then assigned to variable target_srs.
Proposed Solution:
Allow to pass both, integer SRID or SpatialReference object, to the GDALRaster.transform function.
This allows users to specify the target transform of the GDALRaster with SRID, PROJ4, WKT, or EPSG rather than just an integer SRID.
This would also accommodate for custom projections which is desirable and provides more flexibility to the user.
For respective code see:
https://github.com/django/django/blob/0d6d4e78b17d7500e1a503fd2b02fdcf822d9d3c/django/contrib/gis/gdal/raster/source.py#L428-L437
Change History (8)
comment:1 by , 5 years ago
Easy pickings: | unset |
---|---|
Summary: | Adding SpatialReference to GDALRaster.transform → Adding srs parameter to GDALRaster.transform(). |
Triage Stage: | Unreviewed → Accepted |
Version: | 3.0 → master |
comment:2 by , 5 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
Yeah, will come to it in the next days.
comment:4 by , 4 years ago
Patch needs improvement: | set |
---|
comment:6 by , 4 years ago
Patch needs improvement: | set |
---|
comment:7 by , 4 years ago
Patch needs improvement: | unset |
---|---|
Triage Stage: | Accepted → Ready for checkin |
Thanks for this ticket, this feature would require changes in API, i.e. adding
srs
parameter totransform()
and deprecatingsrid
. But I agree that it will increase flexibility. Do you want to prepare a patch?