I want to draw some polygons bounded with various geographic coordinates. For example, here is the code to draw a triangle between New York, Cape Town and Beijing.

 FilledCurve[{GeoPath[{{47, -75}, {-34, 18}, {40, 116}}, 
    CurveClosed -> True]}], GeoProjection -> "Mollweide", 
 GeoRange -> "World"]

The resulting graphic does not look good:

Mathematica graphics

How can I achieve a correct drawing of polygons with GeoGraphics?

edit: For clarification, I don't want polygons with straight lines but GeoPath projections (Geodesic, Rhumb, Loxodrome, etc).

  • $\begingroup$ @Kuba if I omit the ClosedCurve option it just draws a straight line, this is not ok (it doesn't project the line on the map using the selected (in this case, Mollweide) projection). $\endgroup$
    – shrx
    Apr 14, 2015 at 9:53
  • 1
    $\begingroup$ The problem is that it is closer to go east from Bejing and that similar issue like in this question arises since coordinates are not well handled Mod360 wise. (I'm not 100% sure). But even then it would create line around so the real question is how to force geopath to find geodesics in opposite direction to real one. $\endgroup$
    – Kuba
    Apr 14, 2015 at 10:53
  • $\begingroup$ I tried the fix from the quesiton you linked but unfortunately it made no difference. $\endgroup$
    – shrx
    Apr 14, 2015 at 10:57
  • 1
    $\begingroup$ The problem is that GeoPath is taking the shorter route, and the top of your polygon is the longer route. I'm not sure how to convince it to take the longer route. I'll play with it. $\endgroup$
    – rcollyer
    Apr 14, 2015 at 13:03
  • 1
    $\begingroup$ The closing geodesic goes beyond the pole. An azimuthal projection would be more appropriate here: GeoGraphics[ FilledCurve[{GeoPath[{{47, -75}, {-34, 18}, {40, 116}}, CurveClosed -> True]}], GeoProjection -> {"LambertAzimuthal", "Centering" -> {90, 0}}, GeoRange -> "World", GeoGridLines -> Automatic] $\endgroup$
    – jose
    Apr 14, 2015 at 14:21


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.