Is it possible to make the map loop horizontally with Mercator projection?

classic Classic list List threaded Threaded
6 messages Options
dmitriano dmitriano
Reply | Threaded
Open this post in threaded view
|

Is it possible to make the map loop horizontally with Mercator projection?

There is osgearth/tests/mercator_to_plate_carre.earth file that shows the map in Mercator projection, see the screenshot: https://developernote.com/wp-content/uploads/2017/08/osgearth-mercator.png. Is it possible to make the map loop horizontally, so there will not be blue holes at the left or right side? As far as I see, the real-life applications working with Mercator projection behave in this way, allowing the user to work with objects (lines, polygons) to cross 180 degrees of longitude.
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: Is it possible to make the map loop horizontally with Mercator projection?

Dmitri,

There's an osgEarth sample called "osgearth_infinitescroll.cpp" for 2D maps you can look at. It's experimental though -- don't expect full support for all features.
Glenn Waldron / Pelican Mapping
dmitriano dmitriano
Reply | Threaded
Open this post in threaded view
|

Re: Is it possible to make the map loop horizontally with Mercator projection?

Great! I got this: https://developernote.com/wp-content/uploads/2017/08/osgearth-mercator-infinite.png, but why is the projection spherical? (as far as I can guess it is something like this: http://wiki.openstreetmap.org/wiki/Mercator). Why not ellipsoid? Is there a way to easily implement it?
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: Is it possible to make the map loop horizontally with Mercator projection?

Dmitri,

I'm sorry, I do not understand your question. Can you re-word it?
Glenn Waldron / Pelican Mapping
dmitriano dmitriano
Reply | Threaded
Open this post in threaded view
|

Re: Is it possible to make the map loop horizontally with Mercator projection?

Hello, Glenn!
My question concerns the Mercator projection formula. It can be spherical or elliptical. The elliptical projection is more accurate, because its Earth model is an ellipsoid but not a sphere. But as the 'spherical-mercator' profile name in 'mercator_to_plate_carre.earth' file implies, the sample apps use spherical projection. Is there an easy way to use elliptical projection?
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|

Re: Is it possible to make the map loop horizontally with Mercator projection?

Dmitri,
If you can figure out how to define an ellipsoidal-mercator projection in PROJ4, you can use it to initialize the profile. But I couldn't find it after a cursory search. Spherical mercator is a built-in profile because it wasy and away the more common profile used by web map tiles.
Glenn Waldron / Pelican Mapping