[R-sig-Geo] Fwd: raster: extract is empty with polygon

Robert Hijmans r.hijmans at gmail.com
Fri Mar 25 18:10:55 CET 2011


> 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
>


This is problematic:

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

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)

>From what I understood from you, QGIS does

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.



More information about the R-sig-Geo mailing list