I have a problem with reading my shapefile. The error:

Cannot open data source

In addition:

Warning messages:

1: In normalizePath(path.expand(path), winslash, mustWork) :
path[1]="D:/Pentru Disertatie/De pe RRRRRRR/ro_judete_poligon": The system cannot find the file specified

2: In normalizePath(path.expand(path), winslash, mustWork) :
path[1]="D:\Pentru Disertatie\De pe RRRRRRR\ro_judete_poligon": The system cannot find the file specified

  • Welcome to GIS.se! Please edit your post and include the actual code that produced the error - not just the error message! Also helpful if you provide more information about what you're doing and if the shapefile opens successfully in other apps such as QGIS. – Simbamangu Aug 1 '18 at 12:50
  • Try with raster::shapefile("D:/Pentru Disertatie/De pe RRRRRRR/ro_judete_poligon.shp") – aldo_tapia Aug 1 '18 at 13:16

With your code I think that the error may come from the space you leave here:

"D:/Pentru Disertatie/De pe RRRRRRR/ro_judete_poligon" and also not to specify the extension "ro_judete_poligon.shp".

With the package "sf" you can use the following code :


poly = read_sf(folder path/ro_judete_poligon.shp")

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.