# !pip install leafmap import leafmap url = "https://canada-spot-ortho.s3.amazonaws.com/canada_spot_orthoimages/canada_spot5_orthoimages/S5_2007/S5_11055_6057_20070622/S5_11055_6057_20070622.json" leafmap.stac_assets(url) leafmap.stac_bounds(url) leafmap.stac_center(url) # leafmap.stac_info(url) # leafmap.stac_stats(url) m = leafmap.Map() m.add_stac_layer(url, bands=["B3", "B2", "B1"]) m # import os # os.environ["TITILER_ENDPOINT"] = "planetary-computer" collection = "landsat-8-c2-l2" item = "LC08_L2SP_047027_20201204_02_T1" leafmap.stac_assets(collection=collection, item=item, titiler_endpoint="pc") leafmap.stac_bounds(collection=collection, item=item) leafmap.stac_info(collection=collection, item=item, assets="SR_B7") leafmap.stac_stats(collection=collection, item=item, assets="SR_B7") m = leafmap.Map() m.add_stac_layer( collection=collection, item=item, assets=["SR_B5", "SR_B4", "SR_B3"], name="Color infrared", ) m m = leafmap.Map() m.add_stac_layer( collection=collection, item=item, assets="SR_B7,SR_B5,SR_B4", name="False color" ) m m = leafmap.Map() m.add_stac_layer( collection=collection, item=item, expression="(SR_B5-SR_B4)/(SR_B5+SR_B4)", rescale="-1,1", name="NDVI", ) m m = leafmap.Map() m.add_stac_layer( collection=collection, item=item, assets="SR_B5,SR_B4,SR_B3", name="Color infrared" ) m.add_stac_layer( collection=collection, item=item, expression="(SR_B5-SR_B4)/(SR_B5+SR_B4)", rescale="-1,1", colormap_name="greens", name="NDVI Green", ) m