<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1" bgcolor="#FFFFFF">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Hello!<br>
<br>
I ran through your example, and brought the OGR file back into R via the readOGR function.<br>
<br>
> xxx <- readOGR(dsn="C:\\ajeter",layer="toto")<br>
OGR data source with driver: ESRI Shapefile <br>
Source: "C:\ajeter", layer: "toto"<br>
with 1 features<br>
It has 2 fields<br>
> str(xxx)<br>
Formal class 'SpatialPolygonsDataFrame' [package "sp"] with 5 slots<br>
..@ data :'data.frame': 1 obs. of 2 variables:<br>
.. ..$ IDENT: num 1<br>
.. ..$ ncols: num 1000<br>
..@ polygons :List of 1<br>
.. ..$ :Formal class 'Polygons' [package "sp"] with 5 slots<br>
.. .. .. ..@ Polygons :List of 1<br>
.. .. .. .. ..$ :Formal class 'Polygon' [package "sp"] with 5 slots<br>
.. .. .. .. .. .. ..@ labpt : num [1:2] 700500 6500500<br>
.. .. .. .. .. .. ..@ area : num 1e+06<br>
.. .. .. .. .. .. ..@ hole : logi FALSE<br>
.. .. .. .. .. .. ..@ ringDir: int 1<br>
.. .. .. .. .. .. ..@ coords : num [1:5, 1:2] 700000 700000 701000 701000 700000 ...<br>
.. .. .. ..@ plotOrder: int 1<br>
.. .. .. ..@ labpt : num [1:2] 700500 6500500<br>
.. .. .. ..@ ID : chr "0"<br>
.. .. .. ..@ area : num 1e+06<br>
..@ plotOrder : int 1<br>
..@ bbox : num [1:2, 1:2] 700000 6500000 701000 6501000<br>
.. ..- attr(*, "dimnames")=List of 2<br>
.. .. ..$ : chr [1:2] "x" "y"<br>
.. .. ..$ : chr [1:2] "min" "max"<br>
..@ proj4string:Formal class 'CRS' [package "sp"] with 1 slot<br>
.. .. ..@ 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"<br>
> <br>
If you put that big @projagrs into google.com, this is what you get:<br>
<pre style="color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; white-space: pre-wrap;">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";<br><br>Is that what you want, please?<br><br>Thanks,<br>Erin<br><br></pre>
<br>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF137580"><font face="Tahoma" color="#000000" size="2"><b>From:</b> R-sig-Geo [r-sig-geo-bounces@r-project.org] on behalf of PONS Frederic - CEREMA/DTerMed/DREC/SRILH [Frederic.Pons@cerema.fr]<br>
<b>Sent:</b> Tuesday, September 22, 2015 9:25 AM<br>
<b>To:</b> r-sig-geo@r-project.org<br>
<b>Subject:</b> [R-sig-Geo] Problem in EPSG 2154 => 102110<br>
</font><br>
</div>
<div></div>
<div>
<div class="moz-cite-prefix">Dear R-users,<br>
<br>
I have a problem when I create a spatialpolygondataframe<br>
<br>
I want to have an EPSG 2154 but after the export the epsg is 102110.<br>
<br>
It seems to be the "same" CRS but it is not what I want.<br>
<br>
A small example to help me<br>
Best regards<br>
<br>
xlla=700000<br>
ylla=6500000<br>
ncolsa=1000<br>
nrowsa=1000<br>
cellsizea=1<br>
<br>
tableau <- data.frame(IDENT = 1, ncols = 1000, row.names = 1)<br>
<br>
crds <- cbind(x=c(xlla,xlla+ncolsa*cellsizea, xlla+ncolsa*cellsizea, xlla, xlla), y=c(ylla, ylla, ylla+nrowsa*cellsizea, ylla+nrowsa*cellsizea, ylla))<br>
<br>
Pa <- Polygon (crds)<br>
Psa <- Polygons (list ( Pa ), 1)<br>
pola <- SpatialPolygons (list ( Psa ), proj4string=CRS("+init=epsg:2154"))<br>
SPDFa <- SpatialPolygonsDataFrame(pola, tableau)<br>
<br>
writeOGR(SPDFa, dsn="C:\\ajeter",layer="toto",driver="ESRI Shapefile",overwrite_layer=TRUE)<br>
<br>
<div class="moz-signature"><font face="Arial" size="2,5"><b>Frédéric Pons </b></font><br>
<div class="moz-signature">
<div class="moz-signature"><font face="Arial" color="#666666" size="1"><b>Expert hydraulique sur les inondations et aléas côtiers
<br>
</b></font><font face="Arial" color="#666666" size="1"><b>DREC/Service Risques Inondations Littoraux et Hydraulique
</b></font><font face="Arial" color="#666666" size="1"><b>- Tél.: (33)4 42 24 76 68
</b></font><br>
<font face="Arial" color="#666666" size="1"><b>Direction Territoriale Méditerranée<br>
</b></font><img alt="" src="cid:part1.04060105.02070900@cerema.fr" height="45" width="183"><br>
<div class="moz-signature"><font face="Arial" color="#ee7f00" size="1">Centre d’études et d’expertise sur les risques, l’environnement, la mobilité et l’aménagement
</font><br>
<a href="http://www.cerema.fr" class="moz-signature" target="_blank"><font face="Arial" color="#ee7f00" size="4">www.cerema.fr</font></a><br>
</div>
</div>
</div>
</div>
</div>
<br>
</div>
</div>
</div>
</body>
</html>