0
votes
countries_shp = 'D:\Chure_Region\Chure_Region.shp'
countries = geemap.shp_to_ee(countries_shp)
rech_france = annual_rech.clip(countries)
type(countries)
ee.featurecollection.FeatureCollection
type(rech_france)
ee.image.Image


# Create a folium map.
my_map = folium.Map(location=[lat, lon], tiles='OpenStreetMap',zoom_start=6, zoom_control=False)
# Set visualization parameters for recharge.
rech_vis_params = {
    "bands": "rech",
    "min": 0,
    "max": 300,
    "opacity": 1,
    "palette": ["red", "orange", "yellow", "green", "blue", "purple"],
}



# Define a recharge colormap.
rech_colormap = cm.LinearColormap(
    colors=rech_vis_params["palette"],
    vmin=rech_vis_params["min"],
    vmax=rech_vis_params["max"],
)


# Caption of the recharge colormap.
rech_colormap.caption = "Average annual recharge rate (mm/year)"
# Add the precipitation composite to the map object.
# Add the recharge composite to the map object.
my_map.ee_layer(rech_france, rech_vis_params, "Recharge")

# Add a marker at both locations of interest.
folium.Marker([lat, lon], popup="Area of Lyon").add_to(my_map)
# Add the colormaps to the map.
my_map.add_child(rech_colormap)
my_map.add_child(pr_colormap)

# Add a layer control panel to the map.
my_map.add_child(folium.LayerControl())

# Display the map.
display(my_map)


---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-54-a0c3f5d637a7> in <module>
     24 # Add the precipitation composite to the map object.
     25 # Add the recharge composite to the map object.
---> 26 my_map.ee_layer(rech_france, rech_vis_params, "Recharge")
     27 
     28 # Add a marker at both locations of interest.

AttributeError: 'Map' object has no attribute 'ee_layer'

when I use google earth engine data It worked

countries = ee.FeatureCollection("FAO/GAUL/2015/level0").select("ADM0_NAME") france = countries.filter(ee.Filter.eq("ADM0_NAME", "Nepal")) but when I replace it with Chure_Region.shp it shows error. . I tried to plot but I got this error. How to fix this problem. Any clue? Thank you very much in advance!