[R-sig-Geo] Saving a spatial point object into a shapefile

Alexandre Villers villers.alexandre at gmail.com
Thu Nov 4 11:22:49 CET 2010


Hey,

The writeOGR function specifies (?writeOGR)
|obj| a SpatialPointsDataFrame, SpatialLinesDataFrame, or a 
SpatialPolygonsDataFrame object.

You need to convert first your SpatialPoints into spgdf

Best regards


Alex

On 04/11/2010 12:16, Manuel Spínola wrote:
> Dear list members,
>
> I am trying to save a spatial point object as a shapefile, but I got an
> error that I do not have the right object class, why?
>
>   >  sitiosMikeCRTM05
> SpatialPoints:
>                x       y
>    [1,] 480244.6 1181636
>    [2,] 480651.1 1184371
>    [3,] 477555.2 1181189
>    [4,] 486482.8 1167946
>    [5,] 483764.4 1164624
>    [6,] 477301.6 1192979
>    [7,] 483737.4 1192048
>    [8,] 480760.2 1192652
>    [9,] 479985.8 1150756
> [10,] 481748.5 1148902
> [11,] 476126.6 1165617
> [12,] 464735.7 1167079
> [13,] 481182.4 1185941
> [14,] 500632.8 1132727
> Coordinate Reference System (CRS) arguments: +proj=tmerc +lon_0=-84
> +lat_0=0 +x_0=500000 +k=0.9999 +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0
>
>   >  writeOGR(sitiosMikeCRTM05,
> dsn="C:/ProyectosRespacial/CBSS/Shapefiles_proyectados",
> layer="sitiosMikeCRTM05", driver="ESRI Shapefile")
> Error en writeOGR(sitiosMikeCRTM05, dsn =
> "C:/ProyectosRespacial/CBSS/Shapefiles_proyectados",  :
>     obj of wrong class
>
> Best,
>
> Manuel
>
>
>
>
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo


-- 
Alexandre Villers, PhD.
Postdoc researcher
Spatial Ecology & Population Dynamics
Section of Ecology, Department of Biology
University of Turku
FIN-20014 Turku
Finland

@mail: alexandre.villers at utu.fi
phone: 00358 (0)2 333 5049

Skype You can skype me (but think of using Ekiga instead !) 
<skype:aquila06?call>


*Use open source and free softwares*
<http://cran.r-project.org/> <http://grass.itc.it/> 
<http://www.qgis.org/> <http://fr.openoffice.org/> 
<http://www.mozilla-europe.org/fr/> <http://www.mozilla-europe.org/fr/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20101104/59f5840c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Skypelogo.jpg
Type: image/jpeg
Size: 5395 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20101104/59f5840c/attachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Rlogo.jpg
Type: image/jpeg
Size: 1753 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20101104/59f5840c/attachment-0001.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GRASSlogo.png
Type: image/png
Size: 3277 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20101104/59f5840c/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: QGIS.png
Type: image/png
Size: 4144 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20101104/59f5840c/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OOlogo.gif
Type: image/gif
Size: 4246 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20101104/59f5840c/attachment.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TBlogo.jpg
Type: image/jpeg
Size: 1385 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20101104/59f5840c/attachment-0002.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: FFlogo.jpg
Type: image/jpeg
Size: 1686 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20101104/59f5840c/attachment-0003.jpg>


More information about the R-sig-Geo mailing list