Web app for visualizing and labeling COGs.
- If
GDALlibraries are not on the system,condais the simplest way to install them:
$ conda env create -f streamlit-cogs.yml- If
GDALlibraries are available, skip to step (3), but it's a good idea to create a virtual environment:
$ python -m venv venv && source vevn/bin/activate # on Unix- Activate the newly created environment:
$ conda activate streamlit_cogs- From inside the directory that includes the
pyproject.tomlfile:
$ python -m pip install .$ streamlit run streamlit-cogs/main.py- If run locally, this may open the browser at the
URL:portgiven, otherwise a network URL is given if it is reachable. - For actual deployment options, Streamlit apps are easily dockerizable, or for more public apps, they can be deployed straight to Streamlit Community Cloud through GitHub.
- Choose from the preloaded imagery, grouped together by date (
All), or select an individual layer only.- Layers can also be toggled on and off from the map view by clicking on the top right button.
- Adding URLs: Other COG URLs may also be added manually in the appropriate text input box; separate by a
|if adding multiple. Make sure to clickSubmit changesto load the new URLs. - Band ordering: Depending on the COG, the bands may be out of order, so they can be reordered using the multi-select box, and clicking
Submit changes. It's also possible to inspect one or two bands individually by only including the ones needed. - Rescaling: To change the contrast levels of the displayed bands, they can be rescaled in the
Band rescalingsection. The default values are preloaded with the COG metadata min/max values. After the appropriate band min/max values are edited, clickRescale bandsto add the bands as layers to the map view. - Labeling: The map view provides multiple labeling tools on the left-hand side. Clicking a drawn object on the map will open a popup of its GeoJSON object representation, while clicking on the
Exportbutton in the top right downloads a GeoJSON file with all the drawn objects.