rspatial / raster

R raster package https://rspatial.github.io/raster/reference/raster-package.html
GNU General Public License v3.0
161 stars 53 forks source link

Error to transform shapfile to raster for interpolation #333

Closed GuilhermeMassala closed 6 months ago

GuilhermeMassala commented 6 months ago

Someone can help me with this problem?

limites <- shapefile("D:/Cursos/Kriging/Kriginh/164_MUNICIPIOS.shp")
r = raster::raster(limites, res = 10) #   "res" definição da resolução dos pixéis
rp = raster::rasterize(limites, r, 0)
grid = as(rp, "SpatialPixelsDataFrame")
sp::plot(grid)
sp::proj4string(data) = CRS(proj4string(grid))

Error in .local(x, ...) : file.exists(extension(x, ".shx")) is not TRUE

rhijmans commented 6 months ago

You have an incomplete shapefile. This site is not for bug reports. You can use stackoverflow etc to ask for help.