Subject: Re: [Boost-bugs] [Boost C++ Libraries] #12314: boost::geometry::within for a point in a geographic coordinate system fails
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-01-03 13:51:34
#12314: boost::geometry::within for a point in a geographic coordinate system fails
-------------------------+-------------------------------------------------
Reporter: | Owner: barendgehrels
oleary.simon@⦠| Status: new
Type: Bugs | Component: geometry
Milestone: To Be | Severity: Showstopper
Determined | Keywords: geometry within geographic
Version: Boost | coordinate system cs
1.61.0 |
Resolution: |
-------------------------+-------------------------------------------------
Comment (by awulkiew):
In non-cartesian CSes the edges of Polygons are shortest lines between
points so e.g. the edge: `(0 89, 180 89)` intersects the north pole. In
the case of the edge `(180 0, 0 0)` I'm not sure what the algorithm
assumes but this edge is invalid. The reason for that is that there is
infinite number possible edges connecting these points in spherical and 2
possible edges in geographic (going through north or south pole). Either
way I presume this is not what you had in mind.
You could fix the invalidity by adding additional point between the
invalid edge, so: `POLYGON((0 89, 180 89, 180 0, 90 0, 0 0, 0 89 ))` but
this is not what you wanted to do either.
AFAIU what you wanted to do is to create a "rectangular" region (in
spherical/geographic having edges being parallels and meridians) and that
you should use your own rectangle representation adapted to Boost.Geometry
Box concept or `bg::model::box` for this:
{{{
boost::geometry::model::box< wxPoint > box;
boost::geometry::read_wkt("BOX(0 0, 180 89)", box);
}}}
or
{{{
boost::geometry::model::box< wxPoint > box(pt1, pt2);
}}}
So I don't think this is a bug.
Does the above explanation make sense and solution work for you?
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/12314#comment:1> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:20 UTC