An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20130127/670e8cc7/attachment.pl>
make_EPSG chile
5 messages · Orietta Nicolis, Julian Burgos, Mauricio Zambrano-Bigiarini +1 more
Hi Orietta, As the error message is telling you, R cannot find a file named "Chile" in your default folder. Just replace "Chile" with a full path to the file. All the best, Julian Julian Mariano Burgos, PhD Hafranns?knastofnunin/Marine Research Institute Sk?lagata 4, 121 Reykjav?k, Iceland S?mi/Telephone : +354-5752037 Br?fs?mi/Telefax: +354-5752001 Netfang/Email: julian at hafro.is
Dear R users, I'm trying to run the following example with data of Chile, but I didn't find a EPSG code for this country which could be used in R. data <http://inside-r.org/r-doc/utils/data>(meuse) coordinates(meuse)<-~x+y proj4string(meuse) <- CRS('+init=epsg:28992') # Line data data <http://inside-r.org/r-doc/utils/data>(meuse.grid) coordinates(meuse.grid)<-c <http://inside-r.org/r-doc/base/c>('x','y') meuse.grid<-as <http://inside-r.org/r-doc/methods/as>(meuse.grid, 'SpatialPixelsDataFrame') im<-as.image.SpatialGridDataFrame(meuse.grid['dist']) cl<-ContourLines2SLDF(contourLines<http://inside-r.org/r-doc/grDevices/contourLines> (im)) proj4string(cl) <- CRS('+init=epsg:28992') I run the script: make_EPSG("Chile") but it gives the following error: In file(file, open = "r") : cannot open file 'Chile': No such file or directory Please, can anyone suggest me how to solve this problem? Thank you very much, Orietta [[alternative HTML version deleted]]
_______________________________________________ R-sig-Geo mailing list R-sig-Geo at r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo
On 27/01/13 22:09, Orietta Nicolis wrote:
Dear R users, I'm trying to run the following example with data of Chile, but I didn't find a EPSG code for this country which could be used in R.
Hi Orietta,
AFAIK, in Chile there are two main local projections:
PSAD56 / UTM zone 18S, and
PSAD56 / UTM zone 19S
which are used depending on the latitude you are working on.
For PSAD56_Z19S, you may try:
library(sp)
psad56.p4s <- CRS("+proj=utm +zone=19 +south +ellps=intl +units=m +no_defs")
which is equivalent to use EPSG:24879
if you need higher precision, you may need to add the '+towgs84'
argument to 'psad56.p4s'
Saludos,
Mauricio
PS,
I'm happy to know there are people in Chile using R !
================================================= Water Resources Unit Institute for Environment and Sustainability (IES) Joint Research Centre (JRC), European Commission TP 261, Via Enrico Fermi 2749, 21027 Ispra (VA), IT webinfo : http://floods.jrc.ec.europa.eu/ ================================================= DISCLAIMER: "The views expressed are purely those of the writer and may not in any circumstances be regarded as sta- ting an official position of the European Commission" ================================================= Linux user #454569 -- Ubuntu user #17469 ================================================= "True courage is a result of reasoning. A brave mind is always impregnable" (Jeremy Collier) > data<http://inside-r.org/r-doc/utils/data>(meuse) > coordinates(meuse)<-~x+y proj4string(meuse)<- CRS('+init=epsg:28992') > # Line data > data<http://inside-r.org/r-doc/utils/data>(meuse.grid) > coordinates(meuse.grid)<-c<http://inside-r.org/r-doc/base/c>('x','y') > meuse.grid<-as<http://inside-r.org/r-doc/methods/as>(meuse.grid, > 'SpatialPixelsDataFrame') > im<-as.image.SpatialGridDataFrame(meuse.grid['dist']) > cl<-ContourLines2SLDF(contourLines<http://inside-r.org/r-doc/grDevices/contourLines> > (im)) > proj4string(cl)<- CRS('+init=epsg:28992') > > > I run the script: > > make_EPSG("Chile") > > but it gives the following error: > > In file(file, open = "r") : > cannot open file 'Chile': No such file or directory > Please, can anyone suggest me how to solve this problem? > Thank you very much, > Orietta > > [[alternative HTML version deleted]] > > _______________________________________________ > R-sig-Geo mailing list > R-sig-Geo at r-project.org > https://stat.ethz.ch/mailman/listinfo/r-sig-geo >
On Mon, 28 Jan 2013, Mauricio Zambrano-Bigiarini wrote:
On 27/01/13 22:09, Orietta Nicolis wrote:
Dear R users, I'm trying to run the following example with data of Chile, but I didn't find a EPSG code for this country which could be used in R.
Hi Orietta, AFAIK, in Chile there are two main local projections: PSAD56 / UTM zone 18S, and PSAD56 / UTM zone 19S
But:
EPSG <- make_EPSG()
EPSG[grep("Chile", EPSG$note), 1:2]
code note 450 5360 # SIRGAS-Chile 2697 5361 # SIRGAS-Chile / UTM zone 19S 2698 5362 # SIRGAS-Chile / UTM zone 18S all of which are WGS84 - do we know whether the +ellps in Orietta's data is GRS80 or your earlier intl? With PROJ.4 4.8.0, we get a later EPSG too, with:
CRS("+init=epsg:24879")
CRS arguments: +init=epsg:24879 +proj=utm +zone=19 +south +ellps=intl +towgs84=-288,175,-376,0,0,0,0 +units=m +no_defs which can be transformed to WGS84. Roger
which are used depending on the latitude you are working on.
For PSAD56_Z19S, you may try:
library(sp)
psad56.p4s <- CRS("+proj=utm +zone=19 +south +ellps=intl +units=m +no_defs")
which is equivalent to use EPSG:24879
if you need higher precision, you may need to add the '+towgs84' argument to
'psad56.p4s'
Saludos,
Mauricio
PS,
I'm happy to know there are people in Chile using R !
Roger Bivand Department of Economics, NHH Norwegian School of Economics, Helleveien 30, N-5045 Bergen, Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43 e-mail: Roger.Bivand at nhh.no
On 28/01/13 11:48, Roger Bivand wrote:
On Mon, 28 Jan 2013, Mauricio Zambrano-Bigiarini wrote:
On 27/01/13 22:09, Orietta Nicolis wrote:
Dear R users, I'm trying to run the following example with data of Chile, but I didn't find a EPSG code for this country which could be used in R.
Hi Orietta, AFAIK, in Chile there are two main local projections: PSAD56 / UTM zone 18S, and PSAD56 / UTM zone 19S
But:
EPSG <- make_EPSG()
EPSG[grep("Chile", EPSG$note), 1:2]
code note 450 5360 # SIRGAS-Chile 2697 5361 # SIRGAS-Chile / UTM zone 19S 2698 5362 # SIRGAS-Chile / UTM zone 18S
I do not get those values:
library(rgdal)
Loading required package: sp
rgdal: version: 0.8-4, (SVN revision 431)
Geospatial Data Abstraction Library extensions to R successfully loaded
Loaded GDAL runtime: GDAL 1.8.1, released 2011/07/09
Path to GDAL shared files: /usr/share/gdal
GDAL does not use iconv for recoding strings.
Loaded PROJ.4 runtime: Rel. 4.7.1, 23 September 2009, [PJ_VERSION: 470]
Path to PROJ.4 shared files: (autodetected)
EPSG <- make_EPSG()
EPSG[grep("Chile", EPSG$note), 1:2]
[1] code note
<0 rows> (or 0-length row.names)
which is very likely due to the fact I'm using PROJ4 4.7.1 :(
all of which are WGS84 - do we know whether the +ellps in Orietta's data is GRS80 or your earlier intl?
She didn't mention it. I was working in Chile up to 2006, and at that time most of the cartography I saw from public institutions (related to water) used intl as ellipsoid. However, last December I realized the cartography (related to water) used WGS84.
With PROJ.4 4.8.0, we get a later EPSG too, with:
CRS("+init=epsg:24879")
CRS arguments: +init=epsg:24879 +proj=utm +zone=19 +south +ellps=intl +towgs84=-288,175,-376,0,0,0,0 +units=m +no_defs
Thank you very much for this info. I'll try to update my PROJ4.
which can be transformed to WGS84.
I recently used that projection. Then, when I transformed some features to WGS84 for visualizing in Google Earth, all of them were in close agreement with GE. Mauricio
Roger
which are used depending on the latitude you are working on.
For PSAD56_Z19S, you may try:
library(sp)
psad56.p4s <- CRS("+proj=utm +zone=19 +south +ellps=intl +units=m
+no_defs")
which is equivalent to use EPSG:24879
if you need higher precision, you may need to add the '+towgs84'
argument to 'psad56.p4s'
Saludos,
Mauricio
PS,
I'm happy to know there are people in Chile using R !