[Gdal-dev] OGR: TIGER/Line polygons

Frank Warmerdam warmerdam at pobox.com
Thu Oct 28 00:51:17 EDT 2004


Curt Mills wrote:
> Thanks!  I've implemented that now, plus added a nice generic set of
> hash table functions to use while recombining the Tiger data sets
> into polygons that I can draw.
> 
> As always, once I get into the code, more questions arise.
> 
> When I implemented direct Shapelib support before, I implemented
> support for filled polygons w/holes.  I rewrote portions of that
> slightly for the OGR part of our code.
> 
> With the Tiger polygons it appears that the filled polygons and the
> hole polygons are not necessarily connected in the files.  Might I
> need sort the polygons somehow before drawing, then try to merge the
> filled polygon geometries with the hole polygon geometries before
> attempting to draw them?
> 
> What appears to be happening right now is that I sometimes pass
> filled polygons to the draw routine, sometimes filled w/holes, and
> sometimes hole polygons.  It's that last type that doesn't end up
> getting drawn.  I assume that they should be somehow merged with one
> of the other two types before any drawing occurs.

Curt,

I'm afraid you lost me here.   The OGR Shapefile driver should sometimes
return polygon geometries which would be an outer ring and zero or more
inner rings (holes).  It can also return Multipolygons, which is a list
of polygons.  So one feature with a multipolygon geometry is essentially a
set of islands.

I don't know how you would get into a situation where you have just "holes"
unless you are taking about the polygons that belong inside the holes of
other polygons which aren't strictly holes in the sense I think of them.

Perhaps you could provide a shapefile that demonstrates the issue?

Best regards,

-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent




More information about the Gdal-dev mailing list