vectors: lines to polygons

I have imported a vegetation map of Europe.
Nevertheless, it was digitized as LINES, not
as polygons. Therefore, I have now a vector
map in which the lines should be attached
to make polygons. I've checked abd is not just
that each polygon is made out of on single line,
so it's not just a question of replacing "L"
by "A" in the ascii vector format.

The question (and I suspect the answer...):

is there an automatic procedure to combine the
lines into polygons?, i.e., if we have:

AAAAAAA
B A
B C
D C
DDDDDDD

(where each letter is a line)

go to

2 polygons

Thanks (to both mailing list users and mailing list keepers)

Agus

Dr. Agustin Lobo
Instituto de Ciencias de la Tierra (CSIC)
Lluis Sole Sabaris s/n
08028 Barcelona SPAIN
tel 34 93409 5410
fax 34 93411 0012
alobo@ija.csic.es
http://pangea.ija.csic.es/alobo

Agustin Lobo wrote:

I have imported a vegetation map of Europe.
Nevertheless, it was digitized as LINES, not
as polygons. Therefore, I have now a vector
map in which the lines should be attached
to make polygons. I've checked abd is not just
that each polygon is made out of on single line,
so it's not just a question of replacing "L"
by "A" in the ascii vector format.

The question (and I suspect the answer...):

is there an automatic procedure to combine the
lines into polygons?, i.e., if we have:

Yes, because with Grass, a single line can be used for 2 areas,
one on each side.
Once you change the 'L' to 'A' in your ascii vector file,
run v.in.ascii to made a binary vector file and then run
v.support, which will compute the topology, hence creating
your areas ().

You will then need to give each area a label with v.digit,
unless you have a site file giving you a point location
(with the number you will use for polygon attribute) inside
each area to be labelled, in which case you can create a
dig_att file before running v.support.

--
Michel Wurtz ENGEES - CEREG
                1, quai Koch - BP 1039, F-67070 STRASBOURG cedex
                Tel: +33 03.88.24.82.45 Fax: +33 03.88.37.04.97

Sorry, it seems that I pasted a not final version
of my message to my mailing system.
I repeat and hope that it will be more
clear

I have imported a vegetation map of Europe.
It seems that it was digitized as LINES, not
as polygons, which is not very useful for a vegetation map.
Therefore, I have now a vector map in which the lines should be
appended to make polygons. I've checked the ascii
file and it is not just
that each polygon is made out of one single line
(i.e., that the last point is not equal to the
first one), so it's not just a question of
copying the first point at the end of the polygon an
replacing "L" by "A" in the ascii vector format.
It is more complicated as lines have to be combined
into polygons.

The question (and I suspect the answer...):

is there an automatic procedure to combine the
lines into polygons?, i.e., if we have:

AAAAAAADDDDD
B A E
B C E
D C F
DDDDDDDFFFFF

(where each letter is a line)

transform to 2 polygons

Thanks (to both mailing list users and mailing list keepers)

Agus

Dr. Agustin Lobo
Instituto de Ciencias de la Tierra (CSIC)
Lluis Sole Sabaris s/n
08028 Barcelona SPAIN
tel 34 93409 5410
fax 34 93411 0012
alobo@ija.csic.es
http://pangea.ija.csic.es/alobo

Agustin Lobo wrote:

I have imported a vegetation map of Europe.
It seems that it was digitized as LINES, not
as polygons, which is not very useful for a vegetation map.
Therefore, I have now a vector map in which the lines should be
appended to make polygons. I've checked the ascii
file and it is not just
that each polygon is made out of one single line
(i.e., that the last point is not equal to the
first one), so it's not just a question of
copying the first point at the end of the polygon an
replacing "L" by "A" in the ascii vector format.
It is more complicated as lines have to be combined
into polygons.

The question (and I suspect the answer...):

is there an automatic procedure to combine the
lines into polygons?, i.e., if we have:

AAAAAAADDDDD
B A E
B C E
D C F
DDDDDDDFFFFF

(where each letter is a line)

transform to 2 polygons

Thanks (to both mailing list users and mailing list keepers)

Agus

Hi

I'm doing similar work just now with digitised polygons imported as
lines

I think you will need to perform the following stages:

1. Convert the lines to area edges with v.line2area.sh . It runs
interactively at the console.

2. [Maybe] Just check in v.digit to make sure all the lines are
correctly snapped. Snapped nodes are a different color from unsnapped
(red usually)

3. Use v.trim to remove the excess nodes - ie so that each area edge is
just a single line. Run this with the threshold value set to 0. This
creates a new vector file.

  ( I think this is the critical stage you are looking for :slight_smile:

4. Run v.support on the new file -

and then the topology should be correct, and you can label the polygons
etc.

Hopes this helps

D Gray