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 <[email protected]>

> 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
> [email protected]
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
_______________________________________________
gdal-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to