[gdal-dev] getting reason info when is_valid() returns false

Paul Meems bontepaarden at gmail.com
Thu Jun 10 06:54:11 EDT 2010


We're using GDAL and GEOS in MapWindow GIS and we use the GEOS version of
IsValid(). I think it is the same GDAL is using.
The latest version of GEOS has a IsValidReason, telling you what was wrong.

I hope it helps,

Thanks,

Paul

--
Paul Meems
Release manager, configuration manager
and forum moderator of MapWindow GIS.
www.mapwindow.org

Owner of MapWindow.nl - Support for
Dutch speaking users.
www.mapwindow.nl
[image: Linkedin] <http://nl.linkedin.com/in/paulmeems>[image:
Twitter]<http://twitter.com/mapwindow_nl>



2010/6/10 Peter Freimuth <pfreimuth at arcor.de>

> Hi List,
> i am working with python ogr api and i check features which the
> applications gets from esri shapefiles to match several criterias.
>        if not xOgrGeometry.IsValid():
>            sMsg = "IsValid check failed! We have an invalid feature
> geometry!"
>            wkt=xOgrGeometry.ExportToWkt()
>            xLogger.error(sMsg + "Geometry is: [%s]" % wkt)
>            return [0, sMsg]
> It would be great if there is a possibility to get the reason for why
> is_valid() failed. I checked also shapely but i could'nt find something
> that tells me the reason like selfintersecting or other.
>
> Any hint on how to extract the reason string is welcome.
>
> Kind regards,
> Peter
>
> --
> Peter Freimuth
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20100610/e59f640f/attachment.html


More information about the gdal-dev mailing list