Toolbar
In [1]:
Copied!
!pip install geoproject
!pip install geoproject
Requirement already satisfied: geoproject in /opt/hostedtoolcache/Python/3.9.16/x64/lib/python3.9/site-packages (0.0.4) Requirement already satisfied: folium in /home/runner/.local/lib/python3.9/site-packages (from geoproject) (0.13.0) Requirement already satisfied: ipyleaflet in /home/runner/.local/lib/python3.9/site-packages (from geoproject) (0.17.2) Requirement already satisfied: geopandas in /home/runner/.local/lib/python3.9/site-packages (from geoproject) (0.13.0) Requirement already satisfied: httpx in /home/runner/.local/lib/python3.9/site-packages (from geoproject) (0.24.1) Requirement already satisfied: leafmap in /home/runner/.local/lib/python3.9/site-packages (from geoproject) (0.20.4) Requirement already satisfied: streamlit-folium in /home/runner/.local/lib/python3.9/site-packages (from geoproject) (0.11.1) Requirement already satisfied: branca>=0.3.0 in /home/runner/.local/lib/python3.9/site-packages (from folium->geoproject) (0.6.0) Requirement already satisfied: jinja2>=2.9 in /home/runner/.local/lib/python3.9/site-packages (from folium->geoproject) (3.1.2) Requirement already satisfied: numpy in /home/runner/.local/lib/python3.9/site-packages (from folium->geoproject) (1.24.3) Requirement already satisfied: requests in /home/runner/.local/lib/python3.9/site-packages (from folium->geoproject) (2.31.0) Requirement already satisfied: fiona>=1.8.19 in /home/runner/.local/lib/python3.9/site-packages (from geopandas->geoproject) (1.9.4.post1) Requirement already satisfied: packaging in /home/runner/.local/lib/python3.9/site-packages (from geopandas->geoproject) (23.1) Requirement already satisfied: pandas>=1.1.0 in /home/runner/.local/lib/python3.9/site-packages (from geopandas->geoproject) (2.0.1) Requirement already satisfied: pyproj>=3.0.1 in /home/runner/.local/lib/python3.9/site-packages (from geopandas->geoproject) (3.5.0) Requirement already satisfied: shapely>=1.7.1 in /home/runner/.local/lib/python3.9/site-packages (from geopandas->geoproject) (2.0.1) Requirement already satisfied: certifi in /home/runner/.local/lib/python3.9/site-packages (from httpx->geoproject) (2023.5.7) Requirement already satisfied: httpcore<0.18.0,>=0.15.0 in /home/runner/.local/lib/python3.9/site-packages (from httpx->geoproject) (0.17.2) Requirement already satisfied: idna in /home/runner/.local/lib/python3.9/site-packages (from httpx->geoproject) (3.4) Requirement already satisfied: sniffio in /home/runner/.local/lib/python3.9/site-packages (from httpx->geoproject) (1.3.0) Requirement already satisfied: ipywidgets<9,>=7.6.0 in /home/runner/.local/lib/python3.9/site-packages (from ipyleaflet->geoproject) (7.7.5) Requirement already satisfied: traittypes<3,>=0.2.1 in /home/runner/.local/lib/python3.9/site-packages (from ipyleaflet->geoproject) (0.2.1) Requirement already satisfied: xyzservices>=2021.8.1 in /home/runner/.local/lib/python3.9/site-packages (from ipyleaflet->geoproject) (2023.5.0) Requirement already satisfied: bqplot in /home/runner/.local/lib/python3.9/site-packages (from leafmap->geoproject) (0.12.39) Requirement already satisfied: colour in /home/runner/.local/lib/python3.9/site-packages (from leafmap->geoproject) (0.1.5) Requirement already satisfied: gdown in /home/runner/.local/lib/python3.9/site-packages (from leafmap->geoproject) (4.7.1) Requirement already satisfied: geojson in /home/runner/.local/lib/python3.9/site-packages (from leafmap->geoproject) (3.0.1) Requirement already satisfied: ipyevents in /home/runner/.local/lib/python3.9/site-packages (from leafmap->geoproject) (2.0.1) Requirement already satisfied: ipyfilechooser>=0.6.0 in /home/runner/.local/lib/python3.9/site-packages (from leafmap->geoproject) (0.6.0) Requirement already satisfied: matplotlib in /home/runner/.local/lib/python3.9/site-packages (from leafmap->geoproject) (3.7.1) Requirement already satisfied: pyshp>=2.1.3 in /home/runner/.local/lib/python3.9/site-packages (from leafmap->geoproject) (2.3.1) Requirement already satisfied: pystac-client in /home/runner/.local/lib/python3.9/site-packages (from leafmap->geoproject) (0.6.1) Requirement already satisfied: python-box in /home/runner/.local/lib/python3.9/site-packages (from leafmap->geoproject) (7.0.1) Requirement already satisfied: scooby in /home/runner/.local/lib/python3.9/site-packages (from leafmap->geoproject) (0.7.2) Requirement already satisfied: whiteboxgui>=0.6.0 in /home/runner/.local/lib/python3.9/site-packages (from leafmap->geoproject) (2.3.0) Requirement already satisfied: streamlit>=1.13.0 in /home/runner/.local/lib/python3.9/site-packages (from streamlit-folium->geoproject) (1.22.0) Requirement already satisfied: attrs>=19.2.0 in /home/runner/.local/lib/python3.9/site-packages (from fiona>=1.8.19->geopandas->geoproject) (23.1.0) Requirement already satisfied: click~=8.0 in /home/runner/.local/lib/python3.9/site-packages (from fiona>=1.8.19->geopandas->geoproject) (8.1.3) Requirement already satisfied: click-plugins>=1.0 in /home/runner/.local/lib/python3.9/site-packages (from fiona>=1.8.19->geopandas->geoproject) (1.1.1) Requirement already satisfied: cligj>=0.5 in /home/runner/.local/lib/python3.9/site-packages (from fiona>=1.8.19->geopandas->geoproject) (0.7.2) Requirement already satisfied: six in /home/runner/.local/lib/python3.9/site-packages (from fiona>=1.8.19->geopandas->geoproject) (1.16.0) Requirement already satisfied: importlib-metadata in /home/runner/.local/lib/python3.9/site-packages (from fiona>=1.8.19->geopandas->geoproject) (6.6.0) Requirement already satisfied: h11<0.15,>=0.13 in /home/runner/.local/lib/python3.9/site-packages (from httpcore<0.18.0,>=0.15.0->httpx->geoproject) (0.14.0) Requirement already satisfied: anyio<5.0,>=3.0 in /home/runner/.local/lib/python3.9/site-packages (from httpcore<0.18.0,>=0.15.0->httpx->geoproject) (3.6.2) Requirement already satisfied: ipykernel>=4.5.1 in /home/runner/.local/lib/python3.9/site-packages (from ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (6.23.1) Requirement already satisfied: ipython-genutils~=0.2.0 in /home/runner/.local/lib/python3.9/site-packages (from ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (0.2.0) Requirement already satisfied: traitlets>=4.3.1 in /home/runner/.local/lib/python3.9/site-packages (from ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (5.9.0) Requirement already satisfied: widgetsnbextension~=3.6.4 in /home/runner/.local/lib/python3.9/site-packages (from ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (3.6.4) Requirement already satisfied: ipython>=4.0.0 in /home/runner/.local/lib/python3.9/site-packages (from ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (8.13.2) Requirement already satisfied: jupyterlab-widgets<3,>=1.0.0 in /home/runner/.local/lib/python3.9/site-packages (from ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (1.1.4) Requirement already satisfied: MarkupSafe>=2.0 in /home/runner/.local/lib/python3.9/site-packages (from jinja2>=2.9->folium->geoproject) (2.1.2) Requirement already satisfied: python-dateutil>=2.8.2 in /home/runner/.local/lib/python3.9/site-packages (from pandas>=1.1.0->geopandas->geoproject) (2.8.2) Requirement already satisfied: pytz>=2020.1 in /home/runner/.local/lib/python3.9/site-packages (from pandas>=1.1.0->geopandas->geoproject) (2023.3) Requirement already satisfied: tzdata>=2022.1 in /home/runner/.local/lib/python3.9/site-packages (from pandas>=1.1.0->geopandas->geoproject) (2023.3) Requirement already satisfied: altair<5,>=3.2.0 in /home/runner/.local/lib/python3.9/site-packages (from streamlit>=1.13.0->streamlit-folium->geoproject) (4.2.2) Requirement already satisfied: blinker>=1.0.0 in /home/runner/.local/lib/python3.9/site-packages (from streamlit>=1.13.0->streamlit-folium->geoproject) (1.6.2) Requirement already satisfied: cachetools>=4.0 in /home/runner/.local/lib/python3.9/site-packages (from streamlit>=1.13.0->streamlit-folium->geoproject) (5.3.0) Requirement already satisfied: pillow>=6.2.0 in /home/runner/.local/lib/python3.9/site-packages (from streamlit>=1.13.0->streamlit-folium->geoproject) (9.5.0) Requirement already satisfied: protobuf<4,>=3.12 in /home/runner/.local/lib/python3.9/site-packages (from streamlit>=1.13.0->streamlit-folium->geoproject) (3.20.3) Requirement already satisfied: pyarrow>=4.0 in /home/runner/.local/lib/python3.9/site-packages (from streamlit>=1.13.0->streamlit-folium->geoproject) (12.0.0) Requirement already satisfied: pympler>=0.9 in /home/runner/.local/lib/python3.9/site-packages (from streamlit>=1.13.0->streamlit-folium->geoproject) (1.0.1) Requirement already satisfied: rich>=10.11.0 in /home/runner/.local/lib/python3.9/site-packages (from streamlit>=1.13.0->streamlit-folium->geoproject) (13.3.5) Requirement already satisfied: tenacity<9,>=8.0.0 in /home/runner/.local/lib/python3.9/site-packages (from streamlit>=1.13.0->streamlit-folium->geoproject) (8.2.2) Requirement already satisfied: toml in /home/runner/.local/lib/python3.9/site-packages (from streamlit>=1.13.0->streamlit-folium->geoproject) (0.10.2) Requirement already satisfied: typing-extensions>=3.10.0.0 in /home/runner/.local/lib/python3.9/site-packages (from streamlit>=1.13.0->streamlit-folium->geoproject) (4.6.2) Requirement already satisfied: tzlocal>=1.1 in /home/runner/.local/lib/python3.9/site-packages (from streamlit>=1.13.0->streamlit-folium->geoproject) (5.0.1) Requirement already satisfied: validators>=0.2 in /home/runner/.local/lib/python3.9/site-packages (from streamlit>=1.13.0->streamlit-folium->geoproject) (0.20.0) Requirement already satisfied: gitpython!=3.1.19 in /home/runner/.local/lib/python3.9/site-packages (from streamlit>=1.13.0->streamlit-folium->geoproject) (3.1.31) Requirement already satisfied: pydeck>=0.1.dev5 in /home/runner/.local/lib/python3.9/site-packages (from streamlit>=1.13.0->streamlit-folium->geoproject) (0.8.1b0) Requirement already satisfied: tornado>=6.0.3 in /home/runner/.local/lib/python3.9/site-packages (from streamlit>=1.13.0->streamlit-folium->geoproject) (6.3.2) Requirement already satisfied: watchdog in /home/runner/.local/lib/python3.9/site-packages (from streamlit>=1.13.0->streamlit-folium->geoproject) (3.0.0) Requirement already satisfied: charset-normalizer<4,>=2 in /home/runner/.local/lib/python3.9/site-packages (from requests->folium->geoproject) (3.1.0) Requirement already satisfied: urllib3<3,>=1.21.1 in /home/runner/.local/lib/python3.9/site-packages (from requests->folium->geoproject) (2.0.2) Requirement already satisfied: ipytree in /home/runner/.local/lib/python3.9/site-packages (from whiteboxgui>=0.6.0->leafmap->geoproject) (0.2.2) Requirement already satisfied: whitebox in /home/runner/.local/lib/python3.9/site-packages (from whiteboxgui>=0.6.0->leafmap->geoproject) (2.3.1) Requirement already satisfied: filelock in /home/runner/.local/lib/python3.9/site-packages (from gdown->leafmap->geoproject) (3.12.0) Requirement already satisfied: tqdm in /home/runner/.local/lib/python3.9/site-packages (from gdown->leafmap->geoproject) (4.65.0) Requirement already satisfied: beautifulsoup4 in /home/runner/.local/lib/python3.9/site-packages (from gdown->leafmap->geoproject) (4.12.2) Requirement already satisfied: contourpy>=1.0.1 in /home/runner/.local/lib/python3.9/site-packages (from matplotlib->leafmap->geoproject) (1.0.7) Requirement already satisfied: cycler>=0.10 in /home/runner/.local/lib/python3.9/site-packages (from matplotlib->leafmap->geoproject) (0.11.0) Requirement already satisfied: fonttools>=4.22.0 in /home/runner/.local/lib/python3.9/site-packages (from matplotlib->leafmap->geoproject) (4.39.4) Requirement already satisfied: kiwisolver>=1.0.1 in /home/runner/.local/lib/python3.9/site-packages (from matplotlib->leafmap->geoproject) (1.4.4) Requirement already satisfied: pyparsing>=2.3.1 in /home/runner/.local/lib/python3.9/site-packages (from matplotlib->leafmap->geoproject) (3.0.9) Requirement already satisfied: importlib-resources>=3.2.0 in /home/runner/.local/lib/python3.9/site-packages (from matplotlib->leafmap->geoproject) (5.12.0) Requirement already satisfied: pystac>=1.7.0 in /home/runner/.local/lib/python3.9/site-packages (from pystac-client->leafmap->geoproject) (1.7.3) Requirement already satisfied: entrypoints in /home/runner/.local/lib/python3.9/site-packages (from altair<5,>=3.2.0->streamlit>=1.13.0->streamlit-folium->geoproject) (0.4) Requirement already satisfied: jsonschema>=3.0 in /home/runner/.local/lib/python3.9/site-packages (from altair<5,>=3.2.0->streamlit>=1.13.0->streamlit-folium->geoproject) (4.17.3) Requirement already satisfied: toolz in /home/runner/.local/lib/python3.9/site-packages (from altair<5,>=3.2.0->streamlit>=1.13.0->streamlit-folium->geoproject) (0.12.0) Requirement already satisfied: gitdb<5,>=4.0.1 in /home/runner/.local/lib/python3.9/site-packages (from gitpython!=3.1.19->streamlit>=1.13.0->streamlit-folium->geoproject) (4.0.10) Requirement already satisfied: zipp>=0.5 in /home/runner/.local/lib/python3.9/site-packages (from importlib-metadata->fiona>=1.8.19->geopandas->geoproject) (3.15.0) Requirement already satisfied: comm>=0.1.1 in /home/runner/.local/lib/python3.9/site-packages (from ipykernel>=4.5.1->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (0.1.3) Requirement already satisfied: debugpy>=1.6.5 in /home/runner/.local/lib/python3.9/site-packages (from ipykernel>=4.5.1->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (1.6.7) Requirement already satisfied: jupyter-client>=6.1.12 in /home/runner/.local/lib/python3.9/site-packages (from ipykernel>=4.5.1->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (8.2.0) Requirement already satisfied: jupyter-core!=5.0.*,>=4.12 in /home/runner/.local/lib/python3.9/site-packages (from ipykernel>=4.5.1->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (5.3.0) Requirement already satisfied: matplotlib-inline>=0.1 in /home/runner/.local/lib/python3.9/site-packages (from ipykernel>=4.5.1->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (0.1.6) Requirement already satisfied: nest-asyncio in /home/runner/.local/lib/python3.9/site-packages (from ipykernel>=4.5.1->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (1.5.6) Requirement already satisfied: psutil in /home/runner/.local/lib/python3.9/site-packages (from ipykernel>=4.5.1->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (5.9.5) Requirement already satisfied: pyzmq>=20 in /home/runner/.local/lib/python3.9/site-packages (from ipykernel>=4.5.1->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (25.0.2) Requirement already satisfied: backcall in /home/runner/.local/lib/python3.9/site-packages (from ipython>=4.0.0->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (0.2.0) Requirement already satisfied: decorator in /home/runner/.local/lib/python3.9/site-packages (from ipython>=4.0.0->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (5.1.1) Requirement already satisfied: jedi>=0.16 in /home/runner/.local/lib/python3.9/site-packages (from ipython>=4.0.0->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (0.18.2) Requirement already satisfied: pickleshare in /home/runner/.local/lib/python3.9/site-packages (from ipython>=4.0.0->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (0.7.5) Requirement already satisfied: prompt-toolkit!=3.0.37,<3.1.0,>=3.0.30 in /home/runner/.local/lib/python3.9/site-packages (from ipython>=4.0.0->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (3.0.38) Requirement already satisfied: pygments>=2.4.0 in /home/runner/.local/lib/python3.9/site-packages (from ipython>=4.0.0->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (2.15.1) Requirement already satisfied: stack-data in /home/runner/.local/lib/python3.9/site-packages (from ipython>=4.0.0->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (0.6.2) Requirement already satisfied: pexpect>4.3 in /home/runner/.local/lib/python3.9/site-packages (from ipython>=4.0.0->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (4.8.0) Requirement already satisfied: markdown-it-py<3.0.0,>=2.2.0 in /home/runner/.local/lib/python3.9/site-packages (from rich>=10.11.0->streamlit>=1.13.0->streamlit-folium->geoproject) (2.2.0) Requirement already satisfied: notebook>=4.4.1 in /home/runner/.local/lib/python3.9/site-packages (from widgetsnbextension~=3.6.4->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (6.5.4) Requirement already satisfied: soupsieve>1.2 in /home/runner/.local/lib/python3.9/site-packages (from beautifulsoup4->gdown->leafmap->geoproject) (2.4.1) Requirement already satisfied: PySocks!=1.5.7,>=1.5.6 in /home/runner/.local/lib/python3.9/site-packages (from requests->folium->geoproject) (1.7.1) Requirement already satisfied: smmap<6,>=3.0.1 in /home/runner/.local/lib/python3.9/site-packages (from gitdb<5,>=4.0.1->gitpython!=3.1.19->streamlit>=1.13.0->streamlit-folium->geoproject) (5.0.0) Requirement already satisfied: parso<0.9.0,>=0.8.0 in /home/runner/.local/lib/python3.9/site-packages (from jedi>=0.16->ipython>=4.0.0->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (0.8.3) Requirement already satisfied: pyrsistent!=0.17.0,!=0.17.1,!=0.17.2,>=0.14.0 in /home/runner/.local/lib/python3.9/site-packages (from jsonschema>=3.0->altair<5,>=3.2.0->streamlit>=1.13.0->streamlit-folium->geoproject) (0.19.3) Requirement already satisfied: platformdirs>=2.5 in /home/runner/.local/lib/python3.9/site-packages (from jupyter-core!=5.0.*,>=4.12->ipykernel>=4.5.1->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (3.5.1) Requirement already satisfied: mdurl~=0.1 in /home/runner/.local/lib/python3.9/site-packages (from markdown-it-py<3.0.0,>=2.2.0->rich>=10.11.0->streamlit>=1.13.0->streamlit-folium->geoproject) (0.1.2) Requirement already satisfied: argon2-cffi in /home/runner/.local/lib/python3.9/site-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.4->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (21.3.0) Requirement already satisfied: nbformat in /home/runner/.local/lib/python3.9/site-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.4->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (5.8.0) Requirement already satisfied: nbconvert>=5 in /home/runner/.local/lib/python3.9/site-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.4->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (7.4.0) Requirement already satisfied: Send2Trash>=1.8.0 in /home/runner/.local/lib/python3.9/site-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.4->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (1.8.2) Requirement already satisfied: terminado>=0.8.3 in /home/runner/.local/lib/python3.9/site-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.4->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (0.17.1) Requirement already satisfied: prometheus-client in /home/runner/.local/lib/python3.9/site-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.4->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (0.17.0) Requirement already satisfied: nbclassic>=0.4.7 in /home/runner/.local/lib/python3.9/site-packages (from notebook>=4.4.1->widgetsnbextension~=3.6.4->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (1.0.0) Requirement already satisfied: ptyprocess>=0.5 in /home/runner/.local/lib/python3.9/site-packages (from pexpect>4.3->ipython>=4.0.0->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (0.7.0) Requirement already satisfied: wcwidth in /home/runner/.local/lib/python3.9/site-packages (from prompt-toolkit!=3.0.37,<3.1.0,>=3.0.30->ipython>=4.0.0->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (0.2.6) Requirement already satisfied: executing>=1.2.0 in /home/runner/.local/lib/python3.9/site-packages (from stack-data->ipython>=4.0.0->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (1.2.0) Requirement already satisfied: asttokens>=2.1.0 in /home/runner/.local/lib/python3.9/site-packages (from stack-data->ipython>=4.0.0->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (2.2.1) Requirement already satisfied: pure-eval in /home/runner/.local/lib/python3.9/site-packages (from stack-data->ipython>=4.0.0->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (0.2.2) Requirement already satisfied: jupyter-server>=1.8 in /home/runner/.local/lib/python3.9/site-packages (from nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.4->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (2.6.0) Requirement already satisfied: notebook-shim>=0.2.3 in /home/runner/.local/lib/python3.9/site-packages (from nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.4->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (0.2.3) Requirement already satisfied: bleach in /home/runner/.local/lib/python3.9/site-packages (from nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.4->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (6.0.0) Requirement already satisfied: defusedxml in /home/runner/.local/lib/python3.9/site-packages (from nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.4->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (0.7.1) Requirement already satisfied: jupyterlab-pygments in /home/runner/.local/lib/python3.9/site-packages (from nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.4->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (0.2.2) Requirement already satisfied: mistune<3,>=2.0.3 in /home/runner/.local/lib/python3.9/site-packages (from nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.4->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (2.0.5) Requirement already satisfied: nbclient>=0.5.0 in /home/runner/.local/lib/python3.9/site-packages (from nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.4->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (0.8.0) Requirement already satisfied: pandocfilters>=1.4.1 in /home/runner/.local/lib/python3.9/site-packages (from nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.4->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (1.5.0) Requirement already satisfied: tinycss2 in /home/runner/.local/lib/python3.9/site-packages (from nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.4->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (1.2.1) Requirement already satisfied: fastjsonschema in /home/runner/.local/lib/python3.9/site-packages (from nbformat->notebook>=4.4.1->widgetsnbextension~=3.6.4->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (2.17.1) Requirement already satisfied: argon2-cffi-bindings in /home/runner/.local/lib/python3.9/site-packages (from argon2-cffi->notebook>=4.4.1->widgetsnbextension~=3.6.4->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (21.2.0) Requirement already satisfied: jupyter-events>=0.6.0 in /home/runner/.local/lib/python3.9/site-packages (from jupyter-server>=1.8->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.4->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (0.6.3) Requirement already satisfied: jupyter-server-terminals in /home/runner/.local/lib/python3.9/site-packages (from jupyter-server>=1.8->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.4->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (0.4.4) Requirement already satisfied: overrides in /home/runner/.local/lib/python3.9/site-packages (from jupyter-server>=1.8->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.4->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (7.3.1) Requirement already satisfied: websocket-client in /home/runner/.local/lib/python3.9/site-packages (from jupyter-server>=1.8->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.4->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (1.5.2) Requirement already satisfied: cffi>=1.0.1 in /home/runner/.local/lib/python3.9/site-packages (from argon2-cffi-bindings->argon2-cffi->notebook>=4.4.1->widgetsnbextension~=3.6.4->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (1.15.1) Requirement already satisfied: webencodings in /home/runner/.local/lib/python3.9/site-packages (from bleach->nbconvert>=5->notebook>=4.4.1->widgetsnbextension~=3.6.4->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (0.5.1) Requirement already satisfied: pycparser in /home/runner/.local/lib/python3.9/site-packages (from cffi>=1.0.1->argon2-cffi-bindings->argon2-cffi->notebook>=4.4.1->widgetsnbextension~=3.6.4->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (2.21) Requirement already satisfied: python-json-logger>=2.0.4 in /home/runner/.local/lib/python3.9/site-packages (from jupyter-events>=0.6.0->jupyter-server>=1.8->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.4->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (2.0.7) Requirement already satisfied: pyyaml>=5.3 in /home/runner/.local/lib/python3.9/site-packages (from jupyter-events>=0.6.0->jupyter-server>=1.8->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.4->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (6.0) Requirement already satisfied: rfc3339-validator in /home/runner/.local/lib/python3.9/site-packages (from jupyter-events>=0.6.0->jupyter-server>=1.8->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.4->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (0.1.4) Requirement already satisfied: rfc3986-validator>=0.1.1 in /home/runner/.local/lib/python3.9/site-packages (from jupyter-events>=0.6.0->jupyter-server>=1.8->nbclassic>=0.4.7->notebook>=4.4.1->widgetsnbextension~=3.6.4->ipywidgets<9,>=7.6.0->ipyleaflet->geoproject) (0.1.1) Requirement already satisfied: fqdn in /home/runner/.local/lib/python3.9/site-packages (from jsonschema>=3.0->altair<5,>=3.2.0->streamlit>=1.13.0->streamlit-folium->geoproject) (1.5.1) Requirement already satisfied: isoduration in /home/runner/.local/lib/python3.9/site-packages (from jsonschema>=3.0->altair<5,>=3.2.0->streamlit>=1.13.0->streamlit-folium->geoproject) (20.11.0) Requirement already satisfied: jsonpointer>1.13 in /home/runner/.local/lib/python3.9/site-packages (from jsonschema>=3.0->altair<5,>=3.2.0->streamlit>=1.13.0->streamlit-folium->geoproject) (2.3) Requirement already satisfied: uri-template in /home/runner/.local/lib/python3.9/site-packages (from jsonschema>=3.0->altair<5,>=3.2.0->streamlit>=1.13.0->streamlit-folium->geoproject) (1.2.0) Requirement already satisfied: webcolors>=1.11 in /home/runner/.local/lib/python3.9/site-packages (from jsonschema>=3.0->altair<5,>=3.2.0->streamlit>=1.13.0->streamlit-folium->geoproject) (1.13) Requirement already satisfied: arrow>=0.15.0 in /home/runner/.local/lib/python3.9/site-packages (from isoduration->jsonschema>=3.0->altair<5,>=3.2.0->streamlit>=1.13.0->streamlit-folium->geoproject) (1.2.3)
In [2]:
Copied!
import geoproject
import ipywidgets as widgets
from ipyleaflet import WidgetControl
import geoproject
import ipywidgets as widgets
from ipyleaflet import WidgetControl
Creating a toolbar button¶
In [3]:
Copied!
widget_width = "250px"
padding = "0px 0px 0px 5px" # upper, right, bottom, left
toolbar_button = widgets.ToggleButton(
value=False,
tooltip="Toolbar",
icon="wrench",
layout=widgets.Layout(width="28px", height="28px", padding=padding),
)
close_button = widgets.ToggleButton(
value=False,
tooltip="Close the tool",
icon="times",
button_style="primary",
layout=widgets.Layout(height="28px", width="28px", padding=padding),
)
widget_width = "250px"
padding = "0px 0px 0px 5px" # upper, right, bottom, left
toolbar_button = widgets.ToggleButton(
value=False,
tooltip="Toolbar",
icon="wrench",
layout=widgets.Layout(width="28px", height="28px", padding=padding),
)
close_button = widgets.ToggleButton(
value=False,
tooltip="Close the tool",
icon="times",
button_style="primary",
layout=widgets.Layout(height="28px", width="28px", padding=padding),
)
In [4]:
Copied!
toolbar = widgets.HBox([toolbar_button])
toolbar
toolbar = widgets.HBox([toolbar_button])
toolbar
Adding toolbar event¶
In [5]:
Copied!
def toolbar_click(change):
if change["new"]:
toolbar.children = [toolbar_button, close_button]
else:
toolbar.children = [toolbar_button]
toolbar_button.observe(toolbar_click, "value")
def toolbar_click(change):
if change["new"]:
toolbar.children = [toolbar_button, close_button]
else:
toolbar.children = [toolbar_button]
toolbar_button.observe(toolbar_click, "value")
In [6]:
Copied!
def close_click(change):
if change["new"]:
toolbar_button.close()
close_button.close()
toolbar.close()
close_button.observe(close_click, "value")
toolbar
def close_click(change):
if change["new"]:
toolbar_button.close()
close_button.close()
toolbar.close()
close_button.observe(close_click, "value")
toolbar
Adding toolbar grid¶
In [7]:
Copied!
rows = 2
cols = 2
grid = widgets.GridspecLayout(rows, cols, grid_gap="0px", layout=widgets.Layout(width="65px"))
rows = 2
cols = 2
grid = widgets.GridspecLayout(rows, cols, grid_gap="0px", layout=widgets.Layout(width="65px"))
In [8]:
Copied!
icons = ["folder-open", "map", "info", "question"]
for i in range(rows):
for j in range(cols):
grid[i, j] = widgets.Button(description="", button_style="primary", icon=icons[i*rows+j],
layout=widgets.Layout(width="28px", padding="0px"))
grid
icons = ["folder-open", "map", "info", "question"]
for i in range(rows):
for j in range(cols):
grid[i, j] = widgets.Button(description="", button_style="primary", icon=icons[i*rows+j],
layout=widgets.Layout(width="28px", padding="0px"))
grid
In [9]:
Copied!
toolbar = widgets.VBox([toolbar_button])
toolbar = widgets.VBox([toolbar_button])
In [10]:
Copied!
def toolbar_click(change):
if change["new"]:
toolbar.children = [widgets.HBox([close_button, toolbar_button]), grid]
else:
toolbar.children = [toolbar_button]
toolbar_button.observe(toolbar_click, "value")
toolbar
def toolbar_click(change):
if change["new"]:
toolbar.children = [widgets.HBox([close_button, toolbar_button]), grid]
else:
toolbar.children = [toolbar_button]
toolbar_button.observe(toolbar_click, "value")
toolbar
Adding toolbar to ipyleaflet¶
In [11]:
Copied!
toolbar_ctrl = WidgetControl(widget=toolbar, position="topright")
toolbar_ctrl = WidgetControl(widget=toolbar, position="topright")
In [12]:
Copied!
m = geoproject.Map()
m.add_control(toolbar_ctrl)
m
m = geoproject.Map()
m.add_control(toolbar_ctrl)
m
In [13]:
Copied!
output = widgets.Output()
output_ctrl = WidgetControl(widget=output, position="bottomright")
m.add_control(output_ctrl)
output = widgets.Output()
output_ctrl = WidgetControl(widget=output, position="bottomright")
m.add_control(output_ctrl)
In [14]:
Copied!
basemap = widgets.Dropdown(
options=["OpenStreetmAP", "SATELLITE", "ROADMAP"],
value=None,
description="basemap:",
layout=widgets.Layout(width=widget_width, padding=padding),
style={"description_width": "initial"},
)
basemap_control = WidgetControl(widget=basemap,position='topright')
basemap = widgets.Dropdown(
options=["OpenStreetmAP", "SATELLITE", "ROADMAP"],
value=None,
description="basemap:",
layout=widgets.Layout(width=widget_width, padding=padding),
style={"description_width": "initial"},
)
basemap_control = WidgetControl(widget=basemap,position='topright')
In [15]:
Copied!
def change_basemap(change):
if change['new']:
m.add_basemap(basemap.value)
def change_basemap(change):
if change['new']:
m.add_basemap(basemap.value)
In [16]:
Copied!
basemap.observe(change_basemap,'value')
basemap.observe(change_basemap,'value')
In [17]:
Copied!
def tool_click(b):
with output:
output.clear_output()
print(f"You clicked the {b.icon} button")
if b.icon == "map":
m.add(basemap_control)
def tool_click(b):
with output:
output.clear_output()
print(f"You clicked the {b.icon} button")
if b.icon == "map":
m.add(basemap_control)
In [18]:
Copied!
for i in range(rows):
for j in range(cols):
tool = grid[i, j]
tool.on_click(tool_click)
for i in range(rows):
for j in range(cols):
tool = grid[i, j]
tool.on_click(tool_click)
Last update:
2023-05-25
Created: 2023-05-25
Created: 2023-05-25