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@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.vill...@utu.fi
phone: 00358 (0)2 333 5049

Skype You can skype me (but think of using
            Ekiga instead !)

Use open source and free softwares
_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@stat.math.ethz.ch
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Reply via email to