Geographic Information Systems Asked by fionant97 on September 29, 2020
I am trying to plot a shapefile on top of a raster using the command readOGR
. My current code is:
CEZ <- readOGR(".", "Shapefile/CEZ1")
This is followed by the error code
Error in ogrInfo(dsn = dsn, layer = layer, encoding = encoding, use_iconv = use_iconv, :
Cannot open data source
I am unsure what this code means – Is it a problem with the shapefile, the command or the way I have structured the path?
The raster package has a handy wrapper function for reading shapefiles. You should be able to do:
library(raster)
CEZ <- shapefile("./Shapefile/CEZ1.shp")
if that's where your shapefile really is. You might get a better error message.
Answered by Spacedman on September 29, 2020
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP