criar e exportar polígono

9 views
Skip to first unread message

Ricardo Dobrovolski

unread,
Nov 10, 2015, 3:27:40 PM11/10/15
to r-eco...@googlegroups.com, Ludmila Rattis
Oi pessoal,

Eu gostaria de criar um polígono e exportar no formato shape.

Alguém sabe como fazer? 

library(sp)
library(rgdal)
library(maptools)
m=c(6,-43,-16,-43,-16,-74,6,-74,6,-43)
m=matrix(m,5,2,byrow=T)
m
ID="BR1"
pol1=list(Polygon(m))
pol1=list(Polygons(pol1,ID))
spol1=SpatialPolygons(pol1)
plot(spol1)
writePolyShape(spol1,"br_pol_01")

Abraço,

RD.

R-Ecology

unread,
Nov 13, 2015, 7:37:32 AM11/13/15
to R-Ecology
tenta a função writeOGR
Reply all
Reply to author
Forward
0 new messages