Message Boards Message Boards

Combine GeoGraphics to see US borders on ReliefMap

Posted 10 years ago
POSTED BY: Jon Rogers
3 Replies

The basic idea is using GeoGraphics twice. This basically allows you to put any part of a map inside any geo polygon of another map.

The first GeoGraphics produces a rectangular map (in lat-lon coordinates; note the use of GeoProjection->"Equirectangular") with the exact lat-lon ranges corresponding to the region your are interested in (note the use of GeoRange->visible). The result is given as a GeoGraphics[Graphics[...], ...] object. We take the Graphics[...] and rasterize it as an Image with enough resolution.

Finally, with the second GeoGraphics, we take the resulting Image and place it inside the geo visible region using GeoStyling[{"GeoImage", image}]. Note the use of "GeoImage" (instead of the alternative "Image"); this is to project that image to the geo projection chosen by the second GeoGraphics.

If you have questions about the process, do not hesitate to ask.

Jose.

Posted 10 years ago

Thank you. That was exactly what I was looking for. I am going to have to reverse engineer your code to fully understand how to repeat this in the future.

POSTED BY: Jon Rogers

Try this:

visible = GeoVisibleRegion[{44.0519, -123.0867, Quantity[100, "Kilometers"]}];

states = GeoEntities[visible, "AdministrativeDivision1"];

geographics = GeoGraphics[{EdgeForm[Black], FaceForm[], Polygon[states]}, 
GeoBackground -> "ReliefMap", GeoRange -> visible, GeoProjection -> "Equirectangular"];

image = Rasterize[First[geographics], "Image", RasterSize -> 1000];

GeoGraphics[{GeoStyling[{"GeoImage", image}], EdgeForm[Black], visible}, GeoBackground -> None]

enter image description here

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract