osm.ClipSFnetwork_with_poly | R Documentation |
Clip sfnetwork by Polygon
osm.ClipSFnetwork_with_poly(innet, inpol)
innet |
sfnetwork to clip |
inpol |
sf polygon to use for clipping |
An sfnetwork
Dimitris Kavroudakis dimitris123@gmail.com
Other osm:
osm.CreateEmptyRaster()
,
osm.bb_2_pol()
,
osm.combineAmenities()
,
osm.combineShops()
,
osm.getFrequency()
,
osm.getLength_footway()
,
osm.getPOI()
,
osm.getPOI_usingbb()
,
osm.getRoads()
,
osm.myBB_2_pol()
,
osm.osmdata_result_2_bbox_pol()
library(goal)
library(sf)
library(sfnetworks)
library(tidygraph)
q=c(26.545029,39.088569,26.570177,39.116810)
net2 = osm.getRoads(q, withBB=TRUE, outcrs=4326)
poly = osm.bb_2_pol(q, outcrs = 4326)
net3 = osm.ClipSFnetwork_with_poly(net2, poly)
plot(net3, col="grey")
plot(poly, add = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.