[GRASSLIST:5057] Re: vector lines to area?

Hamish hamish_nospam at yahoo.com
Sun Dec 5 17:45:11 EST 2004


> > I have a porblem concerning the transformation of lines into area. I
> > have .e00 files which I have converted with avcimport. These vector 
> > files are only lines even if some of them should define an area
> > (there is no PAT in the e00 file, only AAT). I've tried importing
> > the vector lines as area boundaries but it dont work quite well,
> > some area are not showing up and some other that shouldn't be areas
> > but holes are created. Is there an easy way to transform those lines
> > which are defining an area into a real area so I could build a
> > raster map with these area showing up? I've tried v.digit and
> > selecting an centroid. However, for some area with holes the holes
> > are still defined as areas (if I import the lines as area
> > boundaries) or the lines are not defined as boundaries so I've got a
> > centroid outside an area (is there a way to change the line into a
> > boundary other than v.type, using v.type transform the lines as
> > boundaries for 2 areas, which is not my case).
> >
> > I'm using Grass 5.7.0
>
> It sounds like you are trying to build "donut" areas, with an internal
> 
> isle clipped out. The only way I have found so far to do this is to 
> parse the output from v.build option=dump to identify the island 
> polygons, update the attribute table with this information, and then 
> run v.extract to select only the non-isle polygons. It would be nice
> if v.category had a option to not label holes in a larger polygon.


'v.extract -d' will get rid of internal islands. Also after
'v.category option=add' you might try 'v.extract list=1-1000000' 
which can be useful to get rid of unused polygons.

'man v.category':
"EXAMPLES
...
4) Add categories/centroids to a vector map without categories
       v.category in=wkt out=wktnew option=add
..."


maybe then use that result with v.overlay or v.select to add back in
holes you do want?


Tricky bit is when you have polygons within a hole, e.g. a polygon vector
of land which has a lake with an island in it.


Hamish




More information about the grass-user mailing list