Skip to content

Add geometric shape on the static map #1893

Answered by giswqs
adefaizal asked this question in Q&A
Discussion options

You must be logged in to vote

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…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by giswqs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants