[GRASS-user] two questions: snap and close lines

Markus Metz markus.metz.giswork at googlemail.com
Thu Jan 26 14:41:55 EST 2012


On Mon, Jan 23, 2012 at 8:00 PM, Paolo Cavallini <cavallini at faunalia.it> wrote:
> Hi all.
> A couple of issues I ran into today:
> - I have a layer with some good and some bad polygons; how do I import it into GRASS
> letting the bad ones snapping onto the good ones, and not vice versa?

You could try v.edit, otherwise it will be hand-editing with a digitizer.

With topological vectors, snapping one set of polygons to another set
of polygons does not make sense, because there are no polygons in
topological vectors, only shared boundaries. That is probably the
reason why this functionality is not available in grass.

> - I want to change the contour lines into closed polygons (namely, for contour lines;
> I tried v.type.lb, to add centroid afterwards, but it does not seem to produce valid
> polygons.
> Any hint?

For contour lines, you would need to patch the vector with contour
lines with a vector created with v.in.region type=line, then break
lines at intersections, convert lines to boundaries, add centroids.
This assumes that not closed contour lines have endpoints exactly at
the extents of the vector, e.g. if the western edge of the contour
vector is 30 and there is an open contour line ending at say
29.99999999, this will not work. If the contour lines were produced
with r.contour, this should work.

HTH,

Markus M


More information about the grass-user mailing list