Opened 4 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 Mariusz Felisiak, 4 years ago

Easy pickings: unset
Summary: Adding SpatialReference to GDALRaster.transformAdding srs parameter to GDALRaster.transform().
Triage Stage: UnreviewedAccepted
Version: 3.0master

Thanks for this ticket, this feature would require changes in API, i.e. adding srs parameter to transform() and deprecating srid. But I agree that it will increase flexibility. Do you want to prepare a patch?

comment:2 by Riccardo, 4 years ago

Owner: changed from nobody to Riccardo
Status: newassigned

Yeah, will come to it in the next days.

comment:3 by Mariusz Felisiak, 4 years ago

Has patch: set

comment:4 by Claude Paroz, 4 years ago

Patch needs improvement: set

comment:5 by Claude Paroz, 4 years ago

Patch needs improvement: unset

Should be ready for a final review.

comment:6 by Mariusz Felisiak, 4 years ago

Patch needs improvement: set

comment:7 by Mariusz Felisiak, 4 years ago

Patch needs improvement: unset
Triage Stage: AcceptedReady for checkin

comment:8 by Mariusz Felisiak <felisiak.mariusz@…>, 4 years ago

Resolution: fixed
Status: assignedclosed

In cb0da63:

Fixed #31713 -- Added SpatialReference support to GDALRaster.transform().

Note: See TracTickets for help on using tickets.
Back to Top