Skip to content

Commit

Permalink
Added binder
Browse files Browse the repository at this point in the history
  • Loading branch information
giswqs committed Apr 5, 2022
1 parent 228b41f commit aaa70cc
Show file tree
Hide file tree
Showing 6 changed files with 347 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# geospatial

[![image](https://colab.research.google.com/assets/colab-badge.svg)](https://gishub.org/geospatial-colab)
[![image](https://mybinder.org/badge_logo.svg)](https://gishub.org/geospatial-binder)
[![image](https://img.shields.io/pypi/v/geospatial.svg)](https://pypi.python.org/pypi/geospatial)
[![image](https://pepy.tech/badge/geospatial)](https://pepy.tech/project/geospatial)
[![Conda Version](https://img.shields.io/conda/vn/conda-forge/geospatial.svg)](https://anaconda.org/conda-forge/geospatial)
Expand Down
6 changes: 6 additions & 0 deletions binder/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: geo
channels:
- conda-forge
dependencies:
- geospatial

5 changes: 4 additions & 1 deletion docs/index.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"source": [
"# Welcome to geospatial\n",
"\n",
"[![image](https://colab.research.google.com/assets/colab-badge.svg)](https://gishub.org/geospatial-colab)\n",
"[![image](https://mybinder.org/badge_logo.svg)](https://gishub.org/geospatial-binder)\n",
"[![image](https://img.shields.io/pypi/v/geospatial.svg)](https://pypi.python.org/pypi/geospatial)\n",
"[![image](https://img.shields.io/pypi/v/geospatial.svg)](https://pypi.python.org/pypi/geospatial)\n",
"[![image](https://pepy.tech/badge/geospatial)](https://pepy.tech/project/geospatial)\n",
"[![Conda Version](https://img.shields.io/conda/vn/conda-forge/geospatial.svg)](https://anaconda.org/conda-forge/geospatial)\n",
Expand Down Expand Up @@ -729,7 +732,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
Expand Down
57 changes: 57 additions & 0 deletions examples/colab.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "213db57c-a9d6-498f-b33c-216daafafa6f",
"metadata": {},
"outputs": [],
"source": [
"!pip install geospatial"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "dcb9503d-1b6f-4a7d-9ee2-c5a3e15664f0",
"metadata": {},
"outputs": [],
"source": [
"import leafmap"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "2e120f6e-4cc1-481b-a1c9-36b574c55aec",
"metadata": {},
"outputs": [],
"source": [
"m = leafmap.Map()\n",
"m.add_basemap('OpenTopoMap')\n",
"m"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.12"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
62 changes: 62 additions & 0 deletions examples/examples.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "abef7881-70c4-401f-bafa-be17fbd36710",
"metadata": {},
"outputs": [],
"source": [
"import leafmap"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "31522b98-f361-4b8b-8e48-beced7cd0187",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "2ac21d51f8274a6ebf8e217ab5ec5885",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Map(center=[20, 0], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_title', 'zoom_out_text…"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"m = leafmap.Map()\n",
"m.add_basemap('OpenTopoMap')\n",
"m"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.12"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
216 changes: 216 additions & 0 deletions examples/leafmap.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "8fdcf68b",
"metadata": {},
"source": [
"[![image](https://colab.research.google.com/assets/colab-badge.svg)](https://githubtocolab.com/giswqs/leafmap/blob/master/examples/notebooks/02_using_basemaps.ipynb)\n",
"[![image](https://mybinder.org/badge_logo.svg)](https://gishub.org/leafmap-binder)\n",
"\n",
"**Using basemaps in leafmap**\n",
"\n",
"Uncomment the following line to install [leafmap](https://leafmap.org) if needed."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "6e8418cb",
"metadata": {},
"outputs": [],
"source": [
"import leafmap"
]
},
{
"cell_type": "markdown",
"id": "7803deb4",
"metadata": {},
"source": [
"Create an interactive map."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "795c2589",
"metadata": {},
"outputs": [],
"source": [
"m = leafmap.Map()\n",
"m"
]
},
{
"cell_type": "markdown",
"id": "6a6e718e",
"metadata": {},
"source": [
"Specify a Google basemap to use, can be one of [\"ROADMAP\", \"TERRAIN\", \"SATELLITE\", \"HYBRID\"]."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "f3fb421e",
"metadata": {},
"outputs": [],
"source": [
"m = leafmap.Map(google_map=\"HYBRID\")\n",
"m"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "04972685",
"metadata": {},
"outputs": [],
"source": [
"m = leafmap.Map(google_map=\"TERRAIN\")\n",
"m"
]
},
{
"cell_type": "markdown",
"id": "18b5e064",
"metadata": {},
"source": [
"Add a basemap using the `add_basemap()` function."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "6027a7cb",
"metadata": {},
"outputs": [],
"source": [
"m = leafmap.Map()\n",
"m.add_basemap(\"HYBRID\")\n",
"m.add_basemap(\"Esri.NatGeoWorldMap\")\n",
"m"
]
},
{
"cell_type": "markdown",
"id": "1f387ba1",
"metadata": {},
"source": [
"Add an XYZ tile layer."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "6df7a1bf",
"metadata": {},
"outputs": [],
"source": [
"m = leafmap.Map()\n",
"m.add_tile_layer(\n",
" url=\"https://mt1.google.com/vt/lyrs=y&x={x}&y={y}&z={z}\",\n",
" name=\"Google Satellite\",\n",
" attribution=\"Google\",\n",
")\n",
"m"
]
},
{
"cell_type": "markdown",
"id": "6d1f1659",
"metadata": {},
"source": [
"Add a legend to the map."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "ec54a702",
"metadata": {},
"outputs": [],
"source": [
"m = leafmap.Map(google_map=\"HYBRID\")\n",
"\n",
"url1 = \"https://www.fws.gov/wetlands/arcgis/services/Wetlands/MapServer/WMSServer?\"\n",
"m.add_wms_layer(\n",
" url1, layers=\"1\", format='image/png', transparent=True, name=\"NWI Wetlands Vector\"\n",
")\n",
"\n",
"url2 = \"https://www.fws.gov/wetlands/arcgis/services/Wetlands_Raster/ImageServer/WMSServer?\"\n",
"m.add_wms_layer(\n",
" url2, layers=\"0\", format='image/png', transparent=True, name=\"NWI Wetlands Raster\"\n",
")\n",
"\n",
"m.add_legend(builtin_legend=\"NWI\")\n",
"m"
]
}
],
"metadata": {
"hide_input": false,
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.12"
},
"toc": {
"base_numbering": 1,
"nav_menu": {},
"number_sections": true,
"sideBar": true,
"skip_h1_title": false,
"title_cell": "Table of Contents",
"title_sidebar": "Contents",
"toc_cell": false,
"toc_position": {},
"toc_section_display": true,
"toc_window_display": false
},
"varInspector": {
"cols": {
"lenName": 16,
"lenType": 16,
"lenVar": 40
},
"kernels_config": {
"python": {
"delete_cmd_postfix": "",
"delete_cmd_prefix": "del ",
"library": "var_list.py",
"varRefreshCmd": "print(var_dic_list())"
},
"r": {
"delete_cmd_postfix": ") ",
"delete_cmd_prefix": "rm(",
"library": "var_list.r",
"varRefreshCmd": "cat(var_dic_list()) "
}
},
"types_to_exclude": [
"module",
"function",
"builtin_function_or_method",
"instance",
"_Feature"
],
"window_display": false
}
},
"nbformat": 4,
"nbformat_minor": 5
}

0 comments on commit aaa70cc

Please sign in to comment.