Add a raster along with an image in the map¶
In [ ]:
Copied!
pip install geopypi
pip install geopypi
In [1]:
Copied!
import geopypi
import geopypi
Using local file¶
In [4]:
Copied!
m = geopypi.Map()
m.add_raster(r"D:\spring 24\software design\Libya-2023-07-01.tif")
m.add_zoom_slider()
m
m = geopypi.Map()
m.add_raster(r"D:\spring 24\software design\Libya-2023-07-01.tif")
m.add_zoom_slider()
m
Out[4]:
Map(center=[32.774843000000004, 22.6282785], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_…
using URL¶
In [5]:
Copied!
m2 = geopypi.Map()
m2.add_raster('https://github.com/opengeos/datasets/releases/download/raster/landsat.tif')
m2
m2 = geopypi.Map()
m2.add_raster('https://github.com/opengeos/datasets/releases/download/raster/landsat.tif')
m2
Out[5]:
Map(center=[37.637848, -119.037106], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_title…
using image¶
In [31]:
Copied!
m3 = geopypi.Map(center=(20, -115), zoom=3)
url = "https://img.freepik.com/free-photo/fantastic-wonderland-forest-landscape-with-mushrooms-flowers-ai-generative_157027-1723.jpg?w=1800&t=st=1712696724~exp=1712697324~hmac=caa3d01d60a54ea5b0581685029c69e254a2111477624bd4180f8be07f18d8ce"
bounds = ((10, -130), (24, -100))
m3.add_image(url, bounds)
m3
m3 = geopypi.Map(center=(20, -115), zoom=3)
url = "https://img.freepik.com/free-photo/fantastic-wonderland-forest-landscape-with-mushrooms-flowers-ai-generative_157027-1723.jpg?w=1800&t=st=1712696724~exp=1712697324~hmac=caa3d01d60a54ea5b0581685029c69e254a2111477624bd4180f8be07f18d8ce"
bounds = ((10, -130), (24, -100))
m3.add_image(url, bounds)
m3
Out[31]:
Map(center=[20, -115], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_title', 'zoom_out_t…