{"id":16704162,"url":"https://github.com/aazuspan/stacmap","last_synced_at":"2025-04-10T05:05:52.032Z","repository":{"id":39909569,"uuid":"490975984","full_name":"aazuspan/stacmap","owner":"aazuspan","description":"Explore STAC items with an interactive map","archived":false,"fork":false,"pushed_at":"2022-11-25T23:07:17.000Z","size":241,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-13T17:02:53.810Z","etag":null,"topics":["earth-observation","explore","folium","geospatial","interactive-map","spatiotemporal-asset-catalog","stac"],"latest_commit_sha":null,"homepage":"https://stacmap.readthedocs.io/en/latest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aazuspan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-05-11T05:58:01.000Z","updated_at":"2024-02-23T14:30:23.000Z","dependencies_parsed_at":"2022-06-30T02:33:58.713Z","dependency_job_id":null,"html_url":"https://github.com/aazuspan/stacmap","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aazuspan%2Fstacmap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aazuspan%2Fstacmap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aazuspan%2Fstacmap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aazuspan%2Fstacmap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aazuspan","download_url":"https://codeload.github.com/aazuspan/stacmap/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239140360,"owners_count":19588398,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["earth-observation","explore","folium","geospatial","interactive-map","spatiotemporal-asset-catalog","stac"],"created_at":"2024-10-12T19:11:31.826Z","updated_at":"2025-02-16T14:31:50.292Z","avatar_url":"https://github.com/aazuspan.png","language":"Python","readme":"# stacmap\n\n[![PyPI version](https://badge.fury.io/py/stacmap.svg)](https://badge.fury.io/py/stacmap)\n[![Documentation Status](https://readthedocs.org/projects/pip/badge/?version=latest)](https://stacmap.readthedocs.io/en/latest/)\n![Testing workflow](https://github.com/aazuspan/stacmap/actions/workflows/tests.yml/badge.svg)\n[![nbviewer](https://raw.githubusercontent.com/jupyter/design/master/logos/Badges/nbviewer_badge.svg)](https://nbviewer.org/github/aazuspan/stacmap/blob/main/docs/source/tutorials/quickstart.ipynb)\n[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/aazuspan/stacmap/HEAD?labpath=docs%2Fsource%2Ftutorials%2Fquickstart.ipynb)\n[![codecov](https://codecov.io/gh/aazuspan/stacmap/branch/main/graph/badge.svg?token=P6Z6ENOA4M)](https://codecov.io/gh/aazuspan/stacmap)\n\nCreate interactive maps of [STAC](https://stacspec.org/) items and collections without the heavy dependencies and boilerplate of `geopandas.GeoDataFrame.explore`.\n\n# Features\n\n- 🗺️ Explore STAC item footprints\n- 🌈 Color-code items by properties\n- 🖼️ Preview item thumbnails\n- 🪶 Lightweight dependencies (just `folium` and `pystac`)\n\n# Installation\n\n```bash\n$ pip install stacmap\n```\n\n# Quickstart\n\n`stacmap.explore` creates an interactive [Folium](https://python-visualization.github.io/folium/) map from STAC items or collections.\n\n```python\nimport stacmap\nfrom pystac_client import Client\n\n# Find Landsat Collection 2 scenes over an area of interest\ncatalog = Client.open(\"https://landsatlook.usgs.gov/stac-server\")\nitems = catalog.search(\n    bbox=[-120.9519, 37.2455, -113.4812, 45.1025],\n    collections=[\"landsat-c2l2-srby\"],\n    datetime=\"2019-08-01/2019-08-03\"\n).get_all_items()\n\n\n# Plot the items on an interactive map, color-coded by cloud cover\nstacmap.explore(items, prop=\"eo:cloud_cover\")\n```\n\nCheck out [the docs](https://stacmap.readthedocs.io/en/latest/) for details or try out an [interactive notebook](https://mybinder.org/v2/gh/aazuspan/stacmap/HEAD?labpath=docs%2Fsource%2Ftutorials%2Fquickstart.ipynb) in Binder.\n\n# Compared to GeoPandas\n\nLet's look at a simple example to see how `stacmap` simplifies plotting a STAC collection and search bounds over `geopandas`.\n\nFirst, we'll load our STAC items:\n\n```python\nfrom pystac_client import Client\n\ncatalog = pystac_client.Client.open(\"https://planetarycomputer.microsoft.com/api/stac/v1\")\n\nbbox = (-67.008753, -9.96445, -65.615556, -8.57408)\n\nitems = catalog.search(\n    collections=[\"sentinel-2-l2a\"],\n    bbox=bbox,\n    datetime=\"2019-06-01/2019-06-10\"\n).get_all_items()\n```\n\nNow we'll create an interactive map that shows our items and our bounding box.\n\n\u003ctable\u003e\n\n\u003ctr\u003e\n\u003cth\u003e stacmap \u003c/th\u003e\n\u003cth\u003e geopandas \u003c/th\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e\n  \n``` python\n!pip install stacmap\n\nimport stacmap\n\nstacmap.explore(\n    items, \n    prop=\"eo:cloud_cover\", \n    bbox=bbox\n)\n```\n\n\u003c/td\u003e\n\u003ctd\u003e\n\n``` python\n!pip install geopandas folium mapclassify matplotlib\n\nimport geopandas as gpd\nimport shapely\nimport folium\n\ngdf = gpd.GeoDataFrame.from_features(\n    items.to_dict(), \n    crs=\"EPSG:4326\"\n)\nbbox_geom = shapely.geometry.mapping(shapely.geometry.box(*bbox))\nbbox_layer = folium.GeoJson(bbox_geom)\n\nm = gdf.explore(column=\"eo:cloud_cover\")\nbbox_layer.add_to(m)\nm\n```\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003c/table\u003e\n\nUsers coming from `geopandas` can check out the [transition guide](https://stacmap.readthedocs.io/en/latest/tutorials/geopandas.html) for tips on switching to the `stacmap` API.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faazuspan%2Fstacmap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faazuspan%2Fstacmap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faazuspan%2Fstacmap/lists"}