Say I have some location data.
SeedRandom[123]
locs = GeoPosition[
Reverse[RandomPoint[Rectangle[{-88.6273, 29.6616}, {-84.2036, 32.7994}], 400], 2]]
I want to create a fully interactive GeoHistogram
(with tooltips and other additions still functioning) but with a GeoStyling["OutlineMap"]
specification for the states/provencies (EntityClass["AdministrativeDivision", "ADM2"]
) within the GeoBounds
of the data (plus any GeoPadding
).
Unfortunately it appears that GeoBackground
cannot be used as you cannot specify the geo-polygons directly or with an "AdministrativeDivision"
class.
GeoHistogram[locs,
GeoRangePadding -> Quantity[2, "AngularDegrees"],
GeoBackground -> {GeoStyling["OutlineMap",
Directive[Lighter[LightGray, .25], EdgeForm[LightYellow]]],
EntityClass["AdministrativeDivision", "ADM2"]}]
You can however, create the backround and the histrogram separately and use Show
but this appears to be broken.
With the map background you have to know what areas you are in since simply specifying EntityClass["AdministrativeDivision", "ADM2"]["Polygon"]
starts the download of ten's of thousand's of polygons.
map =
GeoGraphics[{GeoStyling["OutlineMap",
Directive[Lighter[LightGray, .25], EdgeForm[LightYellow]]],
EntityClass["AdministrativeDivision", "ContinentalUSStates"]["Polygon"]},
GeoBackground -> Lighter[LightBlue, .25],
GeoRange -> GeoBounds[locs],
GeoRangePadding -> Quantity[2, "AngularDegrees"]
]
Creating an none background for a GeoHistogram
is easy enough.
geoHist =
GeoHistogram[locs, GeoRangePadding -> Quantity[2, "AngularDegrees"],
GeoBackground -> None]
However it appears that Show
does not work with GeoGraphics
. It completely ignores the GeoBounds
option. However, interactivity is preserved.
Show[map, geoHist]
Overlay
works but kills the interactivity. Tooltips and other added functionality do not work.
Overlay[{map, geoHist}]
Therefore, I would like to know if there are some hidded options/features for GeoHistogram
that will preserve interactivity while allowing a GeoStyling["OutlineMap"]
specification at an "AdministrativeDivision"
class level ("ADM1"
, "ADM2"
, or "ADM3"
) without having to EntityPrefetch
all "AdministrativeDivision"
"Polygon"
s available. Any ideas? Also, confirmation on the apparent Show
bug.
Mma 11.3.0 on Win 10 Ent
Overlay[{map, geoHist}, All, 2]
I'm not sure about geo options (and don't want to investigate) but if you repeat relevant ones inShow
it looks ok too:Show[map, geoHist , GeoRange -> GeoBounds[locs] , GeoRangePadding -> Quantity[2, "AngularDegrees"] ]
$\endgroup$Show
andOverlay
clarification is very helpful. Thanks. $\endgroup$