Skip to content

How do I add 'region' as 'draw_last_feature' while plotting using Cartoee? #208

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

You must be logged in to vote

The region should be a list of coordinates representing (minLng, minLat, maxLng, maxLat). Try the following code.

roi =m.draw_last_feature
geom = roi.geometry()
coords = geom.coordinates().getInfo()
zoom_region = [coords[0][0][0], coords[0][0][1], coords[0][2][0], coords[0][2][1]]

fig = plt.figure(figsize=(10,7))

vis = {
    "bands":["VV"],
    "min":-25,
    "max":0,
    "palette":['aqua', 'black']
}

# use cartoee to get a map
ax = cartoee.get_map(Sentinel_1,vis_params=vis,region=zoom_region)

# add gridlines to the map at a specified interval
cartoee.add_gridlines(ax,interval=[1,1],linestyle=":")

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@GokulGeo
Comment options

@GokulGeo
Comment options

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