Leafmap

Leafmap: A Python package for interactive mapping and geospatial analysis with minimal coding in a Jupyter environment - Published in JOSS (2021)

https://github.com/opengeos/leafmap

Science Score: 77.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 5 DOI reference(s) in README
  • Academic publication links
    Links to: joss.theoj.org
  • Committers with academic emails
    2 of 41 committers (4.9%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.7%) to scientific vocabulary

Keywords

data-science dataviz folium geoparquet geopython geospatial geospatial-analysis gis ipyleaflet jupyter jupyter-notebook leafmap mapping plotly python solara streamlit streamlit-webapp whiteboxtools

Keywords from Contributors

ipywidgets earthengine colab mesh hydrological segment-anything exoplanet energy-system cryptocurrencies spacy

Scientific Fields

Political Science Social Sciences - 100% confidence
Earth and Environmental Sciences Physical Sciences - 84% confidence
Engineering Computer Science - 60% confidence
Last synced: 4 months ago · JSON representation ·

Repository

A Python package for interactive mapping and geospatial analysis with minimal coding in a Jupyter environment

Basic Info
  • Host: GitHub
  • Owner: opengeos
  • License: mit
  • Language: Python
  • Default Branch: master
  • Homepage: https://leafmap.org
  • Size: 2.11 GB
Statistics
  • Stars: 3,458
  • Watchers: 59
  • Forks: 422
  • Open Issues: 8
  • Releases: 272
Topics
data-science dataviz folium geoparquet geopython geospatial geospatial-analysis gis ipyleaflet jupyter jupyter-notebook leafmap mapping plotly python solara streamlit streamlit-webapp whiteboxtools
Created almost 5 years ago · Last pushed 4 months ago
Metadata Files
Readme Contributing Funding License Code of conduct Citation

README.md

Welcome to leafmap

image image image image image Conda Recipe image Conda Downloads image image pre-commit.ci status image image status

logo

A Python package for geospatial analysis and interactive mapping in a Jupyter environment.

Join our Discord server 👇

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 Python package, which was designed specifically to work with Google Earth Engine (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, JupyterLab, and marimo. Leafmap is built upon several open-source packages, such as folium and ipyleaflet (for creating interactive maps), WhiteboxTools and whiteboxgui (for analyzing geospatial data), and 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, Geomorphometric Analysis, Hydrological Analysis, LiDAR Data Analysis, Mathematical and Statistical Analysis, and Stream Network Analysis.

Acknowledgments

This project is supported by Amazon Web Services (AWS).

Statement of Need

There is a plethora of Python packages for geospatial analysis, such as geopandas for vector data analysis and xarray for raster data analysis. As listed at pyviz.org, there are also many options for plotting data on a map in Python, ranging from libraries focused specifically on maps like ipyleaflet and folium to general-purpose plotting tools that also support geospatial data types, such as hvPlot, bokeh, and plotly. While these tools provide powerful capabilities, displaying geospatial data from different file formats on an interactive map and performing basic analyses can be challenging, especially for users with limited coding skills. Furthermore, many tools lack bi-directional communication between the frontend (browser) and the backend (Python), limiting their interactivity and usability for exploring map data.

Leafmap addresses these challenges by leveraging the bidirectional communication provided by ipyleaflet, enabling users to load and visualize geospatial datasets with just one line of code. Leafmap also provides an interactive graphical user interface (GUI) for loading geospatial datasets without any coding. It is designed for anyone who wants to analyze and visualize geospatial data interactively in a Jupyter environment, making it particularly accessible for novice users with limited programming skills. Advanced programmers can also benefit from leafmap for geospatial data analysis and building interactive web applications.

Usage

Launch the interactive notebook tutorial for the leafmap Python package with Google Colab, Binder, or Amazon Sagemaker Studio Lab now:

image image Open In Studio Lab

Check out this excellent article on Medium - Leafmap a new Python Package for Geospatial data science

To learn more about leafmap, check out the leafmap documentation website - https://leafmap.org

Key Features

Leafmap offers a wide range of features and capabilities that empower geospatial data scientists, researchers, and developers to unlock the potential of their data. Some of the key features include:

  • Creating an interactive map with just one line of code: Leafmap makes it easy to create an interactive map by providing a simple API that allows you to load and visualize geospatial datasets with minimal coding.

  • Switching between different mapping backends: Leafmap supports multiple mapping backends, including ipyleaflet, folium, kepler.gl, pydeck, and bokeh. You can switch between these backends to create maps with different visualization styles and capabilities.

  • Changing basemaps interactively: Leafmap allows you to change basemaps interactively, providing a variety of options such as OpenStreetMap, Stamen Terrain, CartoDB Positron, and many more.

  • Adding XYZ, WMS, and vector tile services: You can easily add XYZ, WMS, and vector tile services to your map, allowing you to overlay additional geospatial data from various sources.

  • Displaying vector data: Leafmap supports various vector data formats, including Shapefile, GeoJSON, GeoPackage, and any vector format supported by GeoPandas. You can load and display vector data on the map, enabling you to visualize and analyze spatial features.

  • Displaying raster data: Leafmap allows you to load and display raster data, such as GeoTIFFs, on the map. This feature is useful for visualizing satellite imagery, digital elevation models, and other gridded datasets.

  • Creating custom legends and colorbars: Leafmap provides tools for customizing legends and colorbars on the map, allowing you to represent data values with different colors and corresponding labels.

  • Creating split-panel maps and linked maps: With Leafmap, you can create split-panel maps to compare different datasets side by side. You can also create linked maps that synchronize interactions between multiple maps, providing a coordinated view of different spatial data.

  • Downloading and visualizing OpenStreetMap data: Leafmap allows you to download and visualize OpenStreetMap data, providing access to detailed street maps, buildings, and other points of interest.

  • Creating and editing vector data interactively: Leafmap includes tools for creating and editing vector data interactively on the map. You can draw points, lines, and polygons, and modify them as needed.

  • Searching for geospatial data: Leafmap provides functionality for searching and accessing geospatial data from sources such as SpatialTemporal Asset Catalogs (STAC), Microsoft Planetary Computer, AWS Open Data Registry, and OpenAerialMap.

  • Inspecting pixel values interactively: Leafmap allows you to interactively inspect pixel values in raster datasets, helping you analyze and understand the data at a more granular level.

  • Creating choropleth maps and heat maps: Leafmap supports the creation of choropleth maps, where colors represent different data values for specific geographic areas. You can also create heat maps to visualize data density.

  • Displaying data from a PostGIS database: Leafmap provides tools for connecting to a PostGIS database and displaying spatial data stored in the database on the map.

  • Creating time series animations: Leafmap enables the creation of time series animations from both vector and raster data, allowing you to visualize temporal changes in your geospatial datasets.

  • Analyzing geospatial data with whitebox: Leafmap integrates with WhiteboxTools and whiteboxgui, providing a suite of geospatial analyses, such as hydrological analysis, terrain analysis, and LiDAR processing.

  • Segmenting and classifying remote sensing imagery: Leafmap integrates the segment-geospatial package, which provides tools for segmenting and classifying remote sensing imagery using deep learning algorithms.

  • Building interactive web apps: Leafmap supports the development of interactive web applications using frameworks like Voila, Streamlit, and Solara. This allows you to share your geospatial analyses and visualizations with others in a user-friendly web interface.

These features and capabilities make leafmap a powerful tool for geospatial data exploration, analysis, and visualization. Whether you are a beginner or an experienced geospatial data scientist, leafmap provides an accessible and efficient way to work with geospatial data in Python.

Citations

If you find leafmap useful in your research, please consider citing the following paper to support my work. Thank you for your support.

  • Wu, Q. (2021). Leafmap: A Python package for interactive mapping and geospatial analysis with minimal coding in a Jupyter environment. Journal of Open Source Software, 6(63), 3414. https://doi.org/10.21105/joss.03414

Demo

YouTube Channel

I have created a YouTube Channel for sharing geospatial tutorials. You can subscribe to my channel for regular updates. Check out the following videos for 3D mapping with MapLibre and Leafmap.

MapLibre tutorials

Owner

  • Name: Open Geospatial Solutions
  • Login: opengeos
  • Kind: organization
  • Email: opengeos@outlook.com

A collection of open-source software packages for the geospatial community

Citation (CITATION.cff)

cff-version: 1.1.0
message: "If you use this software, please cite it as below."
authors:
  - family-names: Wu
    given-names: Qiusheng
    orcid: https://orcid.org/0000-0001-5437-4073
title: "Leafmap: A Python package for interactive mapping and geospatial analysis with minimal coding in a Jupyter environment"
version: 0.3.5
doi: 10.21105/joss.03414
date-released: 2021-07-26
url: "https://github.com/opengeos/leafmap"

GitHub Events

Total
  • Create event: 232
  • Release event: 74
  • Issues event: 64
  • Watch event: 239
  • Delete event: 171
  • Issue comment event: 356
  • Push event: 605
  • Pull request review comment event: 2
  • Pull request review event: 8
  • Pull request event: 350
  • Fork event: 42
Last Year
  • Create event: 232
  • Release event: 74
  • Issues event: 64
  • Watch event: 239
  • Delete event: 171
  • Issue comment event: 356
  • Push event: 605
  • Pull request review comment event: 2
  • Pull request review event: 8
  • Pull request event: 350
  • Fork event: 42

Committers

Last synced: 6 months ago

All Time
  • Total Commits: 1,377
  • Total Committers: 41
  • Avg Commits per committer: 33.585
  • Development Distribution Score (DDS): 0.083
Past Year
  • Commits: 386
  • Committers: 11
  • Avg Commits per committer: 35.091
  • Development Distribution Score (DDS): 0.119
Top Committers
Name Email Commits
Qiusheng Wu g****s@g****m 1,263
slowy07 s****y@g****m 24
dependabot[bot] 4****] 13
pre-commit-ci[bot] 6****] 11
Kharude, Sachin s****e@h****m 8
rowheat02 r****2@g****m 7
Nahid Pervez n****2@f****m 4
Darren Wiens d****s@g****m 4
Oliver Lopez l****r@g****m 4
Stephan Druskat s****t 3
Markus Neteler n****r@o****g 2
Sugato Ray s****y 2
Myles Scolnick m****s@m****o 2
Daniel Seal 6****5 2
Cole Speed c****d@j****v 2
Gorjan Jovanovski c****y@g****m 1
James A. Bednar j****r@c****o 1
James Willis j****s 1
Jason j****g@g****m 1
Karel Van Camp k****p@g****m 1
Sangwoo Ham s****m@s****i 1
Shailesh Shrestha 1****a 1
Tyler Mitchell t****l@s****a 1
Ujaval Gandhi u****l@s****m 1
Vincent Sarago v****o@g****m 1
Xin Zhang x****5@g****m 1
gistfh 8****h 1
irrelevantRyan 6****n 1
prusswan p****n@g****m 1
Florian Knappers 7****n 1
and 11 more...

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 185
  • Total pull requests: 842
  • Average time to close issues: about 1 month
  • Average time to close pull requests: about 23 hours
  • Total issue authors: 95
  • Total pull request authors: 27
  • Average comments per issue: 2.22
  • Average comments per pull request: 0.94
  • Merged pull requests: 780
  • Bot issues: 2
  • Bot pull requests: 46
Past Year
  • Issues: 51
  • Pull requests: 387
  • Average time to close issues: 2 days
  • Average time to close pull requests: about 5 hours
  • Issue authors: 23
  • Pull request authors: 11
  • Average comments per issue: 1.9
  • Average comments per pull request: 0.9
  • Merged pull requests: 348
  • Bot issues: 2
  • Bot pull requests: 16
Top Authors
Issue Authors
  • giswqs (42)
  • cboettig (9)
  • robmarkcole (7)
  • patel-zeel (6)
  • ravishbapna (6)
  • Niko-La (4)
  • zxdawn (4)
  • amjadraza (3)
  • glemoine62 (3)
  • abarciauskas-bgse (3)
  • rbavery (3)
  • zyang91 (2)
  • ldemaz (2)
  • jxlyn (2)
  • niowniow (2)
Pull Request Authors
  • giswqs (706)
  • slowy07 (34)
  • dependabot[bot] (26)
  • pre-commit-ci[bot] (21)
  • Dseal95 (13)
  • lopezvoliver (8)
  • JJFlorian (5)
  • mscolnick (4)
  • cmspeed (4)
  • jordancaraballo (2)
  • spatialthoughts (2)
  • niowniow (2)
  • neteler (2)
  • flyhamsw (2)
  • mattrobmattrob (2)
Top Labels
Issue Labels
bug (108) Feature Request (63) help wanted (3) dependencies (1) github_actions (1) ready-to-merge (1)
Pull Request Labels
ready-to-merge (142) already reviewed (74) dependencies (26) github_actions (22) Feature Request (6) python (4) conflicts pull request (1)

Packages

  • Total packages: 3
  • Total downloads:
    • pypi 60,557 last-month
  • Total docker downloads: 237
  • Total dependent packages: 23
    (may contain duplicates)
  • Total dependent repositories: 212
    (may contain duplicates)
  • Total versions: 597
  • Total maintainers: 1
pypi.org: leafmap

A Python package for geospatial analysis and interactive mapping in a Jupyter environment.

  • Versions: 272
  • Dependent Packages: 19
  • Dependent Repositories: 196
  • Downloads: 60,557 Last month
  • Docker Downloads: 237
Rankings
Dependent packages count: 0.9%
Dependent repos count: 1.1%
Stargazers count: 1.4%
Downloads: 1.8%
Average: 2.0%
Forks count: 2.9%
Docker downloads count: 3.9%
Maintainers (1)
Last synced: 4 months ago
proxy.golang.org: github.com/opengeos/leafmap
  • Versions: 272
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.4%
Average: 5.6%
Dependent repos count: 5.8%
Last synced: 4 months ago
conda-forge.org: leafmap

A Python package for geospatial analysis and interactive mapping in a Jupyter environment

  • Versions: 53
  • Dependent Packages: 4
  • Dependent Repositories: 16
Rankings
Dependent repos count: 8.9%
Stargazers count: 10.2%
Average: 11.1%
Dependent packages count: 12.5%
Forks count: 12.8%
Last synced: 4 months ago

Dependencies

.github/workflows/codeql.yml actions
  • actions/checkout v3 composite
  • github/codeql-action/analyze v2 composite
  • github/codeql-action/autobuild v2 composite
  • github/codeql-action/init v2 composite
.github/workflows/dependency-review.yml actions
  • actions/checkout v3 composite
  • actions/dependency-review-action v2 composite
.github/workflows/docker-image.yml actions
  • actions/checkout v3 composite
.github/workflows/docker-publish.yml actions
  • actions/checkout v3 composite
  • docker/build-push-action v4 composite
  • docker/login-action v2 composite
  • docker/metadata-action v4 composite
.github/workflows/docs-build.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • nwtgck/actions-netlify v2.0 composite
.github/workflows/docs.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/workflows/macos.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/workflows/pypi.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/workflows/ubuntu.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/workflows/windows.yml actions
  • actions/checkout v3 composite
  • conda-incubator/setup-miniconda v2 composite
Dockerfile docker
  • jupyter/scipy-notebook latest build
requirements.txt pypi
  • bqplot *
  • colour *
  • folium *
  • gdown *
  • geojson *
  • ipyevents *
  • ipyfilechooser *
  • ipyleaflet *
  • ipywidgets *
  • matplotlib *
  • numpy *
  • pandas *
  • pyshp *
  • pystac-client *
  • python-box *
  • scooby *
  • whiteboxgui *
  • xyzservices *
requirements_dev.txt pypi
  • black * development
  • bokeh * development
  • boto3 * development
  • codespell * development
  • cogeo-mosaic * development
  • datapane * development
  • deadlink * development
  • ffmpeg-python * development
  • geopandas * development
  • googledrivedownloader * development
  • gradio * development
  • ipygany * development
  • ipysheet * development
  • ipyvtklink * development
  • jupyter_bokeh * development
  • jupyterlab >=3.0.0 development
  • keplergl * development
  • laspy * development
  • localtileserver * development
  • mapclassify >=2.4.0 development
  • mss * development
  • netcdf4 * development
  • osmnx * development
  • owslib * development
  • palettable * development
  • panel * development
  • plotly * development
  • psycopg2 * development
  • pycrs * development
  • pydeck * development
  • pyntcloud * development
  • pyvista-xarray * development
  • rasterio * development
  • rasterstats * development
  • rio-cogeo * development
  • rioxarray * development
  • sqlalchemy * development
  • streamlit-folium * development
  • xarray_leaflet * development
requirements_docs.txt pypi
  • bump2version *
  • coverage *
  • flake8 *
  • grip *
  • ipykernel *
  • livereload *
  • mkdocs *
  • mkdocs-git-revision-date-localized-plugin *
  • mkdocs-git-revision-date-plugin *
  • mkdocs-jupyter >=0.24.0
  • mkdocs-material >=9.1.3
  • mkdocs-pdf-export-plugin *
  • mkdocstrings *
  • mkdocstrings-crystal *
  • mkdocstrings-python-legacy *
  • nbconvert *
  • nbformat *
  • pip *
  • pygments *
  • pymdown-extensions *
  • sphinx *
  • tox *
  • twine *
  • watchdog *
  • wheel *
setup.py pypi
  • x.strip *
.github/workflows/installation.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
environment.yml conda
  • bokeh
  • cartopy
  • datapane
  • flask >=2.0.0
  • flask-caching
  • gdal
  • geemap >=0.11.1
  • geopandas
  • imageio
  • ipyvtklink
  • jupyter_bokeh
  • keplergl
  • laspy
  • leafmap >=0.11.3
  • localtileserver >=0.4.0
  • osmnx
  • pip
  • pydeck
  • pyntcloud
  • python >=3.9
  • pyvista
  • requests
  • rio-cogeo
  • tifffile
  • xarray_leaflet