#5081 closed defect (fixed)
[PATCH] gdalwarp does not honour -s_srs with -cutline option
Reported by: | etourigny | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | 1.10.1 |
Component: | Algorithms | Version: | unspecified |
Severity: | normal | Keywords: | warp, cutline |
Cc: |
Description
When a cutline is used and source srs is not known (but set using -s_srs option), the following warning is given and source crs remains unknown.
Warning : the input vector layer has a SRS, but the source raster dataset does not. Cutline results may be incorrect.
This simple patch resolves the issue by using the SRC_SRS value stored in papszTO.
Index: apps/gdalwarp.cpp =================================================================== --- apps/gdalwarp.cpp (revision 25996) +++ apps/gdalwarp.cpp (working copy) @@ -2128,6 +2128,9 @@ else if( GDALGetGCPProjection( hSrcDS ) != NULL ) pszProjection = GDALGetGCPProjection( hSrcDS ); + if( pszProjection == NULL || EQUAL( pszProjection, "" ) ) + pszProjection = CSLFetchNameValue( papszTO, "SRC_SRS" ); + if( pszProjection != NULL ) { hRasterSRS = OSRNewSpatialReference(NULL);
Change History (3)
comment:1 by , 11 years ago
comment:2 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
fixed in trunk (r26004), later will apply to 1.10 also along with other patches
Note:
See TracTickets
for help on using tickets.
Etienne, the patch makes sense to me. Please commit.