Skip to main content

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 geometries
    • canvas.wkt → WKT strings
    • canvas.geojson → GeoJSON dict
    • canvas.to_geodataframe() → geopandas GeoDataFrame (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


Download files

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

Source Distribution

maply-0.1.0.tar.gz (21.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

maply-0.1.0-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

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

Hashes for maply-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c2924028c010f599e7dddc558463e391729036dbb186bc28eec81430999b5d9f
MD5 fd1fb4da2abd129b79248f9fbfbc286d
BLAKE2b-256 70fa7efb23122e33cad0e838a25165a40a575518259ae4c2d104719aa1f9c79e

See more details on using hashes here.

Provenance

The following attestation bundles were made for maply-0.1.0.tar.gz:

Publisher: publish.yml on austinbreunig/maply

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for maply-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c50534dd401ee5d7cefe19f4823073ded050f9b1b48d5abf5b0501af8ee781bf
MD5 e1b3b6cd114b5e502e2c806e6c47d779
BLAKE2b-256 6a57177fbc69932e27ea051595c15351e79e5737b034b983c6466c196de76017

See more details on using hashes here.

Provenance

The following attestation bundles were made for maply-0.1.0-py3-none-any.whl:

Publisher: publish.yml on austinbreunig/maply

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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