[R-sig-Geo] raster() and projection

Agustin Lobo alobolistas at gmail.com
Thu Dec 3 20:18:46 CET 2009


You are right.
I was unjustifiably assuming that the projection info of the
raster was right just because I could display it in QGIS at
its right position, but...

$ gdalinfo -nomd mde10mny.tif
Driver: GTiff/GeoTIFF
Files: mde10mny.tif
        mde10mny.aux
        mde10mny.rrd
        mde10mny.tif.aux.xml
Size is 2788, 2333
Coordinate System is:
LOCAL_CS[" Geocoding information not available Projection Name = Unknown Units = 
other GeoTIFF Units = other",
     UNIT["unknown",1]]
Origin = (435926.940000000002328,4636392.540000000037253)
Pixel Size = (10.000000000000000,-10.000000000000000)
Corner Coordinates:
Upper Left  (  435926.940, 4636392.540)
Lower Left  (  435926.940, 4613062.540)
Upper Right (  463806.940, 4636392.540)
Lower Right (  463806.940, 4613062.540)
Center      (  449866.940, 4624727.540)
Band 1 Block=64x64 Type=Float32, ColorInterp=Gray
   Overviews: 697x584, 349x292, 175x146, 88x73, 44x37

Thanks

Agus

Robert J. Hijmans wrote:
> Hi Agus,
> 
> How do you know the tif file has correct information. It likely is not
> something that gdal understands
> 
> Can you show:
> 
> raster("/media/Transcend/MONTSENY2008/MONTSENY_GEODATA/mde10mny.tif")
> 
> GDALinfo("/media/Transcend/MONTSENY2008/MONTSENY_GEODATA/mde10mny.tif")
> 
> and a command line gdalinfo to the same file?
> 
> Thanks, Robert
> 
> 
> On Wed, Dec 2, 2009 at 1:38 PM, Agustin Lobo <alobolistas at gmail.com> wrote:
>> Hi!
>>
>> Why is it that when we "read" a raster i.e.
>> dem <- raster("/media/Transcend/MONTSENY2008/MONTSENY_GEODATA/mde10mny.tif")
>>
>> (where the tif file is a geotif file with correct projection informatio)
>> we actually do not get the projection information?
>>
>>> projection(dem)
>> [1] "NA"
>>
>> By now I solve it thanks to a SPDF:
>>> delme <-
>>> readOGR(dsn="/media/Transcend/MONTSENY2008/MONTSENY_GEODATA/Limitparcplaespecial",
>>> layer="AmbitPlaEspecial")
>>> projection(dem) <- projection(delme)
>> Am I doing something wrong?
>>
>> Thanks
>>
>> Agus
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo at stat.math.ethz.ch
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>



More information about the R-sig-Geo mailing list