android/spatialiteandroidlibrary/src/main/jni/geos-3.2.2/capi/geos_ts_c.cpp
const Geometry *
GEOSGetGeometryN_r(GEOSContextHandle_t extHandle, const Geometry *g1, int n)
{
    if ( 0 == extHandle )
    {
        return NULL;
    }

    GEOSContextHandleInternal_t *handle = 0;
    handle = reinterpret_cast<GEOSContextHandleInternal_t*>(extHandle);
    if ( 0 == handle->initialized )
    {
        return NULL;
    }

    try
    {
        using geos::geom::GeometryCollection;
        const GeometryCollection *gc = dynamic_cast<const GeometryCollection *>(g1);
        if ( ! gc )
        {
            handle->ERROR_MESSAGE("Argument is not a GeometryCollection");
            return NULL;
        }
        return gc->getGeometryN(n);
    }
    catch (const std::exception &e)
    {
        handle->ERROR_MESSAGE("%s", e.what());
    }
    catch (...)
    {
        handle->ERROR_MESSAGE("Unknown exception thrown");
    }
    
    return NULL;
}
/*
 * Call only on GEOMETRYCOLLECTION or MULTI*.
 * Return a pointer to the internal Geometry.
 */
Call only on GEOMETRYCOLLECTION or MULTI*.
Return a pointer to the internal Geometry.
Call only on GEOMETRYCOLLECTION or MULTI * . Return a pointer to the internal Geometry .
const Geometry *
GEOSGetGeometryN_r(GEOSContextHandle_t extHandle, const Geometry *g1, int n)
{
    if ( 0 == extHandle )
    {
        return NULL;
    }
    GEOSContextHandleInternal_t *handle = 0;
    handle = reinterpret_cast<GEOSContextHandleInternal_t*>(extHandle);
    if ( 0 == handle->initialized )
    {
        return NULL;
    }
    try
    {
        using geos::geom::GeometryCollection;
        const GeometryCollection *gc = dynamic_cast<const GeometryCollection *>(g1);
        if ( ! gc )
        {
            handle->ERROR_MESSAGE("Argument is not a GeometryCollection");
            return NULL;
        }
        return gc->getGeometryN(n);
    }
    catch (const std::exception &e)
    {
        handle->ERROR_MESSAGE("%s", e.what());
    }
    catch (...)
    {
        handle->ERROR_MESSAGE("Unknown exception thrown");
    }
    return NULL;
}
const Geometry * GEOSGetGeometryN_r ( GEOSContextHandle_t extHandle , const Geometry * g1 , int n ) { if ( 0 == extHandle ) { return NULL ; } GEOSContextHandleInternal_t * handle = 0 ; handle = reinterpret_cast < GEOSContextHandleInternal_t * > ( extHandle ) ; if ( 0 == handle -> initialized ) { return NULL ; } try { using geos :: geom :: GeometryCollection ; const GeometryCollection * gc = dynamic_cast < const GeometryCollection * > ( g1 ) ; if ( ! gc ) { handle -> ERROR_MESSAGE ( " " ) ; return NULL ; } return gc -> getGeometryN ( n ) ; } catch ( const std :: exception & e ) { handle -> ERROR_MESSAGE ( " " , e . what ( ) ) ; } catch ( ... ) { handle -> ERROR_MESSAGE ( " " ) ; } return NULL ; }
Call only on GEOMETRYCOLLECTION or MULTI*.
Call only on GEOMETRYCOLLECTION or MULTI * .