Trying to convert lines to polygons

Michel Wurtz wrote:

The areas you create are not labelled (means that v.to.rast will give
you an empty file). Snapping doesn't help. Labelling is done via the
dig_att file : an entry for each area or line to be labelled made as
following for an area :

A xxxxxx yyyyyy nn

A means area (L for line), xxxxx and yyyyyy are the coordinates of the
label point (inside the area), and nn is the area number (> 0).

Try to use v.digit after running v.support. There is some command
to show unlabelled areas. You can label each area interactively.
If some areas cannot be labelled, look at the nodes around them (and
zoom)
If there is some green dots, that's mean that a line doesn't match
any other. You can snap manualy lines together, solving the unclosed
polygon problem. After that rerun v.support to label area, and

v.to.rast

will work.

If you have some labels in dxf, you can import them in the dig_att file
with respect to the format showed above (v.digit is sometimes boring

:slight_smile:
Well, a dxf file is just what I have. As you know,
I'm trying to convert this file containing unlabeled
lines to areas in a shapefile format (this is the
format needed by the final software, but it is not
able to generate polygon topology).

By using v.in.dxf I have imported the vector map
to GRASS (**¡the dig_att file hasn't been created!**).
After that (as I've said in the other
mails) I have converted through v.line2area.sh the
most part of the lines (99 %), but some of them
remain "opened" (**I get a warning from it because
.../dig_cats/DXF.0 does not exist??!!**).

By filtering the imported map with v.trim and
v.prune (I run v.support with the build option
after these two commads in order to rebuild the
topology) I get more areas (99.9%), but it still
remain a few lines "opened" (I can see them in
the Toolbox of v.digit, option "o").

*I don't understand what's the difference between
the lines that are converted and the lines that are
not, because they all are not labeled, and I don't
know which parameters pass to v.trim and v.prune in
order to get the topology.

*If I had all the lines labeled, could I get the
polygon topology?. If so, how can I label the lines
automatically?. What do I do after that?.

*I have one point inside of each area that exists in the
map too (not in dxf but in shape). Could I use it to
convert the lines?.

*I have generated some areas that were not detected with
v.digit (labelling areas), but when I rerun v.support after
using v.digit, they turn another time into lines. :frowning:

*Another thing: I have cleaned my DXF with AutoCAD MAP 2.0;
if I import the new DXF and run v.support, I get ALL the
areas. Is there any way to clean the map as AutoCAD MAP does?
(it would be the solution).

Thank you very much for your time and patience. Sincerely,
Juan Bañuls.

Get Your Private, Free Email at http://www.hotmail.com

Juan Bañuls wrote:

*If I had all the lines labeled, could I get the
polygon topology?. If so, how can I label the lines
automatically?. What do I do after that?.

Labelling lines don't help for areas. Polygon topology
is only based on line's geometry (all lines must be
connected).

*I have one point inside of each area that exists in the
map too (not in dxf but in shape). Could I use it to
convert the lines?.

This is good for creating dig_att file. If you have one point
in each area, v.support will label them.

*I have generated some areas that were not detected with
v.digit (labelling areas), but when I rerun v.support after
using v.digit, they turn another time into lines. :frowning:

Lines are labelled either a either l. If you have :

  +---------------------------+
  |\ |
  | \ line X |
  | + |
  | |
  +---------------------------+

If line X is 'l' (line), it's OK, you may label the polygon
(here rectangular). If line X is of type 'a' (area), v.digit
refuse to label it and v.support won't create a polygon.

When you clean the map with Grass, you have sometimes some
*very* small lines created by intersection of existing ones.

When a polygon can't be labelled, just zoom at each nodes.
You will probably notice one of these microscopic lines.
Delete them and labelling will work.

Another time where labelling seemed unpossible was with a
very large area. I digitized a line to cut it in two parts
and was able to label each part (with the same value, of
course).

*Another thing: I have cleaned my DXF with AutoCAD MAP 2.0;
if I import the new DXF and run v.support, I get ALL the
areas. Is there any way to clean the map as AutoCAD MAP does?
(it would be the solution).

Grass is not particulary efficient in cleaning (and the best
value to use for v.support is sometimes not easy to find).

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