如何从Shapefile中选择特定区域?

发布于 2025-02-03 06:34:14 字数 215 浏览 4 评论 0原文

我有当前的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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦情居士 2025-02-10 06:34:14

有很多方法可以将类别选择为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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文