[R-sig-Geo] raster CRS changes on tis own

Agustin Lobo alobolistas at gmail.com
Mon Nov 19 17:43:35 CET 2012


Your intuition was right. The problem is not present any more with:

> require(rgdal)
Loading required package: rgdal
Geospatial Data Abstraction Library extensions to R successfully loaded
Loaded GDAL runtime: GDAL 1.9.2, released 2012/10/08
Path to GDAL shared files: /usr/share/gdal/1.9
Loaded PROJ.4 runtime: Rel. 4.8.0, 6 March 2012, [PJ_VERSION: 480]
Path to PROJ.4 shared files: (autodetected)

Changes:
1. GDALinfo(paste(mosdir,"mosaico_envi.dat",sep="/"))
states that the CRS is
+proj=utm +zone=30 +ellps=GRS80 +units=m +no_defs
and not any more
+proj=utm +zone=30 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs

2. subset() does not change the projection on its own any more:
> vinedomosaicMCA03v2 <- subset(vinedomosaicMCA03,c(3,1,2,4,5,6))
> projection(vinedomosaicMCA03v2)
[1] "+proj=utm +zone=30 +ellps=GRS80 +units=m +no_defs"


I can accept reproducing the R console was not the most readable option,
but linking to the original file was correct: Precisly, one problem
was that R was changing the CRS,
so I could not make an smaller version and gave access to the
original (and external) file, which had a correct hdr as I had
previoulsy checked.


On Tue, Nov 13, 2012 at 8:45 PM, Roger Bivand <Roger.Bivand at nhh.no> wrote:
> On Tue, 13 Nov 2012, Agustin Lobo wrote:
>
>> Roger,
>> I'm not dumping anything on anybody: those are links that you download if
>> you want to, and that I posted only after you requested an example. Also,
>> could you post your session info? According to what you say and what I
>> reproduce we get different results for the same file and objects.
>
>
> That is precisely why I asked you to provide another example of the problem.
> If the problem cannot be reproduced with other data on your system, then it
> is limited to your initial data set, or the specific code used when the
> unexpected behaviour occurred. If you can reproduce it for similar data
> sets, then it is your system. I did note that you are running rgdal 0.7-5,
> mine is 0.7-22 (the current CRAN version). In my case the crucial startup
> messages are:
>
> Loaded GDAL runtime: GDAL 1.9.2, released 2012/10/08
> Path to GDAL shared files: /usr/local/share/gdal
> Loaded PROJ.4 runtime: Rel. 4.8.0, 6 March 2012, [PJ_VERSION: 480]
> Path to PROJ.4 shared files: (autodetected)
>
> but yours are unknown. I install GDAL and PROJ.4 from source; like you, I am
> on:
>
> Platform: x86_64-unknown-linux-gnu (64-bit)
> (you are: x86_64-pc-linux-gnu (64-bit))
>
> My intuition is that the problem is a stale GDAL on your system, but from
> reading the GDAL tickets and NEWS logs, I can't see an update to the ENVI
> driver that might explain where the odd extra tags are coming from, so it
> might be something else, assuming it is your system and not an idiosyncracy
> of your handling that data set.
>
> Roger
>
>
Agus



More information about the R-sig-Geo mailing list