problem writing GML file
On Sun, Feb 21, 2010 at 9:28 PM, Michael Denslow
<michael.denslow at gmail.com> wrote:
Dear r-sig-geo,
I was able to make a SpatialPointsDataFrame just fine with the following commands.
library(rgdal)
coordinates(floras) = c('long.cent.W','lat.cent.N')
class(floras)
[1] "SpatialPointsDataFrame" attr(,"package") [1] "sp" but when I run writeOGR, I get an error
writeOGR(floras,paste(getwd(),'florasTEST.gml',sep='/'),'floras', driver = 'GML')
Error in writeOGR(floras, paste(getwd(), "florasTEST.gml", sep = "/"), ?: ?unknown data type
That's weird - writeOGR looks like it should output the type and class of the column when it gets this problem: else stop(paste(dfcls[i], dftof[i], "unknown data type")) - unless you're on a different version. Try running writeOGR in debug mode - do: debug(writeOGR) then run your writeOGR function call. Hit return to step a line at a time, and inspect variables. Or how about cutting some of your variables out and seeing what fixes it/breaks it? your sp object only seemed to have factors, numbers, and logicals and so writeOGR shouldnt have any problem with it... Barry