TransWikia.com

How to use PlotRange with GeoGraphics

Mathematica Asked by K7PEH on July 28, 2020

I am using PlotRange to clip a GeoGraphics plot so that I can center an area of interest. However, I do this via trial-and-error because I have no idea how PlotRange coordinates specified as PlotRange->{{-0.4,.6},{-.25,.4}} which properly clips the geographic result.

But, what am I doing? In an ordinary coordinate plotted graph I am controlling the range of the coordinate axis over the plotted range of values. But in a GeoGraphics plot it seems that the maximum range of these coordinates is plus and minus 1 for each axis (horizontal and vertical).

This a guess because there is no documentation under PlotRange that describes how it is being used with a GeoGraphics plot. And, under GeoGraphics documentation, there is no explicit mention of PlotRange.

Question: what is the meaning of the numeric values specified in PlotRange coordinate limits. Are they fractions of a whole projection and if so do they measure anything (certainly not longitude and latitude lines that I can tell).

One Answer

As @BobHanlon mentioned, you actually want to use GeoRange rather than PlotRange for GeoGraphics as this is what the documentation suggests. Also, you might want to use GeoCenter to centre your GeoGraphics (and using GeoRangePadding to add to your view range, or GeoRangePadding -> None to set the default padding off), rather than moving PlotRange or GeoRange about.

One of the more useful things about using the Geo* functions is that most of them work correctly with geographic entities, so you can also do GeoRange -> Entity["Country", "UnitedStates"] which is often more useful than setting it to specific lat/lon ranges.

Anyway, if the projection is equirectangular, GeoRange and PlotRange do almost same thing for GeoGraphics, but the X and Y is reversed - it is {{-lon, +lon}, {-lat, +lat}} for PlotRange and {{-lat, +lat}, {-lon, +lon}} for GeoRange. In both cases lat and lon are absolute angular degrees by default.

However, if the projection for your GeoGraphics is not equirectangular, PlotRange will use the native units for your projection, which is nearly always confusing and not what you want. This is a big reason to use GeoRange instead of GeoGraphics, especially as GeoGraphics will automatically change projections based on the size of the range by default.

GeoGraphics[PlotRange -> {{-10, -6}, {53, 56}}, 
 GeoGridLines -> Quantity[.1, "AngularDegrees"], GeoProjection -> "Equirectangular"]

enter image description here

GeoGraphics[GeoRange -> {{53, 56}, {-10, -6}}, 
 GeoGridLines -> Quantity[.1, "AngularDegrees"]]

enter image description here

Correct answer by Carl Lange on July 28, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP