Skip to content

Commit

Permalink
Add discord link (#870)
Browse files Browse the repository at this point in the history
* Add discord link

* Remove overture example

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Remove overture example

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
giswqs and pre-commit-ci[bot] authored Aug 15, 2024
1 parent 0e99b9c commit 726cb15
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 361 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
- Leafmap tutorials on YouTube: <https://youtube.com/@giswqs>
- Free software: [MIT license](https://opensource.org/licenses/MIT)

Join our Discord server 👇

[![](https://dcbadge.limes.pink/api/server/https://discord.gg/UgZecTUq5P)](https://discord.gg/UgZecTUq5P)

## Introduction

**Leafmap** is a Python package for interactive mapping and geospatial analysis with minimal coding in a Jupyter environment. It is a spin-off project of the [geemap](https://geemap.org) Python package, which was designed specifically to work with [Google Earth Engine](https://earthengine.google.com) (GEE). However, not everyone in the geospatial community has access to the GEE cloud computing platform. Leafmap is designed to fill this gap for non-GEE users. It is a free and open-source Python package that enables users to analyze and visualize geospatial data with minimal coding in a Jupyter environment, such as Google Colab, Jupyter Notebook, and JupyterLab. Leafmap is built upon several open-source packages, such as [folium](https://github.com/python-visualization/folium) and [ipyleaflet](https://github.com/jupyter-widgets/ipyleaflet) (for creating interactive maps), [WhiteboxTools](https://github.com/jblindsay/whitebox-tools) and [whiteboxgui](https://github.com/opengeos/whiteboxgui) (for analyzing geospatial data), and [ipywidgets](https://github.com/jupyter-widgets/ipywidgets) (for designing interactive graphical user interface [GUI]). Leafmap has a toolset with various interactive tools that allow users to load vector and raster data onto the map without coding. In addition, users can use the powerful analytical backend (i.e., WhiteboxTools) to perform geospatial analysis directly within the leafmap user interface without writing a single line of code. The WhiteboxTools library currently contains **500+** tools for advanced geospatial analysis, such as [GIS Analysis](https://jblindsay.github.io/wbt_book/available_tools/gis_analysis.html), [Geomorphometric Analysis](https://jblindsay.github.io/wbt_book/available_tools/geomorphometric_analysis.html), [Hydrological Analysis](https://jblindsay.github.io/wbt_book/available_tools/hydrological_analysis.html), [LiDAR Data Analysis](https://jblindsay.github.io/wbt_book/available_tools/lidar_tools.html), [Mathematical and Statistical Analysis](https://jblindsay.github.io/wbt_book/available_tools/mathand_stats_tools.html), and [Stream Network Analysis](https://jblindsay.github.io/wbt_book/available_tools/stream_network_analysis.html).
Expand Down
4 changes: 4 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
- Leafmap tutorials on YouTube: <https://youtube.com/@giswqs>
- Free software: [MIT license](https://opensource.org/licenses/MIT)

Join our Discord server 👇

[![](https://dcbadge.limes.pink/api/server/https://discord.gg/UgZecTUq5P)](https://discord.gg/UgZecTUq5P)

## Introduction

**Leafmap** is a Python package for interactive mapping and geospatial analysis with minimal coding in a Jupyter environment. It is a spin-off project of the [geemap](https://geemap.org) Python package, which was designed specifically to work with [Google Earth Engine](https://earthengine.google.com) (GEE). However, not everyone in the geospatial community has access to the GEE cloud computing platform. Leafmap is designed to fill this gap for non-GEE users. It is a free and open-source Python package that enables users to analyze and visualize geospatial data with minimal coding in a Jupyter environment, such as Google Colab, Jupyter Notebook, and JupyterLab. Leafmap is built upon several open-source packages, such as [folium](https://github.com/python-visualization/folium) and [ipyleaflet](https://github.com/jupyter-widgets/ipyleaflet) (for creating interactive maps), [WhiteboxTools](https://github.com/jblindsay/whitebox-tools) and [whiteboxgui](https://github.com/opengeos/whiteboxgui) (for analyzing geospatial data), and [ipywidgets](https://github.com/jupyter-widgets/ipywidgets) (for designing interactive graphical user interfaces [GUIs]). Leafmap has a toolset with various interactive tools that allow users to load vector and raster data onto the map without coding. In addition, users can use the powerful analytical backend (i.e., WhiteboxTools) to perform geospatial analysis directly within the leafmap user interface without writing a single line of code. The WhiteboxTools library currently contains **500+** tools for advanced geospatial analysis, such as [GIS Analysis](https://jblindsay.github.io/wbt_book/available_tools/gis_analysis.html), [Geomorphometric Analysis](https://jblindsay.github.io/wbt_book/available_tools/geomorphometric_analysis.html), [Hydrological Analysis](https://jblindsay.github.io/wbt_book/available_tools/hydrological_analysis.html), [LiDAR Data Analysis](https://jblindsay.github.io/wbt_book/available_tools/lidar_tools.html), [Mathematical and Statistical Analysis](https://jblindsay.github.io/wbt_book/available_tools/mathand_stats_tools.html), and [Stream Network Analysis](https://jblindsay.github.io/wbt_book/available_tools/stream_network_analysis.html).
Expand Down
142 changes: 16 additions & 126 deletions docs/maplibre/pmtiles.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -129,116 +129,6 @@
"cell_type": "markdown",
"id": "8",
"metadata": {},
"source": [
"### Overture data"
]
},
{
"cell_type": "markdown",
"id": "9",
"metadata": {},
"source": [
"You can also visualize Overture data. Inspired by [overture-maps](https://github.com/tebben/overture-maps)."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "10",
"metadata": {},
"outputs": [],
"source": [
"url = \"https://storage.googleapis.com/ahp-research/overture/pmtiles/overture.pmtiles\"\n",
"metadata = leafmap.pmtiles_metadata(url)\n",
"print(f\"layer names: {metadata['layer_names']}\")\n",
"print(f\"bounds: {metadata['bounds']}\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "11",
"metadata": {},
"outputs": [],
"source": [
"m = leafmap.Map(height=\"800px\")\n",
"m.add_basemap(\"Esri.WorldImagery\")\n",
"\n",
"style = {\n",
" \"version\": 8,\n",
" \"sources\": {\n",
" \"example_source\": {\n",
" \"type\": \"vector\",\n",
" \"url\": \"pmtiles://\" + url,\n",
" \"attribution\": \"PMTiles\",\n",
" }\n",
" },\n",
" \"layers\": [\n",
" # {\n",
" # \"id\": \"admins\",\n",
" # \"source\": \"example_source\",\n",
" # \"source-layer\": \"admins\",\n",
" # \"type\": \"fill\",\n",
" # \"paint\": {\"fill-color\": \"#BDD3C7\", \"fill-opacity\": 0.1},\n",
" # },\n",
" {\n",
" \"id\": \"buildings\",\n",
" \"source\": \"example_source\",\n",
" \"source-layer\": \"buildings\",\n",
" \"type\": \"fill\",\n",
" \"paint\": {\"fill-color\": \"#FFFFB3\", \"fill-opacity\": 0.5},\n",
" },\n",
" {\n",
" \"id\": \"places\",\n",
" \"source\": \"example_source\",\n",
" \"source-layer\": \"places\",\n",
" \"type\": \"fill\",\n",
" \"paint\": {\"fill-color\": \"#BEBADA\", \"fill-opacity\": 0.5},\n",
" },\n",
" {\n",
" \"id\": \"roads\",\n",
" \"source\": \"example_source\",\n",
" \"source-layer\": \"roads\",\n",
" \"type\": \"line\",\n",
" \"paint\": {\"line-color\": \"#FB8072\"},\n",
" },\n",
" ],\n",
"}\n",
"\n",
"# style = leafmap.pmtiles_style(url) # Use default style\n",
"\n",
"m.add_pmtiles(\n",
" url,\n",
" style=style,\n",
" visible=True,\n",
" opacity=1.0,\n",
" tooltip=True,\n",
")\n",
"m"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "12",
"metadata": {},
"outputs": [],
"source": [
"m.layer_interact()"
]
},
{
"cell_type": "markdown",
"id": "13",
"metadata": {},
"source": [
"![](https://i.imgur.com/ZOEbFGh.jpeg)"
]
},
{
"cell_type": "markdown",
"id": "14",
"metadata": {},
"source": [
"### Source Cooperative\n",
"\n",
Expand All @@ -248,7 +138,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "15",
"id": "9",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -261,7 +151,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "16",
"id": "10",
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -303,7 +193,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "17",
"id": "11",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -312,15 +202,15 @@
},
{
"cell_type": "markdown",
"id": "18",
"id": "12",
"metadata": {},
"source": [
"![](https://i.imgur.com/rH0iLgc.png)"
]
},
{
"cell_type": "markdown",
"id": "19",
"id": "13",
"metadata": {},
"source": [
"## Local PMTiles\n",
Expand All @@ -333,7 +223,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "20",
"id": "14",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -343,7 +233,7 @@
},
{
"cell_type": "markdown",
"id": "21",
"id": "15",
"metadata": {},
"source": [
"Convert vector to PMTiles."
Expand All @@ -352,7 +242,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "22",
"id": "16",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -364,7 +254,7 @@
},
{
"cell_type": "markdown",
"id": "23",
"id": "17",
"metadata": {},
"source": [
"Start a HTTP Sever"
Expand All @@ -373,7 +263,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "24",
"id": "18",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -383,7 +273,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "25",
"id": "19",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -393,7 +283,7 @@
},
{
"cell_type": "markdown",
"id": "26",
"id": "20",
"metadata": {},
"source": [
"Display the PMTiles on the map."
Expand All @@ -402,7 +292,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "27",
"id": "21",
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -443,7 +333,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "28",
"id": "22",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -452,7 +342,7 @@
},
{
"cell_type": "markdown",
"id": "29",
"id": "23",
"metadata": {},
"source": [
"![](https://i.imgur.com/PnYhph1.jpeg)"
Expand All @@ -475,7 +365,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.8"
"version": "3.11.9"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 726cb15

Please sign in to comment.