[Qgis-user] Why does clipping a raster alters cell size?
Luciano La Sala
lucianolasala at yahoo.com.ar
Tue May 19 18:14:58 PDT 2015
Dear QGIS users,
I am using QGIS V 2.2.0 (OS-Windows 8), and need to prepare raster files
(ESRI ArcInfo Grids) to be later used in a species distribucion model
using MaxEnt. Each of the original raster files (environmental variables
for Guadalquivir, Spain) has a different spatial extension (but all
share the same pixel size of 200, -200). However, to be able to use
these layers in MaxEnt, all of them need to have the exact same spatial
extent. Therefore, I clipped every raster using a polygon of
Guadalquivir. After clipping, I save as GeoTIFF but the new rasters have
their original pixel size (200,-200) slightly altered
(200.001,-199.942). I wouldn't bother too much about this menial
difference in cell size if it weren't for the warning message that I get
(see below) when trying to convert the GeoTIFF rasters to ASCII (a
requirement for MaxEnt to work):
Warning 1: Producing a Golden Surfer style file with DX and DY instead
of CELLSIZE since the input pixels are non-square. Use the
FORCE_CELLSIZE=TRUE creation option to force use of DX for
even though this will be distorted. Most ASCII Grid readers
(ArcGIS included) do not support the DX and DY parameters. .
The Layer Spatial Reference System for Guadalquivir is:
+proj=utm +zone=30 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs
The Layer Spatial Reference System for the raster layers is:
+proj=utm +zone=30 +ellps=GRS80 +units=m +no_defs
When clipping, I'm using the function raster >> Extraction >> Clipper
followed by the options...
No data value = 0
Mask layer: Guadalquivir
Following, I save the new raster as GeoTIFF.
Questions:
Should the clipping be done using a polygon with the exact same
projection? I am not sure to what extent the projections differ between
the layers above.
In case response to question is "Yes" (same projections needed), I did
the clipping using both options: first by saving Guadalquivir as .shp
with the raster's projection, and later the other way around, that is
saving raster files with Guadalquivir's projection. Regardless of the
option, pixel size remains altered/uneven.
How can I keep the original pixel size of 200,-200?
Thank you in advance.
Luciano
More information about the Qgis-user
mailing list