Opened 13 years ago
Closed 5 years ago
#4032 closed enhancement (wontfix)
OGRLayer::SetSpatialRef
Reported by: | rblazek | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | closed_because_of_github_migration |
Component: | OGR_SRS | Version: | unspecified |
Severity: | normal | Keywords: | |
Cc: | rblazek |
Description
It would be useful to have a method which can set a CRS on an existing layer:
OGRErr OGRLayer::SetProjection (const char *); OGRErr OGR_L_SetSpatialRef ( OGRLayerH hLayer, const char *);
Currently there is no such function and no simple way to do it.
Change History (6)
comment:1 by , 13 years ago
Cc: | added |
---|
comment:2 by , 13 years ago
comment:3 by , 13 years ago
The feature was also requested here: http://lists.osgeo.org/pipermail/gdal-dev/2010-August/025793.html
Another problem: some formats may probably define SRS for the whole dataset instead of for individual layers, then OGRLayer::SetProjection() could be problematic. Are there such formats? At least GRASS defines SRS for location.
comment:4 by , 13 years ago
I do not thing resetting the SRS should reproject the images. It should just reassign the SRS.
I believe this feature should be introduced via an RFC so the various issues can be clarified and agreed upon.
comment:6 by , 5 years ago
Milestone: | → closed_because_of_github_migration |
---|---|
Resolution: | → wontfix |
Status: | new → closed |
This ticket has been automatically closed because Trac is no longer used for GDAL bug tracking, since the project has migrated to GitHub. If you believe this ticket is still valid, you may file it to https://github.com/OSGeo/gdal/issues if it is not already reported there.
Linking to the initial need, which was related to shapefile .prj : http://lists.osgeo.org/pipermail/gdal-dev/2011-April/028351.html
Before going into implementation, OGR_L_SetSpatialRef() would require a bit of thinking, in particular (not exhaustive) :
As far as the API itself is concerned, a choice should be made. Your proposal looks more to what is done at the GDAL side (SRS exchanged as their WKT representation), but currently OGR works directly with OGRSpatialReferenceH in OGR_DS_CreateLayer() and OGR_G_GetSpatialReference(). And the name of the C++ method and the C function should ideally be as close as possible.