i'm getting a polygon from the drawpoly using:
x<- ogrListLayers(file_map)
shape=readOGR(file_map, layer=x) #will load the shapefile to your dataset.
plot(shape)
polygon<- drawPoly()
but, I'm trying to get the coordinates from polygon, but i can't:
poligon@polygons [[1]] An object of class "Polygons" Slot "Polygons": [[1]] An object of class "Polygon" Slot "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
thanks in advance
well, i found out that the function
clickpoly
and used:and used:
to get the x,y points in the polygon