5
$\begingroup$

I have created an image of Europe as below:-

g1 = (GeoPosition[{56, #}] & /@ Range[-10, 25, 5]);
g2 = (GeoPosition[{36, #}] & /@ Range[25, -10, -5]);
img = GeoGraphics[Polygon@Join[g1, g2], GeoProjection -> "CylindricalEqualArea"]

enter image description here

As you can see, the desired area in now in grey, and there's a border with lighter color there. How can I remove the border without using the trial-and-error approach of chopping img by pixels?

Many thanks!

$\endgroup$
1

1 Answer 1

6
$\begingroup$

Set GeoRangePadding -> None:

g1 = (GeoPosition[{56, #}] & /@ Range[-10, 25, 5]);
g2 = (GeoPosition[{36, #}] & /@ Range[25, -10, -5]);
img = GeoGraphics[Polygon@Join[g1, g2], 
  GeoProjection -> "CylindricalEqualArea", GeoRangePadding -> None]

enter image description here

By default, GeoGraphics with GeoRange -> Automatic uses a range that encloses your content, then GeoRangePadding adds some extra space around it. If you turn off the padding, you get just the area needed to include your content.

$\endgroup$

Your Answer

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

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