[geos-devel] GEOS Exceptions

Norman Vine nhv at cape.com
Mon Apr 18 11:36:27 EDT 2005


Frank Warmerdam writes:
> 
> I have the following code to parse a WKT string into a
> geos geometry. 
> 
>     try 
>     { 
>         geos::Geometry *geosGeometry = NULL;
>         geosGeometry = geosWktReader.read( oWKT );
>         return geosGeometry;
>     }
>     catch( geos::GEOSException &e )
>     {
>         CPLError( CE_Failure, CPLE_AppDefined,
>                   "GEOSException: %s", 
>                   e.toString().c_str() );
> 
>         return NULL;
>     }

Maybe

     catch( geos::GEOSException *e )
     {
         CPLError( CE_Failure, CPLE_AppDefined,
                  "GEOSException: %s", 
                  (char *)ge->toString().c_str() );

        return NULL;
    }
 
HTH

Norman



More information about the geos-devel mailing list