A Jupyter notebook widget for interactively drawing shapes and converting them to shapely / WKT.
Project description
maply
maply is a Jupyter notebook widget for quickly drawing shapes on a blank XY canvas and converting them into shapely geometries, WKT strings, GeoJSON, or a GeoDataFrame.
It is built for geospatial engineers who need to prototype and test spatial algorithms, and want a fast way to hand-craft geometry for minimal reproducible examples — without typing out coordinate tuples by hand.
Features
- Draw points, lines, polygons (with holes), rectangles, and circles on an abstract XY canvas.
- Build multipart geometries / collections.
- Pull results straight into Python:
canvas.geometries→ list of shapely geometriescanvas.wkt→ WKT stringscanvas.geojson→ GeoJSON dictcanvas.to_geodataframe()→ geopandasGeoDataFrame(optional dependency)
- Or draw on a real interactive map with
GeoCanvas(ipyleaflet), including pushing Python geometry back onto the map to inspect and edit it.
Install
pip install -e . # core
pip install -e ".[geopandas]" # + GeoDataFrame export
pip install -e ".[geo]" # + GeoCanvas interactive map (ipyleaflet)
pip install -e ".[dev]" # + test / lint tooling
Quick start
from maply import MaplyCanvas
canvas = MaplyCanvas(width=600, height=400)
canvas # draw shapes interactively in the output cell
canvas.wkt # -> ['POLYGON ((...))', 'POINT (...)']
canvas.geometries # -> [<shapely Polygon>, <shapely Point>]
Draw on a real map
GeoCanvas wraps an ipyleaflet map (pan,
zoom, basemaps, draw/edit toolbar) and connects it to the same conversion layer
— in both directions:
from shapely.geometry import Polygon
from maply import GeoCanvas
geo = GeoCanvas(center=(37.77, -122.42), zoom=12)
# Python -> map: inspect / edit a geometry on the map
geo.add_geometry(Polygon([(-122.45, 37.75), (-122.40, 37.75),
(-122.40, 37.79), (-122.45, 37.79)]))
geo
# map -> Python (after drawing/editing)
geo.wkt
geo.to_geodataframe(crs="EPSG:3857") # optional reprojection
See examples/quickstart.ipynb for a full walkthrough.
Status
Alpha. MaplyCanvas uses planar XY (no CRS). GeoCanvas draws in lon/lat
(EPSG:4326) on a live map and is available with the geo extra.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file maply-0.1.0.tar.gz.
File metadata
- Download URL: maply-0.1.0.tar.gz
- Upload date:
- Size: 21.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c2924028c010f599e7dddc558463e391729036dbb186bc28eec81430999b5d9f
|
|
| MD5 |
fd1fb4da2abd129b79248f9fbfbc286d
|
|
| BLAKE2b-256 |
70fa7efb23122e33cad0e838a25165a40a575518259ae4c2d104719aa1f9c79e
|
Provenance
The following attestation bundles were made for maply-0.1.0.tar.gz:
Publisher:
publish.yml on austinbreunig/maply
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
maply-0.1.0.tar.gz -
Subject digest:
c2924028c010f599e7dddc558463e391729036dbb186bc28eec81430999b5d9f - Sigstore transparency entry: 2207661479
- Sigstore integration time:
-
Permalink:
austinbreunig/maply@a99c6d8ef07f2a5dc0d46aa418d95fc68044fd9f -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/austinbreunig
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a99c6d8ef07f2a5dc0d46aa418d95fc68044fd9f -
Trigger Event:
release
-
Statement type:
File details
Details for the file maply-0.1.0-py3-none-any.whl.
File metadata
- Download URL: maply-0.1.0-py3-none-any.whl
- Upload date:
- Size: 18.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c50534dd401ee5d7cefe19f4823073ded050f9b1b48d5abf5b0501af8ee781bf
|
|
| MD5 |
e1b3b6cd114b5e502e2c806e6c47d779
|
|
| BLAKE2b-256 |
6a57177fbc69932e27ea051595c15351e79e5737b034b983c6466c196de76017
|
Provenance
The following attestation bundles were made for maply-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on austinbreunig/maply
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
maply-0.1.0-py3-none-any.whl -
Subject digest:
c50534dd401ee5d7cefe19f4823073ded050f9b1b48d5abf5b0501af8ee781bf - Sigstore transparency entry: 2207661565
- Sigstore integration time:
-
Permalink:
austinbreunig/maply@a99c6d8ef07f2a5dc0d46aa418d95fc68044fd9f -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/austinbreunig
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a99c6d8ef07f2a5dc0d46aa418d95fc68044fd9f -
Trigger Event:
release
-
Statement type: