[GRASS5] GRASS -> SF

John Gillette JGillette at rfmd.com
Wed Feb 18 14:39:07 EST 2004


> I think I still don't get how the boundaries work.  In a well 
> formed polygon
> layer, is the one closed boundary per polygon feature?  If 
> there are centroids
> how are they associated with their polygon?
> 
I must be that second person interested in topology that Radim was talking about.
I am fascinated with how Grass does this and how it differs from say Arcinfo.

I will quickly tell you what I know about topology in Grass 5.0 and 
then I hope Radim will tell us what I got wrong or has changed in 5.7.

A vector layer in 5.0/5.3 contains lines that are of type dot, line or area edge.
Area edges obviously are used to make up closed areas. So this allows you
to separate the lines types.  You specify the type on input to Grass,
Grass doesn't decide.  Areas are identified by a point file which pairs
an x,y point location with a category number (dig_att file). This identifies
the area.  This is why (with respect to that conversation you had
a while back concerning importing tiger areas) Radim had to use the PIP
(point in polygon) layer.  I think you have to do that to identify the 
area.  (Radium was explaining that you COULD import tiger areas in 
5.7, but it took about 6 or 8 steps with one of those steps the import
of the PIP information.)

It is interesting to me that this is different from the Arcinfo approach
where I think every thing is considered a line and an edge list is created
with area left, area right information stored.  The tiger files are 
created this way.  Every thing is a area edge and an isolated line
is identified by a test for (area left ?= area right).  If true,
then the line is dead end line.  This approach is discussed in computational
geometry books as the doubly connected edge list (DCEL).  The CGAL
computational geometry library has routines for this, for example.

Actually, Grass does store the area information internally, so perhaps the
only difference between Arcinfo and Grass is that Grass allows for the line
definition which allows for the 2 type to co-exist in the same file. 
The other difference is, of course, the use of the point in the area
to identify it.  

I am reminded of the famous Texas problem.  A Grass user couldn't get a
Census map of the US to topology check. Texas wouldn't check because of a
line connected to the edge extending into the interior.  Evidently the 
problem was there for some time but Arcinfo users didn't have a problem
with it.  Grass won't allow it (an area edge connected at one end only,
that is).

Another interesting problem I have had is with SDTS DLG files.  They 
come with a bounding box.  It turns out to be part of the topology.
If you remove the bounding box (to merge adjacent files for example)
grass complains about area edges that are now open. 
(Again, this is 5.0 information. 5.7 has utilities to fix this, I believe.)
I believe that I read in the SDTS documentation that the information
is stored with topology.  (Note: I don't know how grass decides here
which lines are area edges and which are lines.  Perhaps this is specified
in the spec and defined in the file.)

One thing I am very curios about is the comment recently in a Radim email
which had the following:
/* number of elements for each type (point, line, boundary, 
             centroid, area, face, kernel) */
I am very curious about the use of the different "types".

I don't know if I am helping or just asking more questions, but I
remain

"Interested in Topology"
John

 




More information about the grass-dev mailing list