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

Peter Freimuth pfreimuth at arcor.de
Thu Jun 10 06:35:46 EDT 2010


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  



More information about the gdal-dev mailing list