示例#1
0
static int
checkSingleSidedBufferSuccess(geom::Geometry& gRes,
        geom::Geometry& gRealRes, double dist)
{
    int success = 1;
    do
    {

        if ( gRes.getGeometryTypeId() != gRealRes.getGeometryTypeId() )
        {
            std::cerr << "Expected result is of type "
                << gRes.getGeometryType()
                << "; obtained result is of type "
                << gRealRes.getGeometryType()
                << std::endl;
            success=0;
            break;
        }

        geos::xmltester::SingleSidedBufferResultMatcher matcher;
        if ( ! matcher.isBufferResultMatch(gRealRes,
                           gRes,
                           dist) )
        {
std::cerr << "SingleSidedBufferResultMatcher FAILED" << std::endl;
            success=0;
            break;
        }

    }
    while (0);

    return success;
}
示例#2
0
/* Could be an XMLTester class private but oh well.. */
static int
checkBufferSuccess(geom::Geometry const& gRes, geom::Geometry const& gRealRes, double dist)
{
    int success = 1;
    do
    {

        if ( gRes.getGeometryTypeId() != gRealRes.getGeometryTypeId() )
        {
            std::cerr << "Expected result is of type "
                << gRes.getGeometryType()
                << "; obtained result is of type "
                << gRealRes.getGeometryType()
                << std::endl;
            success=0;
            break;
        }

        // Is a buffer always an area ?
        if ( gRes.getDimension() != 2 )
        {
            std::cerr << "Don't know how to validate "
                << "result of buffer operation "
                << "when expected result is not an "
                << "areal type."
                << std::endl;
        }
        

        geos::xmltester::BufferResultMatcher matcher;
        if ( ! matcher.isBufferResultMatch(gRealRes,
                           gRes,
                           dist) )
        {
std::cerr << "BufferResultMatcher FAILED" << std::endl;
            success=0;
            break;
        }

    }
    while (0);

    return success;
}