Skip to content

raster: extract is empty with polygon

3 messages · Agustin Lobo, Robert J. Hijmans

#
But then this is not as in gdal. Gdalinfo states that the bottom left is 0,1760
while R states 0,0
Should not raster do as gdal?

Corner Coordinates:
Upper Left ?( ? ?0.0, ? ?0.0)
Lower Left ?( ? ?0.0, 1760.0)
Upper Right ( 2640.0, ? ?0.0)
Lower Right ( 2640.0, 1760.0)
Center ? ? ?( 1320.0, ?880.0)
Band 1 Block=2640x1 Type=UInt16, ColorInterp=Red
Band 2 Block=2640x1 Type=UInt16, ColorInterp=Green
Band 3 Block=2640x1 Type=UInt16, ColorInterp=Blue

Agus

2011/3/24 Robert J. Hijmans <r.hijmans at gmail.com>:
#
Anyway, the problem is solved by including the appropriate wld file:
1.0
0
0
-1.0
0.5
0.5

In this case, both QGIS and R (raster) keep the same coordinates and
the vector layer matches the raster layer.

Agus

2011/3/25 Agustin Lobo <alobolistas at gmail.com>:
#
0,1760
This is problematic:
unless, perhaps, you say that the vertical resolution is negative and hence
Upper is Lower. Nevertheless, what raster (rgdal) does is consistent with
gdal, because it uses the same coordinates, the same extent.

It seems that the difference is that raster / rgdal say that 0 is smaller
than 1760 and hence

Lower Left  (    0.0,    0.0)
Upper Left  (    0.0, 1760.0)
Lower Left  (    0.0, -1760.0)
Upper Left  (    0.0,    0.0)

Which is consistent of the Upper Left of GDAL. But disagrees with how GDAL
interprets the extent (bounding box).

What does GDALINFO give for the vertical resolution?

Robert


--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/raster-extract-is-empty-with-polygon-tp6205163p6208413.html
Sent from the R-sig-geo mailing list archive at Nabble.com.