0

I can use writeOGR to write a shape file in R, but it's only working for spatial points data frames, and not spatial lines data frame.

This is the code I'm using. The dataframe is called HDOT2015_Bridge.

writeOGR(HDOT2015_Bridge,dsn="~/Desktop/HDOT2015/Bridges",
         layer="HDOT2015_Bridge",driver="ESRI Shapefile",morphToESRI = T)

The error says

Error in writeOGR(HDOT2015_Bridge, dsn = "~/Desktop/HDOT2015/Bridges",  : 
  Creation of output file failed
Hugo
  • 507
  • 8
  • 22
Bschrein
  • 1
  • 2
  • please provide a reproducible example. – Cyrus Mohammadian Oct 05 '16 at 23:41
  • Wild guess: does the ouput folder exist? – lbusett Oct 06 '16 at 06:18
  • The output folder exists. I can use pretty much the same code for a "SpatialPointsDataFrame" but when I try to export it with writeOGR and it's a "SpatialLinesDataFrame" I can't get it to work. Do I need to use a different driver than "ESRI Shapefile"? – Bschrein Oct 06 '16 at 15:39
  • What kind of example can I provide? I'm not sure how to show the problem more than what I shared above. – Bschrein Oct 06 '16 at 15:40
  • Ok. Sorry for the stupid question, but it happened to me lots of times.... Id say that you could share the file, if. Possible. Also, i never used morphtoesri. What it is supposed to do? Did you try removing it? – lbusett Oct 06 '16 at 17:53
  • I meant, the data frame. – lbusett Oct 06 '16 at 17:55

0 Answers0