Read shp file

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Read shp file

Medic
Help me. pls, to read .shp file.

`library("tmaptools")
geo <- read_shape("Rom.shp", as.sf = TRUE)
This function is deprecated and has been migrated to
github.com/mtennekes/oldtmaptools`

I have to turn to another function, but I get an unclear message

`library(raster)
geo <- shapefile ("Rus.shp")
Error in .local(x, ...) : file.exists(extension(x, ".shx")) is not TRUE`

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Read shp file

Michael Hannon-2
I can't help you locate the .shx file, but the gist of it is that a
"shapefile" actually requires a minimum of three files:

https://knowledge.autodesk.com/support/autocad-map-3d/learn-explore/caas/sfdcarticles/sfdcarticles/Required-files-that-make-up-a-shapefile.html

The .shx file is an index of the .shp file.

-- Mike

On Thu, Nov 21, 2019 at 10:44 AM Medic <[hidden email]> wrote:

>
> Help me. pls, to read .shp file.
>
> `library("tmaptools")
> geo <- read_shape("Rom.shp", as.sf = TRUE)
> This function is deprecated and has been migrated to
> github.com/mtennekes/oldtmaptools`
>
> I have to turn to another function, but I get an unclear message
>
> `library(raster)
> geo <- shapefile ("Rus.shp")
> Error in .local(x, ...) : file.exists(extension(x, ".shx")) is not TRUE`
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.