Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
316 views
in Technique[技术] by (71.8m points)

r - How to fill a shapefile with holes

Currently, I am processing spatial data in R. https://rstudio-pubs-static.s3.amazonaws.com/259089_2f5213f21003443994b28aab0a54cfd6.html

I created a time trade area by the method described on the above page. However, the shapefile I created is perforated and incomplete. I want you to tell me how to fill this hole.

https://drive.google.com/file/d/10wJxptWxs59MB9KZVTsrs0biFYN9pOa-/view?usp=sharing

Thank you for your cooperation.

question from:https://stackoverflow.com/questions/65894776/how-to-fill-a-shapefile-with-holes

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Hard to say, what's the exact issue here, as the information is not that clear. But looking at the file, you shared screenshot from shapefile in QGIS it seems that this is just a single layer for a a travel time bracket, e.g. 05-20 min travel time. Then it also makes sense that the layer is "Doughnut-shaped". This code produces several separate shapefiles, each for a different travel-time.

Could you share your code, so one could see, how you arrived at your result? Can you share which code you used for setting up the intervals, similar to this:

iso <- osrmIsochrone(loc = c(151.207049, -33.886475), breaks = seq(from = 0,to = 30, by = 5))
class(iso)

If you really just want a single shapefile, without a hole inside, try chainging breaks = seq(from = 0,to = 30, by = 5) to seq(from = 0,to = 30, by = 1) and make sure, it starts with from = 0 , not with something like from = 5.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...