[R-sig-Geo] Problem in EPSG 2154 => 102110

PONS Frederic - CEREMA/DTerMed/DREC/SRILH Frederic.Pons at cerema.fr
Wed Sep 23 11:38:25 CEST 2015


Hello

There is a very small change betwwen 2154 and 102110

+towgs84=0,0,0,0,0,0,0


If I use the small example:

library(sp)
library(rgdal)

xlla=700000
ylla=6500000
ncolsa=1000
nrowsa=1000
cellsizea=1

tableau <- data.frame(IDENT = 1, ncols = 1000, row.names = 1)

crds <- cbind(x=c(xlla,xlla+ncolsa*cellsizea, xlla+ncolsa*cellsizea, 
xlla, xlla), y=c(ylla, ylla, ylla+nrowsa*cellsizea, 
ylla+nrowsa*cellsizea, ylla))

Pa <- Polygon (crds)
Psa <- Polygons (list ( Pa ), 1)
pola <- SpatialPolygons (list ( Psa ), proj4string=CRS("+init=epsg:2154"))
SPDFa <- SpatialPolygonsDataFrame(pola, tableau)

print(SPDFa)

writeOGR(SPDFa, dsn="C:\\ajeter",layer="toto",driver="ESRI 
Shapefile",overwrite_layer=TRUE)

xxx <- readOGR(dsn="C:\\ajeter",layer="toto")
print(xxx)

For SPDFa: there is this projection:

Slot "proj4string":
CRS arguments:
  +init=epsg:2154 +proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 +lon_0=3 +x_0=700000 +y_0=6600000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs

And for xxx there is this projection:

Slot "proj4string":
CRS arguments:
  +proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 +lon_0=3 +x_0=700000 +y_0=6600000 +ellps=GRS80 +units=m +no_defs

I don't see the same argument in the CRS, and in 2154, there is this small part:

+towgs84=0,0,0,0,0,0,0

I think there is no big problem of shift but when I create a file and I put it in other GIS (Qgis), it is not recognize as 2154.

Last comment, with the shapefile, the prj don't give the same things betwwen 2154 and 102110
2154 PROJCS["Lambert_Conformal_Conic",GEOGCS["GCS_GRS 1980(IUGG, 1980)",DATUM["D_unknown",SPHEROID["GRS80",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["standard_parallel_1",49],PARAMETER["standard_parallel_2",44],PARAMETER["latitude_of_origin",46.5],PARAMETER["central_meridian",3],PARAMETER["false_easting",700000],PARAMETER["false_northing",6600000],UNIT["Meter",1]]

102110 PROJCS["RGF93_Lambert_93",GEOGCS["GCS_RGF93",DATUM["D_RGF_1993",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["standard_parallel_1",49],PARAMETER["standard_parallel_2",44],PARAMETER["latitude_of_origin",46.5],PARAMETER["central_meridian",3],PARAMETER["false_easting",700000],PARAMETER["false_northing",6600000],UNIT["Meter",1]]

GCS_RGF93 don't appear in R!


Thanks for your help
Frédéric


*Frédéric Pons *
*Expert hydraulique sur les inondations et aléas côtiers
**DREC/Service Risques Inondations Littoraux et Hydraulique **- Tél.: 
(33)4 42 24 76 68 *
*Direction Territoriale Méditerranée
*
Centre d’études et d’expertise sur les risques, l’environnement, la 
mobilité et l’aménagement
www.cerema.fr <http://www.cerema.fr>
Le 22/09/2015 16:44, > Hodgess, Erin (par Internet) a écrit :
> Hello!
>
> I ran through your example, and brought the OGR file back into R via 
> the readOGR function.
>
> > xxx <- readOGR(dsn="C:\\ajeter",layer="toto")
> OGR data source with driver: ESRI Shapefile
> Source: "C:\ajeter", layer: "toto"
> with 1 features
> It has 2 fields
> > str(xxx)
> Formal class 'SpatialPolygonsDataFrame' [package "sp"] with 5 slots
>   ..@ data       :'data.frame': 1 obs. of  2 variables:
>   .. ..$ IDENT: num 1
>   .. ..$ ncols: num 1000
>   ..@ polygons   :List of 1
>   .. ..$ :Formal class 'Polygons' [package "sp"] with 5 slots
>   .. .. .. ..@ Polygons :List of 1
>   .. .. .. .. ..$ :Formal class 'Polygon' [package "sp"] with 5 slots
>   .. .. .. .. .. .. ..@ labpt  : num [1:2] 700500 6500500
>   .. .. .. .. .. .. ..@ area   : num 1e+06
>   .. .. .. .. .. .. ..@ hole   : logi FALSE
>   .. .. .. .. .. .. ..@ ringDir: int 1
>   .. .. .. .. .. .. ..@ coords : num [1:5, 1:2] 700000 700000 701000 
> 701000 700000 ...
>   .. .. .. ..@ plotOrder: int 1
>   .. .. .. ..@ labpt    : num [1:2] 700500 6500500
>   .. .. .. ..@ ID       : chr "0"
>   .. .. .. ..@ area     : num 1e+06
>   ..@ plotOrder  : int 1
>   ..@ bbox       : num [1:2, 1:2] 700000 6500000 701000 6501000
>   .. ..- attr(*, "dimnames")=List of 2
>   .. .. ..$ : chr [1:2] "x" "y"
>   .. .. ..$ : chr [1:2] "min" "max"
>   ..@ proj4string:Formal class 'CRS' [package "sp"] with 1 slot
>   .. .. ..@ projargs: chr "+proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 
> +lon_0=3 +x_0=700000 +y_0=6600000 +ellps=GRS80 +units=m +no_defs"
> >
> If you put that big @projagrs into google.com, this is what you get:
> Proj4js.defs["EPSG:2154"] = "+proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 +lon_0=3 +x_0=700000 +y_0=6600000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs";
>
> Is that what you want, please?
>
> Thanks,
> Erin
>
>
> ------------------------------------------------------------------------
> *From:* R-sig-Geo [r-sig-geo-bounces at r-project.org] on behalf of PONS 
> Frederic - CEREMA/DTerMed/DREC/SRILH [Frederic.Pons at cerema.fr]
> *Sent:* Tuesday, September 22, 2015 9:25 AM
> *To:* r-sig-geo at r-project.org
> *Subject:* [R-sig-Geo] Problem in EPSG 2154 => 102110
>
> Dear R-users,
>
> I have a problem when I create a spatialpolygondataframe
>
> I want to have an EPSG 2154 but after the export the epsg is 102110.
>
> It seems to be the "same" CRS but it is not what I want.
>
> A small example to help me
> Best regards
>
> xlla=700000
> ylla=6500000
> ncolsa=1000
> nrowsa=1000
> cellsizea=1
>
> tableau <- data.frame(IDENT = 1, ncols = 1000, row.names = 1)
>
> crds <- cbind(x=c(xlla,xlla+ncolsa*cellsizea, xlla+ncolsa*cellsizea, 
> xlla, xlla), y=c(ylla, ylla, ylla+nrowsa*cellsizea, 
> ylla+nrowsa*cellsizea, ylla))
>
> Pa <- Polygon (crds)
> Psa <- Polygons (list ( Pa ), 1)
> pola <- SpatialPolygons (list ( Psa ), proj4string=CRS("+init=epsg:2154"))
> SPDFa <- SpatialPolygonsDataFrame(pola, tableau)
>
> writeOGR(SPDFa, dsn="C:\\ajeter",layer="toto",driver="ESRI 
> Shapefile",overwrite_layer=TRUE)
>
> *Frédéric Pons *
> *Expert hydraulique sur les inondations et aléas côtiers
> **DREC/Service Risques Inondations Littoraux et Hydraulique **- Tél.: 
> (33)4 42 24 76 68 *
> *Direction Territoriale Méditerranée
> *
> Centre d’études et d’expertise sur les risques, l’environnement, la 
> mobilité et l’aménagement
> www.cerema.fr <http://www.cerema.fr>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20150923/d0557b6c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cerema.png
Type: image/png
Size: 6094 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20150923/d0557b6c/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 6094 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20150923/d0557b6c/attachment-0001.png>


More information about the R-sig-Geo mailing list