17
$\begingroup$

Bug introduced in 10.0.0 and fixed in 11.0.0


A remark about the answer:

My work around is only nice for simple cases with points. More general should include proper polygons splitting on antimeridian.


I'd expect GeoGraphics to handle positions of points since they are provided with GeoPosition wrapper.

But it is not the case for every projection:

Table[
 GeoGraphics[Point@GeoPosition[{0, 90}], GeoRange -> "World", 
                                         GeoCenter -> GeoPosition[{0, center}], 
                                         BaseStyle -> AbsolutePointSize@12, 
                                         GeoProjection -> i]
 ,
 {center, {-180, 0}},
 {i,      GeoProjectionData[][[;; 5]]}
]

enter image description here

As we can see, when GeoCenter is not default {0,0}, some points are missing for couple of projections.

One can correct this manually but it is not consistent at all:

{##, GeoGraphics[Point@GeoPosition[#2], GeoRange -> "World", 
                                         GeoCenter -> GeoPosition[{0, -180}], 
                                         GeoProjection -> #]} & @@@ {  
{"Equirectangular", {0, 90}}, {"Mollweide", {0, 90}}, {"Mollweide", {0, -270}}} // Grid

enter image description here


V11.0.0 edit

Grid@Transpose@
  Table[GeoGraphics[Point@GeoPosition[{0, 90}], GeoRange -> "World", 
    GeoCenter -> GeoPosition[{0, center}], 
    BaseStyle -> AbsolutePointSize@12, 
    GeoProjection -> i], {center, {-180, 0}}, {i, 
    GeoProjectionData[][[2 ;; 7]]}]

enter image description here

$\endgroup$
4
  • $\begingroup$ Points would not plot at all in Question 72426. This may be a related issue. Alternatively, I may have made an error. Win 8.1 (64 bit) $\endgroup$ – bbgodfrey Jan 25 '15 at 16:53
  • $\begingroup$ @bbgodfrey I think it is slightly related but the main problem there is that one should use GeoGraphics not GeoListPlot. Take a look at the answer I've added. $\endgroup$ – Kuba Jan 25 '15 at 17:09
  • $\begingroup$ @Kuba I am not that savvy in every field, could you please asks about deeper functionality on Wolfram Community? It is much easier to get a relevant developer to comment there. For example a recent thing that you know: community.wolfram.com/groups/-/m/t/427526 $\endgroup$ – Vitaliy Kaurov Jan 25 '15 at 19:01
  • $\begingroup$ @VitaliyKaurov Sure, I just wanted to ask if you are surprised by this behaviour or not. :) $\endgroup$ – Kuba Jan 25 '15 at 19:03
11
$\begingroup$

Here's a workaround for 10.x.x versions.

It seems that within the projected area is everything with longitude in interval: {t-180, t+180} and if you set t = -180 algorithm does not care that it is plotting {-360 , 0} while original data has domain {-180, 180}.

We have to take care of Mod ourselves:

pos = Cases[ CountryData["World", "SchematicCoordinates"], {_, _Real}, \[Infinity]];

Manipulate[
 GeoGraphics[{Red, AbsolutePointSize@7, Point@GeoPosition[{#, Mod[#2, 360, -180 + t]} & @@@ pos]},
    GeoRange -> "World",
    GeoProjection -> "Sinusoidal", 
    Frame -> True, 
    FrameTicks -> {{{-180 Degree, t - 180}, {0 Degree, t}, {180 Degree, t + 180}}, Automatic},
    GeoCenter -> GeoPosition[{0, t}],
    ImageSize -> 800,
    GeoGridLines -> Automatic, 
    GeoGridLinesStyle -> Black, 
    GeoBackground -> White, 
    PlotRangePadding -> Scaled[.05]],
 {t, -180, 180}]

animated sinusoidal projection

$\endgroup$
4
  • $\begingroup$ Today I ve learned a lot, Kuba. Can I do the same in my question? mathematica.stackexchange.com/questions/72426/… $\endgroup$ – locometro Jan 25 '15 at 21:46
  • 2
    $\begingroup$ @locometro Me too, thanks for asking this question, I had no motivation to play with it till now. I hope WRI will fix those problems and include features for astronomers :) p.s. remember that you can upvote topics that you find useful. $\endgroup$ – Kuba Jan 25 '15 at 21:50
  • $\begingroup$ This beatiful animation!!! $\endgroup$ – locometro Jan 25 '15 at 22:17
  • $\begingroup$ @locometro Sure, added $\endgroup$ – Kuba Jan 25 '15 at 22:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.