如何从Shapefile中选择特定区域?
我有当前的Shapefile
heitaly<- readOGR("ProvCM01012017/ProvCM01012017_WGS84.shp")
FinalData<- merge(italy, HT, by.x="COD_PROV", by.y="Domain")
,但我在所有意大利都不有趣,而是同一个省份。我怎么能得到他们?
I have the present shapefile
heitaly<- readOGR("ProvCM01012017/ProvCM01012017_WGS84.shp")
FinalData<- merge(italy, HT, by.x="COD_PROV", by.y="Domain")
But I'm interesting not on all Italy, but also same provinces. How can I get them?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有很多方法可以将类别选择为shapefile。我不知道你想要什么。例如,如果是为图中的特定区域上色或从shapefile属性表中选择一行。
绘图:
绘图(shape,col = shape $ column_name ==“ element”)#常规示例
plot(Heitaly,col = heaitaly $ cod_prov ==“省份的名称”)# shapefile
属性表:
df&lt; - shape%&gt;%data.frame
这将为您提供完整的属性表
row&lt&lt; - shape%&gt;%data.frame%&gt;%slice(1)
这将为您提供所有列的第一行。例如,如果将数字1更改为另一个数字,例如3,
我希望您有用的第3行3
There are many ways to select a category into a shapefile. I don't know for what do you want. For example if it is to colour a specific region in a plot or to select a row from shapefile attribute table.
To plot:
plot(shape, col = shape$column_name == "element") # general example
plot(heitaly, col = heitaly$COD_PROV == "name of province") # your shapefile
To attribute table:
df <- shape %>% data.frame
This will give you the complete attribute table
row <- shape %>% data.frame %>% slice(1)
This will give you the first row with all columns. If you change the number 1 to another number, for example 3, will give you the information for row number 3
I hope have been useful