[R-sig-Geo] Problem with writeOGR()
Michael Sumner
mdsumner at gmail.com
Wed Nov 4 23:13:16 CET 2009
Hi Agustin, you will need to determine which columns in the data frame
are causing problems.
Can you run this and let us know what you see?
summary(gpsori1)
For example, you cannot write POSIXct columns to SHP and would need to
convert to text, or numeri:
library(rgdal)
d <- data.frame(x = 1:10, y = 1:10, z = 1:10)
coordinates(d) <- ~x+y
## OK
writeOGR(d, ".", "test", "ESRI Shapefile")
unlink("test.shp")
d$z <- Sys.time() + 1:10
## not OK
writeOGR(d, ".", "test", "ESRI Shapefile")
Regards, Mike.
On Thu, Nov 5, 2009 at 7:11 AM, Agustin Lobo <alobolistas at gmail.com> wrote:
> I'm puzzled with this:
>
>> class(gpsori1)
> [1] "SpatialPointsDataFrame"
> attr(,"package")
> [1] "sp"
>> writeOGR(gpsori1, dsn="CAST20090907",
>> layer="CAST20090907gps1",driver="ESRI Shapefile")
> Error in writeOGR(gpsori1, dsn = "CAST20090907", layer = "CAST20090907gps1",
> :
> unknown data type
>
> Am I doing something wrong or is there a recent change that I'm not aware
> of?
>
> Thanks
>
> Agus
>
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
>
More information about the R-sig-Geo
mailing list