Skip to main content

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

Project description

Welcome to leafmap

image image image Open In Studio Lab image image image image image image image image status

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

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, and JupyterLab. 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.

Statement of Need

There are a plethora of Python packages for geospatial analysis, such as geopandas for vector data analysis and xarray for raster data analysis. However, few Python packages provide interactive GUIs for loading geospatial data in a Jupyter environment. It might take many lines to code to load and display geospatial data with various file formats on an interactive map, which can be a challenging task for novice users with limited coding skills. There are also some notable Python packages for visualizing geospatial data in a Jupyter environment, such as plotly and kepler.gl. However, plotly is designed for displaying static data, which lacks bidirectional communication between the front-end and the backend. Kepler.gl provides unique 3D functionality for visualizing large-scale geospatial datasets, but it lacks tools for performing geospatial analysis, such as hydrological analysis and LiDAR data analysis. In contrast, leafmap provides many convenient functions for loading and visualizing geospatial datasets with only one line of code. Users can also use the interactive GUI to load geospatial datasets without coding. Leafmap is intended for anyone who would like to analyze and visualize geospatial data interactively in a Jupyter environment. It is particularly suited for novice users with limited programming skills. Advanced programmers can also find leafmap a useful tool for analyzing geospatial data and building interactive web apps.

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

image 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

Below is a partial list of features available for the leafmap package. Please check the examples page for notebook examples, GIF animations, and video tutorials.

  • Create an interactive map with only one-line of code.
  • Select from a variety of basemaps interactively without coding.
  • Add XYZ, WMS, and vector tile services to the map.
  • Convert CSV to points and display points as a marker cluster.
  • Add local vector data (e.g., shapefile, GeoJSON, KML) to the map without coding.
  • Add local raster data (e.g., GeoTIFF) to the map without coding.
  • Add Cloud Optimized GeoTIFF (COG) and SpatialTemporal Asset Catalog (STAC) to the map.
  • Add OpenStreetMap data to the map with a single line of code.
  • Add a GeoPandas GeoDataFrame to the map with a single line of code.
  • Add a point layer with popup attributes to the map.
  • Add data from a PostGIS database to the map.
  • Add custom legends and colorbars to the map.
  • Perform geospatial analysis using WhiteboxTools and whiteboxgui.
  • Create split-panel map and linked maps.
  • Publish interactive maps with a single line of code.
  • Download and display OpenStreetMap data with a single line of code.

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. If there is any specific tutorial you would like to see, please submit a feature request here.

Earth Engine Tutorials on YouTube

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

leafmap-0.17.1.tar.gz (203.5 kB view details)

Uploaded Source

Built Distribution

leafmap-0.17.1-py2.py3-none-any.whl (203.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file leafmap-0.17.1.tar.gz.

File metadata

  • Download URL: leafmap-0.17.1.tar.gz
  • Upload date:
  • Size: 203.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for leafmap-0.17.1.tar.gz
Algorithm Hash digest
SHA256 4e967cf45c8a1545d52e7c3369c6c2ba831321d8181ecc7d12800013b19eb680
MD5 13af95b7bdedd0cbf3ad981881e4f60b
BLAKE2b-256 97f45efe327f49c84414e29261f9c5e5f7ed5fe68ed902ca2413354f1dd4dc2b

See more details on using hashes here.

File details

Details for the file leafmap-0.17.1-py2.py3-none-any.whl.

File metadata

  • Download URL: leafmap-0.17.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 203.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.1

File hashes

Hashes for leafmap-0.17.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 20082dd845340b75c8eea8527e81f2c9bbc12d0bf20a429e1b8b3e528221bea8
MD5 c3554d41ee2e3ce27853b91799a127b0
BLAKE2b-256 f495c9b59a1e2ca4bb8a40ceb1cd8286422696c7f0248a92107edb24e4cf0e84

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page