[GRASS5] Re: [GRASSLIST:720] Re: tiger2k questions (listproc is driving me nuts!)

Radim Blazek blazek at itc.it
Wed Jul 16 02:58:41 EDT 2003


[I switched to devel list]

On Tuesday 15 July 2003 15:15, Frank Warmerdam wrote:
> I would agree that it is desirable for OGR to offer access to topological
> vector datasets in some means where v.in.ogr could take care of the eight
> steps you delimited automatically.  To do this, as I see it, I would need
> to modify OGR to keep track of the relationship between polygon records,
> and their corresponding arcs in a standard means.  In other systems I have
> kept metadata on polygon layers indicating the corresponding arc layer, and
> marking which arc attributes were the right/left polygon indicator.    This
> would in theory be enough information for v.in.ogr to build a topological
> dataset on import, right?
>
> I notice you utilized the PIP (point-in-polygon) layer.  Is this important?

What GRASS needs is feature type in topological sense. It means to ditinguish
lines from boundaries and centroids from points.

My suggestion for OGR is to define topological feature types: 
    point, line, boundary, centroid, polygon
(polygon is not topological, but it is present in nontopological sources)
and probably also multi* equivalents. All with some prefix of course.

Then to add new function:
    OGR_G_GetGeometryTopologicalType ( OGRGeometryH  hGeom );
For SF (nontopological formats) this functions would simply map
    wkbPoint -> point
    wkbLineString -> line
    wkbPolygon -> polygon
and for topological formats it would return appropriate topological type.
For Tiger this means:
CompleteChain : line if polyidl == polyidr, boundary if polyidl != polyidr
                  (polyidl and polyidr from PolyChainLink)
Landmarks     : point
PIP           : centroid

I don't know much about Tiger and somebody more familiar with Tiger 
should comment this.

I'll modify v.in.ogr so that it will be possible to read all or specified
layers from one data source to one output vector. Once OGR gives me 
topological type, geometry and topology for Tiger in GRASS is OK.

What I am not sure about are attributes, because PIP which becomes
centroid and is the link to attributes for area (polygon) in GRASS,
contains (more or less) only POLYID and all informations about
polygon are in Polygon layer (table). It means that if user imports
Tiger to GRASS by v.in.ogr, he cannot immediately use all attributes
available for Polygons. To get all attributes he must create view
in database from PIP and Polygon tables and relinked centroids
to this table. But ther are many relations among Tiger layers and 
cannot be probably all covered by OGR and v.in.ogr.
One possibility would be to join attributes from Polygon to PIP
in OGR so that PIP layer would contain all (or most of) polygon
attributes, but this would lead to duplication of informations.
Similar situation is for Landmarks, which may be also linked to
other layers including Polygon.
Any suggestions?

Radim




More information about the grass-dev mailing list