supermorecado


Namesupermorecado JSON
Version 0.1.2 PyPI version JSON
download
home_pageNone
SummaryExtend the functionality of morecantile with additional commands.
upload_time2023-09-11 14:40:15
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseNone
keywords gis tms tilematrixset map tile
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Supermorecado


<p align="center">
  <img src="https://user-images.githubusercontent.com/10407788/236178256-62972e7a-ff16-4426-b189-73b1e6a29d5b.png">
  <em>Extend the functionality of morecantile with additional commands.</em>
</p>
<p align="center">
  <a href="https://github.com/developmentseed/supermorecado/actions?query=workflow%3ACI" target="_blank">
      <img src="https://github.com/developmentseed/supermorecado/workflows/CI/badge.svg" alt="Test">
  </a>
  <a href="https://codecov.io/gh/developmentseed/supermorecado" target="_blank">
      <img src="https://codecov.io/gh/developmentseed/supermorecado/branch/main/graph/badge.svg" alt="Coverage">
  </a>
  <a href="https://pypi.org/project/supermorecado" target="_blank">
      <img src="https://img.shields.io/pypi/v/supermorecado?color=%2334D058&label=pypi%20package" alt="Package version">
  </a>
  <a href="https://pypistats.org/packages/supermorecado" target="_blank">
      <img src="https://img.shields.io/pypi/dm/supermorecado.svg" alt="Downloads">
  </a>
  <a href="https://github.com/developmentseed/supermorecado/blob/main/LICENSE" target="_blank">
      <img src="https://img.shields.io/github/license/developmentseed/supermorecado.svg" alt="License">
  </a>
</p>

---

**Documentation**: <a href="https://developmentseed.org/supermorecado/" target="_blank">https://developmentseed.org/supermorecado/</a>

**Source Code**: <a href="https://github.com/developmentseed/supermorecado" target="_blank">https://github.com/developmentseed/supermorecado</a>

---

supermorecado is like [supermercado](https://github.com/mapbox/supermercado), but with support for other TileMatrixSet grids.


## Install

```bash
$ python -m pip install -U pip
$ python -m pip install supermorecado

# Or install from source:

$ python -m pip install -U pip
$ python -m pip install git+https://github.com/developmentseed/supermorecado.git
```

## Usage

```
supermorecado --help
Usage: supermorecado [OPTIONS] COMMAND [ARGS]...

  Command line interface for the Supermorecado Python package.

Options:
  --help  Show this message and exit.

Commands:
  burn     Burn a stream of GeoJSONs into a output stream of the tiles they intersect for a given zoom.
  edges    For a stream of [<x>, <y>, <z>] tiles, return only those tiles that are on the edge.
  heatmap  Creates a vector `heatmap` of tile densities.
  union    Returns the unioned shape of a stream of [<x>, <y>, <z>] tiles in GeoJSON.
```

### `supermorecado burn`

```
<{geojson} stream> | supermorecado burn <zoom> --identifier {tms Identifier} | <[x, y, z] stream>
```

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

Using default TMS (`WebMercatorQuad`)
```
cat tests/fixtures/france.geojson | supermorecado burn 9 | morecantile shapes | fio collect | geojsonio
```

![](https://user-images.githubusercontent.com/10407788/236114524-c0a3543f-dfa3-4fd3-af2f-27d60ab897e1.jpg)

Using other TMS (e.g `WGS1984Quad`)
```
cat tests/fixtures/france.geojson | supermorecado burn 6 --identifier WGS1984Quad | morecantile shapes --identifier WGS1984Quad | fio collect | geojsonio
```

![](https://user-images.githubusercontent.com/10407788/236115182-441b1e23-3335-4392-9a72-4c98838c76de.jpg)

### `supermorecado edges`

```
<[x, y, z] stream> | supermorecado 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 tests/fixtures/france.geojson | supermorecado burn 9 | supermorecado edges | morecantile shapes | fio collect | geojsonio
```

![](https://user-images.githubusercontent.com/10407788/236123127-cc99c887-de9d-4823-a935-bd31a99809a2.jpg)

### `supermorecado union`

```
<[x, y, z] stream> | supermorecado union --identifier {tms Identifier} | <{geojson} stream>
```

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

Using default TMS (`WebMercatorQuad`)
```
cat tests/fixtures/france.geojson | supermorecado burn 9 | supermorecado union | fio collect | geojsonio
```

![](https://user-images.githubusercontent.com/10407788/236115745-9c2f4fa3-e2ea-47d5-a5f5-c77f5308f4a3.jpg)

Using other TMS (e.g `WGS1984Quad`)

```
cat tests/fixtures/france.geojson | supermorecado burn 6 --identifier WGS1984Quad |  supermorecado union --identifier WGS1984Quad | fio collect | geojsonio
```

![](https://user-images.githubusercontent.com/10407788/236115946-2dfabe05-e51d-473b-9957-26bbbe9e61bb.jpg)


### `supermorecado heatmap`

```
<[x, y, z] stream> | supermorecado heatmap --identifier {tms Identifier} | <{geojson} stream>
```
Outputs a stream of heatmap GeoJSON from an input stream of `[x, y, z]`s.

Using default TMS (`WebMercatorQuad`)
```
cat tests/fixtures/heatmap.txt| supermorecado heatmap | fio collect | geojsonio
```

![](https://github.com/developmentseed/supermorecado/assets/10407788/fec78304-12e8-47de-bca3-af58f04e8824)

Using other TMS (e.g `WGS1984Quad`)

```
# create a list of tiles
cat tests/fixtures/france.geojson | supermorecado burn 6 --identifier WGS1984Quad > france_wgs84_z6.txt
# randomly append more tiles
for run in {1..10}; do cat france_wgs84_z6.txt | sort -R | head -n 2 >> france_wgs84_z6.txt; done

cat france_wgs84_z6.txt |  supermorecado heatmap --identifier WGS1984Quad | fio collect | geojsonio
```

![](https://github.com/developmentseed/supermorecado/assets/10407788/dec3dbdb-6030-4dd8-9efc-5c8d4b7c83d3)


## API migration

`supermorecado` is really similar to `supermercado` (it reuse most of the code) but with the addition of multiple TMS support from morecantile.

```python
features = [
    {
        "geometry": {
            "coordinates": [
                [-127.97, 49.15],
                [-101.95, -8.41],
                [-43.24, -32.84],
                [37.62, -25.17],
                [71.72, -7.01],
                [107.23, 48.69],
            ],
            "type": "LineString",
        },
        "properties": {},
        "type": "Feature",
    },
]

# supermercado
from supermercado import burntiles, uniontiles

tiles = burntiles.burn(features)
u_tiles = uniontiles.union(features)

# supermorecado
import morecantile
from supermorecado import burnTiles, unionTiles

tms = morecantile.tms.get("WebMercatorQuad")

burntiles = burnTiles(tms=tms)
tiles = burntiles.burn(features)

uniontiles = unionTiles(tms=tms)
u_tiles = uniontiles.burn(features)
```

## Changes

See [CHANGES.md](https://github.com/developmentseed/supermorecado/blob/main/CHANGES.md).

## Contribution & Development

See [CONTRIBUTING.md](https://github.com/developmentseed/supermorecado/blob/main/CONTRIBUTING.md)

## License

See [LICENSE](https://github.com/developmentseed/supermorecado/blob/main/LICENSE)

## Authors

Created by [Development Seed](<http://developmentseed.org>)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "supermorecado",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "GIS,TMS,TileMatrixSet,Map Tile",
    "author": null,
    "author_email": "Vincent Sarago <vincent@developmentseed.com>",
    "download_url": "https://files.pythonhosted.org/packages/7e/cc/97693e7c34e56a9f3c869ff10a962e14d38c48b2c56436f0483ee77c3cc4/supermorecado-0.1.2.tar.gz",
    "platform": null,
    "description": "# Supermorecado\n\n\n<p align=\"center\">\n  <img src=\"https://user-images.githubusercontent.com/10407788/236178256-62972e7a-ff16-4426-b189-73b1e6a29d5b.png\">\n  <em>Extend the functionality of morecantile with additional commands.</em>\n</p>\n<p align=\"center\">\n  <a href=\"https://github.com/developmentseed/supermorecado/actions?query=workflow%3ACI\" target=\"_blank\">\n      <img src=\"https://github.com/developmentseed/supermorecado/workflows/CI/badge.svg\" alt=\"Test\">\n  </a>\n  <a href=\"https://codecov.io/gh/developmentseed/supermorecado\" target=\"_blank\">\n      <img src=\"https://codecov.io/gh/developmentseed/supermorecado/branch/main/graph/badge.svg\" alt=\"Coverage\">\n  </a>\n  <a href=\"https://pypi.org/project/supermorecado\" target=\"_blank\">\n      <img src=\"https://img.shields.io/pypi/v/supermorecado?color=%2334D058&label=pypi%20package\" alt=\"Package version\">\n  </a>\n  <a href=\"https://pypistats.org/packages/supermorecado\" target=\"_blank\">\n      <img src=\"https://img.shields.io/pypi/dm/supermorecado.svg\" alt=\"Downloads\">\n  </a>\n  <a href=\"https://github.com/developmentseed/supermorecado/blob/main/LICENSE\" target=\"_blank\">\n      <img src=\"https://img.shields.io/github/license/developmentseed/supermorecado.svg\" alt=\"License\">\n  </a>\n</p>\n\n---\n\n**Documentation**: <a href=\"https://developmentseed.org/supermorecado/\" target=\"_blank\">https://developmentseed.org/supermorecado/</a>\n\n**Source Code**: <a href=\"https://github.com/developmentseed/supermorecado\" target=\"_blank\">https://github.com/developmentseed/supermorecado</a>\n\n---\n\nsupermorecado is like [supermercado](https://github.com/mapbox/supermercado), but with support for other TileMatrixSet grids.\n\n\n## Install\n\n```bash\n$ python -m pip install -U pip\n$ python -m pip install supermorecado\n\n# Or install from source:\n\n$ python -m pip install -U pip\n$ python -m pip install git+https://github.com/developmentseed/supermorecado.git\n```\n\n## Usage\n\n```\nsupermorecado --help\nUsage: supermorecado [OPTIONS] COMMAND [ARGS]...\n\n  Command line interface for the Supermorecado Python package.\n\nOptions:\n  --help  Show this message and exit.\n\nCommands:\n  burn     Burn a stream of GeoJSONs into a output stream of the tiles they intersect for a given zoom.\n  edges    For a stream of [<x>, <y>, <z>] tiles, return only those tiles that are on the edge.\n  heatmap  Creates a vector `heatmap` of tile densities.\n  union    Returns the unioned shape of a stream of [<x>, <y>, <z>] tiles in GeoJSON.\n```\n\n### `supermorecado burn`\n\n```\n<{geojson} stream> | supermorecado burn <zoom> --identifier {tms Identifier} | <[x, y, z] stream>\n```\n\nTakes an input stream of GeoJSON and returns a stream of intersecting `[x, y, z]`s for a given zoom.\n\nUsing default TMS (`WebMercatorQuad`)\n```\ncat tests/fixtures/france.geojson | supermorecado burn 9 | morecantile shapes | fio collect | geojsonio\n```\n\n![](https://user-images.githubusercontent.com/10407788/236114524-c0a3543f-dfa3-4fd3-af2f-27d60ab897e1.jpg)\n\nUsing other TMS (e.g `WGS1984Quad`)\n```\ncat tests/fixtures/france.geojson | supermorecado burn 6 --identifier WGS1984Quad | morecantile shapes --identifier WGS1984Quad | fio collect | geojsonio\n```\n\n![](https://user-images.githubusercontent.com/10407788/236115182-441b1e23-3335-4392-9a72-4c98838c76de.jpg)\n\n### `supermorecado edges`\n\n```\n<[x, y, z] stream> | supermorecado edges | <[x, y, z] stream>\n```\n\nOutputs 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.\n\n```\ncat tests/fixtures/france.geojson | supermorecado burn 9 | supermorecado edges | morecantile shapes | fio collect | geojsonio\n```\n\n![](https://user-images.githubusercontent.com/10407788/236123127-cc99c887-de9d-4823-a935-bd31a99809a2.jpg)\n\n### `supermorecado union`\n\n```\n<[x, y, z] stream> | supermorecado union --identifier {tms Identifier} | <{geojson} stream>\n```\n\nOutputs a stream of unioned GeoJSON from an input stream of `[x, y, z]`s. Like `morecantile shapes` but as an overall footprint instead of individual shapes for each tile.\n\nUsing default TMS (`WebMercatorQuad`)\n```\ncat tests/fixtures/france.geojson | supermorecado burn 9 | supermorecado union | fio collect | geojsonio\n```\n\n![](https://user-images.githubusercontent.com/10407788/236115745-9c2f4fa3-e2ea-47d5-a5f5-c77f5308f4a3.jpg)\n\nUsing other TMS (e.g `WGS1984Quad`)\n\n```\ncat tests/fixtures/france.geojson | supermorecado burn 6 --identifier WGS1984Quad |  supermorecado union --identifier WGS1984Quad | fio collect | geojsonio\n```\n\n![](https://user-images.githubusercontent.com/10407788/236115946-2dfabe05-e51d-473b-9957-26bbbe9e61bb.jpg)\n\n\n### `supermorecado heatmap`\n\n```\n<[x, y, z] stream> | supermorecado heatmap --identifier {tms Identifier} | <{geojson} stream>\n```\nOutputs a stream of heatmap GeoJSON from an input stream of `[x, y, z]`s.\n\nUsing default TMS (`WebMercatorQuad`)\n```\ncat tests/fixtures/heatmap.txt| supermorecado heatmap | fio collect | geojsonio\n```\n\n![](https://github.com/developmentseed/supermorecado/assets/10407788/fec78304-12e8-47de-bca3-af58f04e8824)\n\nUsing other TMS (e.g `WGS1984Quad`)\n\n```\n# create a list of tiles\ncat tests/fixtures/france.geojson | supermorecado burn 6 --identifier WGS1984Quad > france_wgs84_z6.txt\n# randomly append more tiles\nfor run in {1..10}; do cat france_wgs84_z6.txt | sort -R | head -n 2 >> france_wgs84_z6.txt; done\n\ncat france_wgs84_z6.txt |  supermorecado heatmap --identifier WGS1984Quad | fio collect | geojsonio\n```\n\n![](https://github.com/developmentseed/supermorecado/assets/10407788/dec3dbdb-6030-4dd8-9efc-5c8d4b7c83d3)\n\n\n## API migration\n\n`supermorecado` is really similar to `supermercado` (it reuse most of the code) but with the addition of multiple TMS support from morecantile.\n\n```python\nfeatures = [\n    {\n        \"geometry\": {\n            \"coordinates\": [\n                [-127.97, 49.15],\n                [-101.95, -8.41],\n                [-43.24, -32.84],\n                [37.62, -25.17],\n                [71.72, -7.01],\n                [107.23, 48.69],\n            ],\n            \"type\": \"LineString\",\n        },\n        \"properties\": {},\n        \"type\": \"Feature\",\n    },\n]\n\n# supermercado\nfrom supermercado import burntiles, uniontiles\n\ntiles = burntiles.burn(features)\nu_tiles = uniontiles.union(features)\n\n# supermorecado\nimport morecantile\nfrom supermorecado import burnTiles, unionTiles\n\ntms = morecantile.tms.get(\"WebMercatorQuad\")\n\nburntiles = burnTiles(tms=tms)\ntiles = burntiles.burn(features)\n\nuniontiles = unionTiles(tms=tms)\nu_tiles = uniontiles.burn(features)\n```\n\n## Changes\n\nSee [CHANGES.md](https://github.com/developmentseed/supermorecado/blob/main/CHANGES.md).\n\n## Contribution & Development\n\nSee [CONTRIBUTING.md](https://github.com/developmentseed/supermorecado/blob/main/CONTRIBUTING.md)\n\n## License\n\nSee [LICENSE](https://github.com/developmentseed/supermorecado/blob/main/LICENSE)\n\n## Authors\n\nCreated by [Development Seed](<http://developmentseed.org>)\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Extend the functionality of morecantile with additional commands.",
    "version": "0.1.2",
    "project_urls": {
        "Documentation": "https://developmentseed.org/supermorecado/",
        "Source": "https://github.com/developmentseed/supermorecado"
    },
    "split_keywords": [
        "gis",
        "tms",
        "tilematrixset",
        "map tile"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "7325909292b8a012282d3b535e51c2626095f0ff0cfea796da637b34512fb9f6",
                "md5": "0363205918f5db6613e70b1540616498",
                "sha256": "5116b9ff8c8aa0b0da235cb5962449dc878515c8155adf1440268c3cf271bed6"
            },
            "downloads": -1,
            "filename": "supermorecado-0.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0363205918f5db6613e70b1540616498",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 14486,
            "upload_time": "2023-09-11T14:40:13",
            "upload_time_iso_8601": "2023-09-11T14:40:13.349300Z",
            "url": "https://files.pythonhosted.org/packages/73/25/909292b8a012282d3b535e51c2626095f0ff0cfea796da637b34512fb9f6/supermorecado-0.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "7ecc97693e7c34e56a9f3c869ff10a962e14d38c48b2c56436f0483ee77c3cc4",
                "md5": "ab6d4a6dc76ea3e566d7824a0e33971f",
                "sha256": "b51664d2eb12326e657a9d80c6849857c42ef3876545515ef988e266e6cc9654"
            },
            "downloads": -1,
            "filename": "supermorecado-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "ab6d4a6dc76ea3e566d7824a0e33971f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 12171,
            "upload_time": "2023-09-11T14:40:15",
            "upload_time_iso_8601": "2023-09-11T14:40:15.737958Z",
            "url": "https://files.pythonhosted.org/packages/7e/cc/97693e7c34e56a9f3c869ff10a962e14d38c48b2c56436f0483ee77c3cc4/supermorecado-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-11 14:40:15",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "developmentseed",
    "github_project": "supermorecado",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "supermorecado"
}
        
Elapsed time: 0.11952s