-
Hi, Is it possible to add a geometric shape to the static map using cartoee in certain lon, lat coordinates? thank you |
Beta Was this translation helpful? Give feedback.
Answered by
giswqs
Feb 9, 2024
Replies: 1 comment
-
See this example. import ee
import geemap
from geemap import cartoee
import cartopy.crs as ccrs
import matplotlib.pyplot as plt
geemap.ee_initialize()
srtm = ee.Image("CGIAR/SRTM90_V4")
region = [180, -60, -180, 85] # define bounding box to request data
vis = {'min': 0, 'max': 3000} # define visualization parameters for image
fig = plt.figure(figsize=(15, 10))
cmap = "gist_earth" # colormap we want to use
# cmap = "terrain"
# use cartoee to get a map
ax = cartoee.get_map(srtm, region=region, vis_params=vis, cmap=cmap)
ax.plot([-10, 20, 20, -10, -10], [30, 30, 60, 60, 30],
color='red', linewidth=3, marker='.',
# transform=ccrs.Geodetic(), #remove this line to get straight lines
)
cartoee.add_colorbar(
ax, vis, cmap=cmap, loc="right", label="Elevation", orientation="vertical"
)
ax.set_title(label='Global Elevation Map', fontsize=15)
plt.show() |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
giswqs
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See this example.