Skip to content
Prev 18004 / 29559 Next

trailing slash when writing shapefiles with writeOGR

I just noticed that writing to a shape file using a trailing slash in
the directory path doesn't work (with a somewhat non-informative
error):
Error in writeOGR(obj = pril08c2.poly, dsn =
"q:/projekti/gams_eksp/analiza/",  :
  Creation of output file failed

While this does:
The only difference is the trailing slash in the `dsn` path to the
folder is missing. I hope this will save someone some time - it ate
away most of my Saturday morning.

Cheers,
Roman