Spaces:
Running
Running
Add apps
Browse files- .gitignore +130 -0
- Dockerfile +25 -0
- README.md +1 -0
- notebooks/bqplot.ipynb +135 -0
- notebooks/leafmap.ipynb +242 -0
- requirements.txt +4 -0
- run.sh +1 -0
.gitignore
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Byte-compiled / optimized / DLL files
|
| 2 |
+
__pycache__/
|
| 3 |
+
*.py[cod]
|
| 4 |
+
*$py.class
|
| 5 |
+
|
| 6 |
+
# C extensions
|
| 7 |
+
*.so
|
| 8 |
+
Aptfile
|
| 9 |
+
|
| 10 |
+
# Distribution / packaging
|
| 11 |
+
.Python
|
| 12 |
+
build/
|
| 13 |
+
develop-eggs/
|
| 14 |
+
dist/
|
| 15 |
+
downloads/
|
| 16 |
+
eggs/
|
| 17 |
+
.eggs/
|
| 18 |
+
lib/
|
| 19 |
+
lib64/
|
| 20 |
+
parts/
|
| 21 |
+
sdist/
|
| 22 |
+
var/
|
| 23 |
+
wheels/
|
| 24 |
+
pip-wheel-metadata/
|
| 25 |
+
share/python-wheels/
|
| 26 |
+
*.egg-info/
|
| 27 |
+
.installed.cfg
|
| 28 |
+
*.egg
|
| 29 |
+
MANIFEST
|
| 30 |
+
|
| 31 |
+
# PyInstaller
|
| 32 |
+
# Usually these files are written by a python script from a template
|
| 33 |
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
| 34 |
+
*.manifest
|
| 35 |
+
*.spec
|
| 36 |
+
|
| 37 |
+
# Installer logs
|
| 38 |
+
pip-log.txt
|
| 39 |
+
pip-delete-this-directory.txt
|
| 40 |
+
|
| 41 |
+
# Unit test / coverage reports
|
| 42 |
+
htmlcov/
|
| 43 |
+
.tox/
|
| 44 |
+
.nox/
|
| 45 |
+
.coverage
|
| 46 |
+
.coverage.*
|
| 47 |
+
.cache
|
| 48 |
+
nosetests.xml
|
| 49 |
+
coverage.xml
|
| 50 |
+
*.cover
|
| 51 |
+
*.py,cover
|
| 52 |
+
.hypothesis/
|
| 53 |
+
.pytest_cache/
|
| 54 |
+
|
| 55 |
+
# Translations
|
| 56 |
+
*.mo
|
| 57 |
+
*.pot
|
| 58 |
+
|
| 59 |
+
# Django stuff:
|
| 60 |
+
*.log
|
| 61 |
+
local_settings.py
|
| 62 |
+
db.sqlite3
|
| 63 |
+
db.sqlite3-journal
|
| 64 |
+
|
| 65 |
+
# Flask stuff:
|
| 66 |
+
instance/
|
| 67 |
+
.webassets-cache
|
| 68 |
+
|
| 69 |
+
# Scrapy stuff:
|
| 70 |
+
.scrapy
|
| 71 |
+
|
| 72 |
+
# Sphinx documentation
|
| 73 |
+
docs/_build/
|
| 74 |
+
|
| 75 |
+
# PyBuilder
|
| 76 |
+
target/
|
| 77 |
+
|
| 78 |
+
# Jupyter Notebook
|
| 79 |
+
.ipynb_checkpoints
|
| 80 |
+
|
| 81 |
+
# IPython
|
| 82 |
+
profile_default/
|
| 83 |
+
ipython_config.py
|
| 84 |
+
|
| 85 |
+
# pyenv
|
| 86 |
+
.python-version
|
| 87 |
+
|
| 88 |
+
# pipenv
|
| 89 |
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
| 90 |
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
| 91 |
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
| 92 |
+
# install all needed dependencies.
|
| 93 |
+
#Pipfile.lock
|
| 94 |
+
|
| 95 |
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
|
| 96 |
+
__pypackages__/
|
| 97 |
+
|
| 98 |
+
# Celery stuff
|
| 99 |
+
celerybeat-schedule
|
| 100 |
+
celerybeat.pid
|
| 101 |
+
|
| 102 |
+
# SageMath parsed files
|
| 103 |
+
*.sage.py
|
| 104 |
+
|
| 105 |
+
# Environments
|
| 106 |
+
.env
|
| 107 |
+
.venv
|
| 108 |
+
env/
|
| 109 |
+
venv/
|
| 110 |
+
ENV/
|
| 111 |
+
env.bak/
|
| 112 |
+
venv.bak/
|
| 113 |
+
|
| 114 |
+
# Spyder project settings
|
| 115 |
+
.spyderproject
|
| 116 |
+
.spyproject
|
| 117 |
+
|
| 118 |
+
# Rope project settings
|
| 119 |
+
.ropeproject
|
| 120 |
+
|
| 121 |
+
# mkdocs documentation
|
| 122 |
+
/site
|
| 123 |
+
|
| 124 |
+
# mypy
|
| 125 |
+
.mypy_cache/
|
| 126 |
+
.dmypy.json
|
| 127 |
+
dmypy.json
|
| 128 |
+
|
| 129 |
+
# Pyre type checker
|
| 130 |
+
.pyre/
|
Dockerfile
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM jupyter/base-notebook:latest
|
| 2 |
+
|
| 3 |
+
RUN mamba install -c conda-forge leafmap geemap geopandas localtileserver voila nodejs -y && \
|
| 4 |
+
fix-permissions "${CONDA_DIR}" && \
|
| 5 |
+
fix-permissions "/home/${NB_USER}"
|
| 6 |
+
|
| 7 |
+
# COPY requirements.txt .
|
| 8 |
+
# RUN pip install --no-cache-dir -r requirements.txt
|
| 9 |
+
|
| 10 |
+
RUN mkdir ./notebooks
|
| 11 |
+
COPY /notebooks ./notebooks
|
| 12 |
+
|
| 13 |
+
COPY run.sh .
|
| 14 |
+
|
| 15 |
+
ENV PROJ_LIB='/opt/conda/share/proj'
|
| 16 |
+
|
| 17 |
+
USER root
|
| 18 |
+
RUN chown -R ${NB_UID} ${HOME}
|
| 19 |
+
USER ${NB_USER}
|
| 20 |
+
|
| 21 |
+
RUN jupyter nbextension enable --py --sys-prefix widgetsnbextension
|
| 22 |
+
|
| 23 |
+
EXPOSE 8866
|
| 24 |
+
|
| 25 |
+
CMD ["/bin/bash", "run.sh"]
|
README.md
CHANGED
|
@@ -6,6 +6,7 @@ colorTo: indigo
|
|
| 6 |
sdk: docker
|
| 7 |
pinned: false
|
| 8 |
license: mit
|
|
|
|
| 9 |
---
|
| 10 |
|
| 11 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 6 |
sdk: docker
|
| 7 |
pinned: false
|
| 8 |
license: mit
|
| 9 |
+
app_port: 8866
|
| 10 |
---
|
| 11 |
|
| 12 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces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10 |
+
"import ipywidgets as widgets\n",
|
| 11 |
+
"import numpy as np"
|
| 12 |
+
]
|
| 13 |
+
},
|
| 14 |
+
{
|
| 15 |
+
"cell_type": "code",
|
| 16 |
+
"execution_count": null,
|
| 17 |
+
"metadata": {},
|
| 18 |
+
"outputs": [],
|
| 19 |
+
"source": [
|
| 20 |
+
"# generate some fake \n",
|
| 21 |
+
"n = 2000\n",
|
| 22 |
+
"x = np.linspace(0.0, 10.0, n)\n",
|
| 23 |
+
"np.random.seed(0)\n",
|
| 24 |
+
"y = np.cumsum(np.random.randn(n)*10).astype(int)"
|
| 25 |
+
]
|
| 26 |
+
},
|
| 27 |
+
{
|
| 28 |
+
"cell_type": "code",
|
| 29 |
+
"execution_count": null,
|
| 30 |
+
"metadata": {},
|
| 31 |
+
"outputs": [],
|
| 32 |
+
"source": [
|
| 33 |
+
"fig_hist = plt.figure( title='Histogram')\n",
|
| 34 |
+
"hist = plt.hist(y, bins=25)"
|
| 35 |
+
]
|
| 36 |
+
},
|
| 37 |
+
{
|
| 38 |
+
"cell_type": "code",
|
| 39 |
+
"execution_count": null,
|
| 40 |
+
"metadata": {},
|
| 41 |
+
"outputs": [],
|
| 42 |
+
"source": [
|
| 43 |
+
"hist.bins = 10;"
|
| 44 |
+
]
|
| 45 |
+
},
|
| 46 |
+
{
|
| 47 |
+
"cell_type": "code",
|
| 48 |
+
"execution_count": null,
|
| 49 |
+
"metadata": {},
|
| 50 |
+
"outputs": [],
|
| 51 |
+
"source": [
|
| 52 |
+
"slider = widgets.IntSlider(description='Bins number', min=1, max=100, v_model=30)"
|
| 53 |
+
]
|
| 54 |
+
},
|
| 55 |
+
{
|
| 56 |
+
"cell_type": "code",
|
| 57 |
+
"execution_count": null,
|
| 58 |
+
"metadata": {
|
| 59 |
+
"scrolled": false
|
| 60 |
+
},
|
| 61 |
+
"outputs": [],
|
| 62 |
+
"source": [
|
| 63 |
+
"widgets.link((hist, 'bins'), (slider, 'value'))\n",
|
| 64 |
+
"\n",
|
| 65 |
+
"fig_lines = plt.figure( title='Line Chart')\n",
|
| 66 |
+
"lines = plt.plot(x, y)\n",
|
| 67 |
+
"\n",
|
| 68 |
+
"fig_lines.layout.width = 'auto'\n",
|
| 69 |
+
"fig_lines.layout.height = 'auto'\n",
|
| 70 |
+
"fig_hist.layout.width = 'auto'\n",
|
| 71 |
+
"fig_hist.layout.height = 'auto'\n",
|
| 72 |
+
"\n",
|
| 73 |
+
"grid_layout = widgets.GridspecLayout(5, 3)\n",
|
| 74 |
+
"\n",
|
| 75 |
+
"grid_layout[:2, :] = fig_lines\n",
|
| 76 |
+
"grid_layout[2:4, :] = fig_hist\n",
|
| 77 |
+
"grid_layout[4, 1] = slider\n",
|
| 78 |
+
"\n",
|
| 79 |
+
"grid_layout.layout.height = '1000px'\n",
|
| 80 |
+
"\n",
|
| 81 |
+
"grid_layout"
|
| 82 |
+
]
|
| 83 |
+
},
|
| 84 |
+
{
|
| 85 |
+
"cell_type": "code",
|
| 86 |
+
"execution_count": null,
|
| 87 |
+
"metadata": {},
|
| 88 |
+
"outputs": [],
|
| 89 |
+
"source": [
|
| 90 |
+
"selector = plt.brush_int_selector()\n",
|
| 91 |
+
"def update_range(*ignore):\n",
|
| 92 |
+
" if selector.selected is not None and len(selector.selected) == 2:\n",
|
| 93 |
+
" xmin, xmax = selector.selected\n",
|
| 94 |
+
" mask = (x > xmin) & (x < xmax)\n",
|
| 95 |
+
" hist.sample = y[mask]\n",
|
| 96 |
+
"selector.observe(update_range, 'selected') "
|
| 97 |
+
]
|
| 98 |
+
},
|
| 99 |
+
{
|
| 100 |
+
"cell_type": "code",
|
| 101 |
+
"execution_count": null,
|
| 102 |
+
"metadata": {},
|
| 103 |
+
"outputs": [],
|
| 104 |
+
"source": []
|
| 105 |
+
}
|
| 106 |
+
],
|
| 107 |
+
"metadata": {
|
| 108 |
+
"kernelspec": {
|
| 109 |
+
"display_name": "Python 3",
|
| 110 |
+
"language": "python",
|
| 111 |
+
"name": "python3"
|
| 112 |
+
},
|
| 113 |
+
"language_info": {
|
| 114 |
+
"codemirror_mode": {
|
| 115 |
+
"name": "ipython",
|
| 116 |
+
"version": 3
|
| 117 |
+
},
|
| 118 |
+
"file_extension": ".py",
|
| 119 |
+
"mimetype": "text/x-python",
|
| 120 |
+
"name": "python",
|
| 121 |
+
"nbconvert_exporter": "python",
|
| 122 |
+
"pygments_lexer": "ipython3",
|
| 123 |
+
"version": "3.7.3"
|
| 124 |
+
},
|
| 125 |
+
"widgets": {
|
| 126 |
+
"application/vnd.jupyter.widget-state+json": {
|
| 127 |
+
"state": {},
|
| 128 |
+
"version_major": 2,
|
| 129 |
+
"version_minor": 0
|
| 130 |
+
}
|
| 131 |
+
}
|
| 132 |
+
},
|
| 133 |
+
"nbformat": 4,
|
| 134 |
+
"nbformat_minor": 4
|
| 135 |
+
}
|
notebooks/leafmap.ipynb
ADDED
|
@@ -0,0 +1,242 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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ab/index.html?path=notebooks/02_using_basemaps.ipynb)\n",
|
| 8 |
+
"[](https://studiolab.sagemaker.aws/import/github/opengeos/leafmap/blob/master/examples/notebooks/02_using_basemaps.ipynb)\n",
|
| 9 |
+
"[](https://pccompute.westeurope.cloudapp.azure.com/compute/hub/user-redirect/git-pull?repo=https://github.com/opengeos/leafmap&urlpath=lab/tree/leafmap/examples/notebooks/02_using_basemaps.ipynb&branch=master)\n",
|
| 10 |
+
"[](https://githubtocolab.com/opengeos/leafmap/blob/master/examples/notebooks/02_using_basemaps.ipynb)\n",
|
| 11 |
+
"[](https://gishub.org/leafmap-binder)\n",
|
| 12 |
+
"\n",
|
| 13 |
+
"**Using basemaps in leafmap**\n",
|
| 14 |
+
"\n",
|
| 15 |
+
"Uncomment the following line to install [leafmap](https://leafmap.org) if needed."
|
| 16 |
+
]
|
| 17 |
+
},
|
| 18 |
+
{
|
| 19 |
+
"cell_type": "code",
|
| 20 |
+
"execution_count": null,
|
| 21 |
+
"metadata": {},
|
| 22 |
+
"outputs": [],
|
| 23 |
+
"source": [
|
| 24 |
+
"# !pip install leafmap"
|
| 25 |
+
]
|
| 26 |
+
},
|
| 27 |
+
{
|
| 28 |
+
"cell_type": "code",
|
| 29 |
+
"execution_count": null,
|
| 30 |
+
"metadata": {},
|
| 31 |
+
"outputs": [],
|
| 32 |
+
"source": [
|
| 33 |
+
"import leafmap"
|
| 34 |
+
]
|
| 35 |
+
},
|
| 36 |
+
{
|
| 37 |
+
"cell_type": "markdown",
|
| 38 |
+
"metadata": {},
|
| 39 |
+
"source": [
|
| 40 |
+
"Create an interactive map."
|
| 41 |
+
]
|
| 42 |
+
},
|
| 43 |
+
{
|
| 44 |
+
"cell_type": "code",
|
| 45 |
+
"execution_count": null,
|
| 46 |
+
"metadata": {},
|
| 47 |
+
"outputs": [],
|
| 48 |
+
"source": [
|
| 49 |
+
"m = leafmap.Map()\n",
|
| 50 |
+
"m"
|
| 51 |
+
]
|
| 52 |
+
},
|
| 53 |
+
{
|
| 54 |
+
"cell_type": "markdown",
|
| 55 |
+
"metadata": {},
|
| 56 |
+
"source": [
|
| 57 |
+
"Specify a Google basemap to use, can be one of [\"ROADMAP\", \"TERRAIN\", \"SATELLITE\", \"HYBRID\"]."
|
| 58 |
+
]
|
| 59 |
+
},
|
| 60 |
+
{
|
| 61 |
+
"cell_type": "code",
|
| 62 |
+
"execution_count": null,
|
| 63 |
+
"metadata": {},
|
| 64 |
+
"outputs": [],
|
| 65 |
+
"source": [
|
| 66 |
+
"m = leafmap.Map(google_map=\"HYBRID\")\n",
|
| 67 |
+
"m"
|
| 68 |
+
]
|
| 69 |
+
},
|
| 70 |
+
{
|
| 71 |
+
"cell_type": "code",
|
| 72 |
+
"execution_count": null,
|
| 73 |
+
"metadata": {},
|
| 74 |
+
"outputs": [],
|
| 75 |
+
"source": [
|
| 76 |
+
"m = leafmap.Map(google_map=\"TERRAIN\")\n",
|
| 77 |
+
"m"
|
| 78 |
+
]
|
| 79 |
+
},
|
| 80 |
+
{
|
| 81 |
+
"cell_type": "markdown",
|
| 82 |
+
"metadata": {},
|
| 83 |
+
"source": [
|
| 84 |
+
"Add a basemap using the `add_basemap()` function."
|
| 85 |
+
]
|
| 86 |
+
},
|
| 87 |
+
{
|
| 88 |
+
"cell_type": "code",
|
| 89 |
+
"execution_count": null,
|
| 90 |
+
"metadata": {},
|
| 91 |
+
"outputs": [],
|
| 92 |
+
"source": [
|
| 93 |
+
"m = leafmap.Map()\n",
|
| 94 |
+
"m.add_basemap(\"HYBRID\")\n",
|
| 95 |
+
"m.add_basemap(\"Esri.NatGeoWorldMap\")\n",
|
| 96 |
+
"m"
|
| 97 |
+
]
|
| 98 |
+
},
|
| 99 |
+
{
|
| 100 |
+
"cell_type": "markdown",
|
| 101 |
+
"metadata": {},
|
| 102 |
+
"source": [
|
| 103 |
+
"Add an XYZ tile layer."
|
| 104 |
+
]
|
| 105 |
+
},
|
| 106 |
+
{
|
| 107 |
+
"cell_type": "code",
|
| 108 |
+
"execution_count": null,
|
| 109 |
+
"metadata": {},
|
| 110 |
+
"outputs": [],
|
| 111 |
+
"source": [
|
| 112 |
+
"m = leafmap.Map()\n",
|
| 113 |
+
"m.add_tile_layer(\n",
|
| 114 |
+
" url=\"https://mt1.google.com/vt/lyrs=y&x={x}&y={y}&z={z}\",\n",
|
| 115 |
+
" name=\"Google Satellite\",\n",
|
| 116 |
+
" attribution=\"Google\",\n",
|
| 117 |
+
")\n",
|
| 118 |
+
"m"
|
| 119 |
+
]
|
| 120 |
+
},
|
| 121 |
+
{
|
| 122 |
+
"cell_type": "markdown",
|
| 123 |
+
"metadata": {},
|
| 124 |
+
"source": [
|
| 125 |
+
"Add a WMS tile layer."
|
| 126 |
+
]
|
| 127 |
+
},
|
| 128 |
+
{
|
| 129 |
+
"cell_type": "code",
|
| 130 |
+
"execution_count": null,
|
| 131 |
+
"metadata": {},
|
| 132 |
+
"outputs": [],
|
| 133 |
+
"source": [
|
| 134 |
+
"m = leafmap.Map()\n",
|
| 135 |
+
"naip_url = 'https://services.nationalmap.gov/arcgis/services/USGSNAIPImagery/ImageServer/WMSServer?'\n",
|
| 136 |
+
"m.add_wms_layer(\n",
|
| 137 |
+
" url=naip_url, layers='0', name='NAIP Imagery', format='image/png', shown=True\n",
|
| 138 |
+
")\n",
|
| 139 |
+
"m"
|
| 140 |
+
]
|
| 141 |
+
},
|
| 142 |
+
{
|
| 143 |
+
"cell_type": "markdown",
|
| 144 |
+
"metadata": {},
|
| 145 |
+
"source": [
|
| 146 |
+
"Add a legend to the map."
|
| 147 |
+
]
|
| 148 |
+
},
|
| 149 |
+
{
|
| 150 |
+
"cell_type": "code",
|
| 151 |
+
"execution_count": null,
|
| 152 |
+
"metadata": {},
|
| 153 |
+
"outputs": [],
|
| 154 |
+
"source": [
|
| 155 |
+
"m = leafmap.Map(google_map=\"HYBRID\")\n",
|
| 156 |
+
"\n",
|
| 157 |
+
"url1 = \"https://www.fws.gov/wetlands/arcgis/services/Wetlands/MapServer/WMSServer?\"\n",
|
| 158 |
+
"m.add_wms_layer(\n",
|
| 159 |
+
" url1, layers=\"1\", format='image/png', transparent=True, name=\"NWI Wetlands Vector\"\n",
|
| 160 |
+
")\n",
|
| 161 |
+
"\n",
|
| 162 |
+
"url2 = \"https://www.fws.gov/wetlands/arcgis/services/Wetlands_Raster/ImageServer/WMSServer?\"\n",
|
| 163 |
+
"m.add_wms_layer(\n",
|
| 164 |
+
" url2, layers=\"0\", format='image/png', transparent=True, name=\"NWI Wetlands Raster\"\n",
|
| 165 |
+
")\n",
|
| 166 |
+
"\n",
|
| 167 |
+
"m.add_legend(builtin_legend=\"NWI\")\n",
|
| 168 |
+
"m"
|
| 169 |
+
]
|
| 170 |
+
},
|
| 171 |
+
{
|
| 172 |
+
"cell_type": "markdown",
|
| 173 |
+
"metadata": {},
|
| 174 |
+
"source": [
|
| 175 |
+
"Add a layer from [xyzservices](https://github.com/geopandas/xyzservices) provider object"
|
| 176 |
+
]
|
| 177 |
+
},
|
| 178 |
+
{
|
| 179 |
+
"cell_type": "code",
|
| 180 |
+
"execution_count": null,
|
| 181 |
+
"metadata": {},
|
| 182 |
+
"outputs": [],
|
| 183 |
+
"source": [
|
| 184 |
+
"import os\n",
|
| 185 |
+
"import xyzservices.providers as xyz"
|
| 186 |
+
]
|
| 187 |
+
},
|
| 188 |
+
{
|
| 189 |
+
"cell_type": "code",
|
| 190 |
+
"execution_count": null,
|
| 191 |
+
"metadata": {},
|
| 192 |
+
"outputs": [],
|
| 193 |
+
"source": [
|
| 194 |
+
"basemap = xyz.HEREv3.basicMap\n",
|
| 195 |
+
"basemap"
|
| 196 |
+
]
|
| 197 |
+
},
|
| 198 |
+
{
|
| 199 |
+
"cell_type": "markdown",
|
| 200 |
+
"metadata": {},
|
| 201 |
+
"source": [
|
| 202 |
+
"Pass the api key to the xyzservices provider object or set it as an environment variable."
|
| 203 |
+
]
|
| 204 |
+
},
|
| 205 |
+
{
|
| 206 |
+
"cell_type": "code",
|
| 207 |
+
"execution_count": null,
|
| 208 |
+
"metadata": {},
|
| 209 |
+
"outputs": [],
|
| 210 |
+
"source": [
|
| 211 |
+
"basemap['apiKey'] = os.environ[\"HEREMAPS_API_KEY\"]"
|
| 212 |
+
]
|
| 213 |
+
},
|
| 214 |
+
{
|
| 215 |
+
"cell_type": "markdown",
|
| 216 |
+
"metadata": {},
|
| 217 |
+
"source": [
|
| 218 |
+
"Add the xyzservices provider object as a layer to the map."
|
| 219 |
+
]
|
| 220 |
+
},
|
| 221 |
+
{
|
| 222 |
+
"cell_type": "code",
|
| 223 |
+
"execution_count": null,
|
| 224 |
+
"metadata": {},
|
| 225 |
+
"outputs": [],
|
| 226 |
+
"source": [
|
| 227 |
+
"m = leafmap.Map()\n",
|
| 228 |
+
"m.add_basemap(basemap)\n",
|
| 229 |
+
"m"
|
| 230 |
+
]
|
| 231 |
+
}
|
| 232 |
+
],
|
| 233 |
+
"metadata": {
|
| 234 |
+
"kernelspec": {
|
| 235 |
+
"display_name": "Python 3",
|
| 236 |
+
"language": "python",
|
| 237 |
+
"name": "python3"
|
| 238 |
+
}
|
| 239 |
+
},
|
| 240 |
+
"nbformat": 4,
|
| 241 |
+
"nbformat_minor": 5
|
| 242 |
+
}
|
requirements.txt
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
voila
|
| 2 |
+
geemap
|
| 3 |
+
leafmap
|
| 4 |
+
|
run.sh
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
voila --Voila.ip=0.0.0.0 --no-browser --strip_sources=False --enable_nbextensions=True --MappingKernelManager.cull_interval=60 --MappingKernelManager.cull_idle_timeout=120 --NotebookClient.iopub_timeout=30 notebooks/
|