Clipping a coloured raster with polygon shp in gdalwarp changes original values, why?

المشرف العام

Administrator
طاقم الإدارة
I need to clip my raster based on a polygonal shapefile, hence I use:

gdalwarp -cutline border200millas_polygon.shp -crop_to_cutline chl.2015.04.01_2015.04.08.aqua-color.tiff out.tiffThis should do the trick, but it doesn't. As result I get a black raster. After checking and comparing output values from both original and clipped raster I noticed that raster values of the clipped raster were much lower that those of the original raster (out.tiff being the clipped raster):

Files: chl.2015.04.01_2015.04.08.aqua-color.tiff | Files: out.tiffSize is 2606, 2553 | Size is 1632, 1913Origin = (-90.463892341650677,0.065232508032915) | Origin = (-84.673288999992508,-3.392115000001818)Pixel Size = (0.008784683301344,-0.008784616065831) | Pixel Size = (0.008786027376501,-0.008785333088489)Upper Left ( -90.4638923, 0.0652325) ( 90d27'50.01"W, 0d 3'54.84"N) | Upper Left ( -84.6732890, -3.3921150) ( 84d40'23.84"W, 3d23'31.61"S)Lower Left ( -90.4638923, -22.3618923) ( 90d27'50.01"W, 22d21'42.81"S) | Lower Left ( -84.6732890, -20.1984572) ( 84d40'23.84"W, 20d11'54.45"S)Upper Right ( -67.5710077, 0.0652325) ( 67d34'15.63"W, 0d 3'54.84"N) | Upper Right ( -70.3344923, -3.3921150) ( 70d20' 4.17"W, 3d23'31.61"S)Lower Right ( -67.5710077, -22.3618923) ( 67d34'15.63"W, 22d21'42.81"S) | Lower Right ( -70.3344923, -20.1984572) ( 70d20' 4.17"W, 20d11'54.45"S)Center ( -79.0174500, -11.1483299) ( 79d 1' 2.82"W, 11d 8'53.99"S) | Center ( -77.5038907, -11.7952861) ( 77d30'14.01"W, 11d47'43.03"S)Band 1 Block=2606x1 Type=Byte, ColorInterp=Red | Band 1 Block=1632x1 Type=Byte, ColorInterp=Red Minimum=0.000, Maximum=255.000, Mean=160.832, StdDev=122.633 | Minimum=0.000, Maximum=255.000, Mean=0.001, StdDev=0.479 STATISTICS_MEAN=160.83171664774 | STATISTICS_MEAN=0.00089845791949817 STATISTICS_STDDEV=122.63291968596 | STATISTICS_STDDEV=0.47865014597867Band 2 Block=2606x1 Type=Byte, ColorInterp=Green | Band 2 Block=1632x1 Type=Byte, ColorInterp=Green Minimum=0.000, Maximum=255.000, Mean=175.865, StdDev=108.243 | Minimum=0.000, Maximum=255.000, Mean=0.001, StdDev=0.488 STATISTICS_MEAN=175.86531037027 | STATISTICS_MEAN=0.00096059725510696 STATISTICS_STDDEV=108.24324530596 | STATISTICS_STDDEV=0.48752743191956Band 3 Block=2606x1 Type=Byte, ColorInterp=Blue | Band 3 Block=1632x1 Type=Byte, ColorInterp=Blue Minimum=0.000, Maximum=255.000, Mean=252.883, StdDev=20.256 | Minimum=0.000, Maximum=255.000, Mean=0.001, StdDev=0.540 STATISTICS_MEAN=252.88313208935 | STATISTICS_MEAN=0.0011434918975431 STATISTICS_STDDEV=20.25592618995 | STATISTICS_STDDEV=0.53998993166519What would be the reason for this? Using -dstalpha just produces a blank output. I simply need to clip my original raster... nothing more than that. If I use gdal_rasterize instead, I can succesfully delete the polygonal shapefile from my original raster WITHOUT changing the raster original values, as explained here.

gdalinfo of the original raster below:

gdalinfo -mm -stats chl.2015.04.01_2015.04.08.aqua-color.tiff Driver: GTiff/GeoTIFFFiles: chl.2015.04.01_2015.04.08.aqua-color.tiffSize is 2606, 2553Coordinate System is:GEOGCS["WGS 84", DATUM["WGS_1984", SPHEROID["WGS 84",6378137,298.257223563, AUTHORITY["EPSG","7030"]], AUTHORITY["EPSG","6326"]], PRIMEM["Greenwich",0], UNIT["degree",0.0174532925199433], AUTHORITY["EPSG","4326"]]Origin = (-90.463892341650677,0.065232508032915)Pixel Size = (0.008784683301344,-0.008784616065831)Metadata: AREA_OR_POINT=AreaImage Structure Metadata: INTERLEAVE=PIXELCorner Coordinates:Upper Left ( -90.4638923, 0.0652325) ( 90d27'50.01"W, 0d 3'54.84"N)Lower Left ( -90.4638923, -22.3618923) ( 90d27'50.01"W, 22d21'42.81"S)Upper Right ( -67.5710077, 0.0652325) ( 67d34'15.63"W, 0d 3'54.84"N)Lower Right ( -67.5710077, -22.3618923) ( 67d34'15.63"W, 22d21'42.81"S)Center ( -79.0174500, -11.1483299) ( 79d 1' 2.82"W, 11d 8'53.99"S)Band 1 Block=2606x1 Type=Byte, ColorInterp=Red Computed Min/Max=0.000,255.000 Minimum=0.000, Maximum=255.000, Mean=160.832, StdDev=122.633 Metadata: STATISTICS_MAXIMUM=255 STATISTICS_MEAN=160.83171664774 STATISTICS_MINIMUM=0 STATISTICS_STDDEV=122.63291968596Band 2 Block=2606x1 Type=Byte, ColorInterp=Green Computed Min/Max=0.000,255.000 Minimum=0.000, Maximum=255.000, Mean=175.865, StdDev=108.243 Metadata: STATISTICS_MAXIMUM=255 STATISTICS_MEAN=175.86531037027 STATISTICS_MINIMUM=0 STATISTICS_STDDEV=108.24324530596Band 3 Block=2606x1 Type=Byte, ColorInterp=Blue Computed Min/Max=0.000,255.000 Minimum=0.000, Maximum=255.000, Mean=252.883, StdDev=20.256 Metadata: STATISTICS_MAXIMUM=255 STATISTICS_MEAN=252.88313208935 STATISTICS_MINIMUM=0 STATISTICS_STDDEV=20.25592618995

أكثر...
 
أعلى