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"]
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!
Answer
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]
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.


Comments
Post a Comment