[GRASSLIST:9840] Re: v.extract area with holes but without islands

Roger Bivand Roger.Bivand at nhh.no
Sun Jan 15 08:39:28 EST 2006


On Sun, 15 Jan 2006, Wolf Bergenheim wrote:

> Hi,
> 
> Roger if you export the shape to a shapefile with v.out.ogr then if you
> use the -c flag it will only export features with categories (i.e.
> centroids, not the islands).

Thanks - from:

r.to.vect input=tibriv1 output=tibriv2 feature=area
v.info tibriv2
# only one centroid
v.out.ogr -ce input=tibriv2 type=area dsn=. olayer=tibriv2cc
R
> library(maptools)
> sp1 <- readShapePoly("tibriv2cc.shp")
> length(slot(sp1, "polygons"))
[1] 1

which is exactly what is needed!

Roger

> 
> --Wolf
> 
> On 14/01/06 14:37, Roger Bivand wrote:
> > On Sat, 14 Jan 2006, ivan marchesini wrote:
> > 
> > 
> > But not if the vector is written out (for example as a shapefile of
> > type=area) and read into other software, in my case into R. But with 
> > subsetting in R, it's easy to fix there, I just need to remember to find 
> > the shape with the holes.
> > 
> 
> 
> 
> 

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no




More information about the grass-user mailing list