lines and areas

Hi Grass,

is there a way to convert lines to areas ? I create lots of contour-lines with r.contour and I would like to make statistics (r.report type=area) on the areas surrounded by the contour-lines. This doesn’t work though, because r.contour only creates lines, not areas.

Also I would like to create a map where the areas are filled with a color according to their attribute (with v.to.rast). This also only seems to work with areas.

TIA, Stefan

Stefan,
In v.digit, you can re-type lines to area edges. You can also do this in
bulk by converting to ASCII, using an editor to change all leading "L"s
to "A"s, and re-importing with v.in.ascii. Either way, you'll have to
manually attribute all of the areas in v.digit. Also, I'm really not
sure how robust the GRASS topological model is, especially concerning
multiple levels of nested areas ("islands").

Best regards,
  -Malcolm Williamson
   CAST - University of Arkansas

Stefan.Neumann@agrar.uni-giessen.de wrote:

Hi Grass,

is there a way to convert lines to areas ? I create lots of
contour-lines with r.contour and I would like to make statistics
(r.report type=area) on the areas surrounded by the contour-lines.
This doesn't work though, because r.contour only creates lines, not
areas.

Also I would like to create a map where the areas are filled with a
color according to their attribute (with v.to.rast). This also only
seems to work with areas.

TIA, Stefan

Malcolm Williamson wrote:

Stefan,
In v.digit, you can re-type lines to area edges. You can also do this in
bulk by converting to ASCII, using an editor to change all leading "L"s
to "A"s, and re-importing with v.in.ascii. Either way, you'll have to
manually attribute all of the areas in v.digit. Also, I'm really not
sure how robust the GRASS topological model is, especially concerning
multiple levels of nested areas ("islands").

Hi,

Actually there is not really an issue with multiple nesting, because
really there is no nesting. Here as in other formats, such as shapefile,
each area entity consists of a single ring giving the outer perimeter
and a series of indices linking to `primary islands'. I have built slope
maps which are polygons with often deeply nested levels that have built
correctly wihtout problem. For some time there were many modules that
didn't handle areas correctly, but more recently (hopefully) these have
been updated.

David

Best regards,
        -Malcolm Williamson
         CAST - University of Arkansas

> Stefan.Neumann@agrar.uni-giessen.de wrote:
>
> Hi Grass,
>
> is there a way to convert lines to areas ? I create lots of
> contour-lines with r.contour and I would like to make statistics
> (r.report type=area) on the areas surrounded by the contour-lines.
> This doesn't work though, because r.contour only creates lines, not
> areas.
>
> Also I would like to create a map where the areas are filled with a
> color according to their attribute (with v.to.rast). This also only
> seems to work with areas.
>
> TIA, Stefan

Stefan.Neumann@agrar.uni-giessen.de wrote:

Hi Grass,

is there a way to convert lines to areas ? I create lots of
contour-lines with r.contour and I would like to make statistics
(r.report type=area) on the areas surrounded by the contour-lines.
This doesn't work though, because r.contour only creates lines, not
areas.

Hi Stefan,

First make sure that the regions you want to assign to areas are closed.
You may have to clip the map with a grid. If you need that you can use
v.mkgrid, or create a suitable boundary with v.digit. Then v.cutter can
be used to create the clipped map.

There's a script called v.line2area which will alter the dig_att file to
have areas instead of lines, but area attributes are different from line
attributes and there is no immediately obvious way of assigning the area
range from the bounding contour values, apart from manually.

If you're starting from a raster map (I assume so since you used
r.contour), a better way might be to reclass the raster to the range you
want to use, with r.reclass, and then index the elevation levels and
labels if required. You might also want to apply a gentle consolidation
process with eg. r.neighbors set to method=mode. This may elliminate
small single cell anomalies and `rosaries', but might distort the data
too much. It's a question of resolution. A correctly labelled area
vector map will then be created with r.poly. This produces ragged edged
maps, but should produce accurate areas, and the area edges should be in
the same place as contour lines if you use the same elevation
categories.

Also I would like to create a map where the areas are filled with a
color according to their attribute (with v.to.rast). This also only
seems to work with areas.

True, but in a line or linear features map, the areas do not correspond
to any clearly defined spatial entity, therefore they cannot be
labelled, rendered or otherwise processed.

Regards, David