def explain_validity(shp): from shapely.wkt import loads from shapely.geos import lgeos """ Explains the validity reason of each feature in a shapefile """ ds = openToRead(shp) layer = ds.GetLayer() nbfeat = getNbFeat(shp) for feat in layer: geom = feat.GetGeometryRef() ob = loads(geom.ExportToWkt()) print lgeos.GEOSisValidReason(ob._geom) a = raw_input() return 0
def explain_validity(ob): """ Explain the validity of the input geometry, if it is invalid. This will describe why the geometry is invalid, and might include a location if there is a self-intersection or a ring self-intersection. Parameters ---------- ob: Geometry A shapely geometry object Returns ------- str A string describing the reason the geometry is invalid. """ return lgeos.GEOSisValidReason(ob._geom)
def explain_validity(ob): return lgeos.GEOSisValidReason(ob._geom)
def __call__(self, this): return lgeos.GEOSisValidReason(this._geom)