Skip to content

mapbox/supermercado

PyPI Tests

supermercado

supermercado extends the functionality of mercantile with additional commands

Quickstart

pip install supermercado

Usage

Usage: supermercado [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  burn   Burn a stream of GeoJSON into a output...
  edges  For a stream of [<x>, <y>, <z>] tiles, return...
  union  Returns the unioned shape of a stream of...

supermercado burn

<{geojson} stream> | supermercado burn <zoom> | <[x, y, z] stream>

Takes an input stream of GeoJSON and returns a stream of intersecting [x, y, z]s for a given zoom.

image

cat data/ellada.geojson | supermercado burn 10 | mercantile shapes | fio collect

image

supermercado edges

<[x, y, z] stream> | supermercado edges | <[x, y, z] stream>

Outputs a stream of [x, y, z]s representing the edge tiles of an input stream of [x, y, z]s. Edge tile = any tile that is either directly adjacent to a tile that does not exist, or diagonal to an empty tile.

cat data/ellada.geojson | supermercado burn 10 | supermercado edges | mercantile shapes | fio collect | geojsonio

image

supermercado union

<[x, y, z] stream> | supermercado union | <{geojson} stream>

Outputs a stream of unioned GeoJSON from an input stream of [x, y, z]s. Like mercantile shapes but as an overall footprint instead of individual shapes for each tile.

cat data/ellada.geojson | supermercado burn 10 | supermercado union | fio collect | geojsonio

image

getting crazy

cat data/ellada.geojson | supermercado burn 12 | supermercado edges | supermercado union | fio collect | geojsonio

image

Contributing

Developing

git clone git@github.com:mapbox/supermercado.git
cd supermercado
uv venv
source .venv/bin/activate
uv sync --all-groups

Releasing

  1. Within your PR, update pyproject.toml with the new version number
  2. Once the PR is merged, pull main and verify the tests
uv run pytest
uv run ruff check .
uv run ruff format --check .
  1. Tag with the new version number and push
# ie
$ git checkout main
$ git pull
$ git tag 1.2.3
$ git push origin main 1.2.3
  1. GitHub Actions builds the release, runs uvx twine check, and publishes to PyPI using the pypi environment token

About

Supercharger for mercantile

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Contributors 10

Languages