[gdal-dev] validate/clean geometry with OGR?

Brent Fraser bfraser at geoanalytic.com
Wed Apr 27 11:03:03 EDT 2011


Elijah,

   I've used GEOS Buffer function available via the OGR API 
(http://www.gdal.org/ogr/classOGRGeometry.html) to clean polygons:

OGRGeometry *poTempGeometry = poGeometry->Buffer(0.0);  // Let Geos fix 
the problem.


Best Regards,
Brent Fraser


On 4/27/2011 8:36 AM, Elijah Robison wrote:
> Hey devs, is anyone aware of an OGR approach to validate/clean 
> geometries, for instance, as they are being converted from SHP to 
> PostGRESql?
> It's not uncommon to have a handful of invalid geometries (usually 
> self-intersecting polygons) in a parcel dataset, and it's impractical 
> to correct them manually.  In most situations I use the "Clean 
> Geometries" function in ArcGIS, which does fix the problem.  However 
> this one functionality is my main reason to retain Arc in my primary 
> tool chain.
>
> I've never found a scripting approach by trolling the search engines 
> so I thought I'd ask here.
>
> Thanks, Elijah
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>



More information about the gdal-dev mailing list