In [ ]:
Copied!
# %pip install geoai-py
# %pip install geoai-py
Import library¶
In [ ]:
Copied!
import geoai
import geoai
Create an interactive map¶
In [ ]:
Copied!
m = geoai.Map(center=[47.031260, -99.156360], zoom=14)
m.add_basemap("Esri.WorldImagery")
m
m = geoai.Map(center=[47.031260, -99.156360], zoom=14)
m.add_basemap("Esri.WorldImagery")
m
Use the drawing tool to select an area of interest (AOI) on the map. The selected area will be used to search for NAIP imagery.
In [ ]:
Copied!
if m.user_roi is not None:
bbox = m.user_roi_bounds()
else:
bbox = [-99.1705, 47.0149, -99.1296, 47.0365]
if m.user_roi is not None:
bbox = m.user_roi_bounds()
else:
bbox = [-99.1705, 47.0149, -99.1296, 47.0365]
Search for NAIP imagery¶
In [ ]:
Copied!
items = geoai.pc_stac_search(
collection="naip",
bbox=bbox,
)
items = geoai.pc_stac_search(
collection="naip",
bbox=bbox,
)
In [ ]:
Copied!
items
items
Visualize the search results¶
In [ ]:
Copied!
geoai.view_pc_items(items=items)
geoai.view_pc_items(items=items)
Download NAIP imagery¶
In [ ]:
Copied!
geoai.pc_stac_download(items, output_dir="naip", assets=["image"])
geoai.pc_stac_download(items, output_dir="naip", assets=["image"])