【发布时间】:2015-08-24 17:36:56
【问题描述】:
我从 drawpoly 中得到一个多边形:
x<- ogrListLayers(file_map)
shape=readOGR(file_map, layer=x) #will load the shapefile to your dataset.
plot(shape)
polygon<- drawPoly()
但是,我正在尝试从多边形中获取坐标,但我不能:
poligon@polygons [[1]] “多边形”类的对象 插槽“多边形”: [[1]] “多边形”类的对象 插槽“labpt”: [1] -46.37327 -23.91955
Slot "area":
[1] 0.09747001
Slot "hole":
[1] FALSE
Slot "ringDir":
[1] 1
Slot "coords":
[,1] [,2]
[1,] -46.20830 -23.73089
[2,] -46.20089 -23.73691
[3,] -46.19842 -23.74595
[4,] -46.20336 -23.74670
[5,] -46.20995 -23.76853
[6,] -46.22313 -23.79338
[7,] -46.20665 -23.79488
[8,] -46.20171 -23.80467
[9,] -46.20254 -23.82801
[10,] -46.21489 -23.84683
[11,] -46.19348 -23.84608
[12,] -46.17618 -23.87469
[13,] -46.11853 -23.84834
[14,] -46.12182 -23.86942
[15,] -46.14406 -23.90481
提前致谢
【问题讨论】:
-
没什么可做的,但
coordinates(shape)能给你想要的吗? -
@GavinSimpson 我想要来自 drawPoly() 函数的多边形的坐标,我可以通过使用 polygon@polygon 看到它的坐标,但不能从它的坐标(多边形)中得到它跨度>