Message Boards Message Boards

Change GeoRange from "World" to USA?

Hi,

How do I apply the United State of America instead of the World in the "GeoRange" command? In other words, I would like to specify two points on the USA country, NOT the World.

GeoListPlot[{WeatherData[{38.4916, -122.1241}], 
  WeatherData[{25.8175, -80.2858}]}, 
 GeoBackground -> GeoStyling["ReliefMap"], GeoRange -> "World"]

enter image description here

POSTED BY: M.A. Ghorbani
6 Replies

You can add the polygon of the US in the GeoListPlot result with something like this:

GeoListPlot[{WeatherData[{38.4916, -122.1241}], 
  WeatherData[{25.8175, -80.2858}], 
  Polygon[Entity["Country", "UnitedStates"]]}, 
 GeoBackground -> GeoStyling["ReliefMap"]]

(Note that now there is no need of the GeoRange specification, because we get the map bounds from its geo primitives.)

Or you can use GeoGraphics directly with something like

GeoGraphics[{Thick, GeoBoundary[Entity["Country", "UnitedStates"]], 
  GeoMarker@WeatherData[{38.4916, -122.1241}], 
  GeoMarker@WeatherData[{25.8175, -80.2858}]}, 
 GeoBackground -> GeoStyling["ReliefMap"]]

Thank you again, Jose.

I got these outputs: enter image description here

POSTED BY: M.A. Ghorbani

I see. I used features of WL 12.2. You are probably using a previous version. Then try this:

GeoGraphics[{{EdgeForm[Directive[Black, Thick]], FaceForm[], 
   Polygon[Entity["Country", "UnitedStates"]]}, 
  GeoMarker@WeatherData[{38.4916, -122.1241}], 
  GeoMarker@WeatherData[{25.8175, -80.2858}]}, 
 GeoBackground -> GeoStyling["ReliefMap"]]

I really appreciate your help.

Regards, Mohammad

POSTED BY: M.A. Ghorbani

Is this what you want?

GeoListPlot[{WeatherData[{38.4916, -122.1241}], WeatherData[{25.8175, -80.2858}]}, 
 GeoBackground -> GeoStyling["ReliefMap"], 
 GeoRange -> Entity["Country", "UnitedStates"]]

Thank you so much, Jose.

Is it possible to have a full border for the USA in the Relief Map?

POSTED BY: M.A. Ghorbani
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