[fdo-users] SHP polygons & holes issue

Robert Fortin robert.fortin at autodesk.com
Mon Mar 26 13:32:41 EDT 2007


Dan is correct: SHP provider is not altering the geometry that it reads from the SHP file. Dan mentioned the performance issue (i.e. fixing polygon takes time) but the most importing issue is the capacity to round trip data through the provider.  If the provider was altering the geometry when reading it, it would mean that you would not get the same data back in the shp file after updating it, even if the geometry was not changed.  You don't want that.

RF   

-----Original Message-----
From: fdo-users-bounces at lists.osgeo.org [mailto:fdo-users-bounces at lists.osgeo.org] On Behalf Of Dan Stoica
Sent: Monday, March 26, 2007 12:46 PM
To: Ytse; fdo-users at lists.osgeo.org
Subject: RE: [fdo-users] SHP polygons & holes issue

The problem is the tool that created the SHP...

Apparently there are lots of SHP files around in this state. To make things worse, there is no native multi-polygon type which could help FDO to distinguish between a polygon with holes and a set of not related polygons.

It has been decided that FDO should not attempt to correct the polygons (i.e. to change the rings order etc). One of the reasons was the performance (it is a quite expesive operation).

The actual type and the rings order only matters when it comes to spatial queries. There was a bug around it which has been recenly fixed (see ticket #43).

In case your application really needs a well formed polygon, note there is a function that reconstructs a geometry given a collection of rings:

newGeometry = FdoSpatialUtility::CreateGeometryFromRings (rings, true);

This method will return either a Polygon or a MultiPolygon.

Or have a look at ShpFeatIdQueryEvaluator::ReconstructPolygon( FdoIGeometry *geometry ) to how it has been done.

Dan.

-----Original Message-----
From: fdo-users-bounces at lists.osgeo.org [mailto:fdo-users-bounces at lists.osgeo.org] On Behalf Of Ytse
Sent: Monday, March 26, 2007 12:23 PM
To: fdo-users at lists.osgeo.org
Subject: [fdo-users] SHP polygons & holes issue

You'll find a zip file attached to this mail containing one feature, a polygon with a hole in it.

When I read in .NET using this code (after a ISelect statement)

            FgfGeometryFactory gf = new FgfGeometryFactory();
            IGeometry geo = gf.CreateGeometryFromFgf( reader.GetGeometry("Geometry")  );

I'm getting something that confuses me : the exterioring has 8 points, and there's one interiorring of 320 points. Which corresponds to an inversion of the inner and exterior ring.

I'd be glad if anyone of this board could doublecheck this and tell me if that's something from the tool that created the shape, something from my code or if it's somehow a mystake in the SHP Provider (I could check the rings area to notice those cases but that would be something heavy for the rare times it will occur) as I don't have the slightiest idea of how it should be stored in the physical .shp file.

Thank you
Pierre


	

	
		
___________________________________________________________________________
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! 
Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses http://fr.answers.yahoo.com

_______________________________________________
fdo-users mailing list
fdo-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/fdo-users



More information about the fdo-users mailing list