Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#9556 closed Bugs (invalid)

within fails on simple case

Reported by: Robert Ramey Owned by: Barend Gehrels
Milestone: To Be Determined Component: geometry
Version: Boost 1.55.0 Severity: Problem
Keywords: Cc:

Description

the attached case illustrates to me that with fails on a simple case.

// simple test of boost geometry function within
bool test1(){
    typedef boost::geometry::model::d2::point_xy<float> point;
    typedef boost::geometry::model::ring<point, false, false> ring;

    ring r;
    r.push_back(point(-2054781.4f, 1327536.6f));
    r.push_back(point(-2042300.1f, 1275254.1f));
    r.push_back(point(-2142418.5f, 1333733.5f));
    r.push_back(point(-2122850.5f, 1553784.4f));
    //r.push_back(point(-2054781.4f, 1327536.6f));
        
    point pt(-2238243.8f, 1523654.5f);
    bool result = boost::geometry::within(pt, r);
    // result should be false - but returns true
    if(result != false)
        return false;
    
    point pt2(-210000.8f, 1350000.5f);
    result = boost::geometry::within(pt2, r);
    // result should be true - but returns false
    if(result != true)
        return false;
    
    // if we made here - fine
    return true;
}


Change History (2)

comment:1 by Robert Ramey, 9 years ago

Resolution: invalid
Status: newclosed

OK - looks ike I'm at fault here.

point pt2(-210000.8f, 1350000.5f);

should be

point pt2(-2100000.8f, 1350000.5f);

With this change - test passes

Last edited 9 years ago by Robert Ramey (previous) (diff)

comment:2 by Barend Gehrels, 9 years ago

OK - thanks for finding it out and closing.

Note: See TracTickets for help on using tickets.