Skip to content

degrees are converted to radians with a trivial transformation - why is this correct? #1328

Answered by vissarion
storm-ptr asked this question in Q&A
Discussion options

You must be logged in to vote

This function should not be used this way. When projecting you want to transform a geometry from a spheroid or a projected coordinate system to another projected coordinate system. That is the result should always be a two dimensional point (in cartesian coordinates and in units defined by the target coordinate system). One such a system is the Web Mercator projection (epsg: 3857). So by changing your example a bit

#include <boost/geometry.hpp>
#include <boost/geometry/srs/epsg.hpp>
#include <boost/geometry/srs/projection.hpp>
#include <iostream>

using geographic_point_t = boost::geometry::model::d2::
    point_xy<double, boost::geometry::cs::geographic<boost::geometry::degree>>;

using c…

Replies: 5 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by storm-ptr
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants