Boost logo

Boost Users :

Subject: [Boost-users] How to use geometry::within with a polygon that encompasses a pole
From: Cameron Sabol (cameronsabol_at_[hidden])
Date: 2013-01-07 17:20:23


Hi,

I'm have an issue with polygons from the geometry library using the
spherical_equatorial coordinates when the polygon is meant to wrap a pole.

e.g.

namespace bg = boost::geometry;
typedef bg::model::point
    <
        double, 2, bg::cs::spherical_equatorial<bg::degree>
> LonLatPoint;

bg::model::polygon < LonLatPoint> northPoleBoundary;

double lon = -180;
while (lon <= 180)
{
    bg::append(northPoleBoundary, LonLatPoint(lon, 88));
    lon += 5;
}

LonLatPoint northPole(90, 0);

bool isInNorthPole = bg::within(northPole, northPoleBoundary);

This code is giving me isInNorthPole == false. Am I constructing my polygon
incorrectly? Is this a bug? Or is this behavior simply not implemented?
Thanks for your help!



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net