[R] Opening shapefiles in R
t@v|b@r @end|ng |rom gm@||@com
Sat Oct 22 11:28:41 CEST 2022
First: as Jeff pointed out, you'll probably have better luck posting to
the r-sig-geo list.
On 21/10/2022 14:25, Nick Wray wrote:
> I have managed to download and plot the outline for the River Tweed In the
> Sottish borders) catchment using this code. 21009 is a zipfile downloaded
> from the FEH website https://fehweb.ceh.ac.uk/Map:
> shape <- readOGR(dsn ="C:/Users/nick/Desktop/PhD Oct 22", layer = "21009")
Second: The R-spatial "ecosystem" has undergone some major changes
recent years. You'd be well advised, I think, to switch to using the
`sf` package for vector data. So reading in a shapefile would be
Third: Regarding your other post about string representations of
geometries. Can you be more specific as to what your final goal is? The
"canonical" string representation of geometries is Well Known Text (WKT)
and can be returned with the `sf::st_as_text()` function. Does that help?
> and I get an outline of the Tweed catchment which I can use
> the zipfile has eight documents all with the name “21009.” and the suffixes
> cpg/dbf/prj/sbn/sbx/shp/shp/shx There are two .shp docs, one labelled as
> SHP file and one as XML file.
> I then have downloaded a file of a plot of all the rivers in the uk from
> I’ve put this data into a zipfile with the name “rivers” Within this are
> eight docs – four with the names HydroNode. and suffixes dbf/prj/shp/shx
> and four with the name WatercourseLink. and the four suffixes.
> Just subbing in “rivers” for “21009” in my code above doesn’t work and I
> can’t find a way of getting into the shapefiles and opening them
> I'd be grateful if anyone can help me get further with this
> Thanks Nick Wray
> [[alternative HTML version deleted]]
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
Ben Gurion Univ.
Sde Boker, Remote Sensing Lab
More information about the R-help