[gdal-dev] Disabiling Geos messages via OGR

Frank Warmerdam warmerdam at pobox.com
Mon Aug 18 10:20:51 EDT 2008

On 8/15/08, Brent Fraser <bfraser at geoanalytic.com> wrote:
> I'm using OGR's Geos functions (e.g. OGRGeometry::IsValid) to process some
> polygons.  Geos spits out messages to console (stderr?) like "Warning 1:
> Self-intersection at or near point ...".  Is there a way to disable these
> messages via OGR?


OGR reroutes GEOS errors and warnings via the CPL error reporting
mechanism.  So, if you are working programatically you could
install a custom warning/error handler (see CPLPushErrorHandler()
for instance).

If you are just using the utilities there is no practical way to filter
out the GEOS messages other than by redirecting stderr to

Best regards,

I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

More information about the gdal-dev mailing list