
Geometry : 
From: Adam Wulkiewicz (adam.wulkiewicz_at_[hidden])
Date: 20190923 13:56:42
Hi,
W dniu 23.09.2019 oÂ 10:57, Mateusz Loskot via Geometry pisze:
> On Mon, 23 Sep 2019 at 10:38, Ahmet Temiz via Geometry
> <geometry_at_[hidden]> wrote:
>> Hi,
>> I am not sure how I can define epsg : 3857 in boost geometry
> Should be something along these lines:
>
> #include <boost/geometry/srs/epsg.hpp>
> #include <boost/geometry/srs/projection.hpp>
>
> boost::geometry::srs::projection<> prj = boost::geometry::srs::epsg(3857);
> boost::geometry::point_xy<double, epsg<2040>> my_point(0, 0);
>
> Also, search through the source code of the Boost.Geometry tests
> for more details about how `epsg` and `projection` can be used.
This is not correct. The point type can only take cs::cartesian,
cs::spherical or cs::geographic. EPSG:3857 is web/spherical mercator
projection so to represent the points you'll use bg::cs::cartesian. The
problem with this is that the algorithms will treat the coordinates as
purly cartesian so the globe won't wrap around behind the antimeridian.
What would you like to do exactly?
Do you want to convert to or from it to some other SRS or do you have
cartesian coordinates in EPSG:3857 and want to use some Boost.Geometry
algorithms?
Adam
Geometry list run by mateusz at loskot.net