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

Peter Freimuth pfreimuth at arcor.de
Mon Jun 14 05:57:15 EDT 2010


Paul Meems schrieb:
> 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
>>
>>     
>
>   
Thanks Paul for your hint,
i will check if i can access the function from python using the geos
wrapper shapely with the latest geos version. Hopefully this method will
be integrated also in the ogr geometry class.
Kind regards,
Peter

-- 
Peter Freimuth  Muskauer Str. 11   10997 Berlin
Location:
http://www.berlinonline.de/citymap/map.asp?start.x=5&plz=10997&str=Muskauer+Str.+11&grid=dedatlas10
or
http://wikimapia.org/#lat=52.5015709&lon=13.431505&z=18&l=5&m=b
========================================================================================================
Tel/Phone:+49(0)30-69816610  Mobil/mobile:+49(0)175-8434074  Firma/Company:+49(0)3381-8904327
========================================================================================================
mailto:pfreimuth at arcor.de  
skype:pfreimuth



More information about the gdal-dev mailing list