quadbin


Namequadbin JSON
Version 0.2.1 PyPI version JSON
download
home_pagehttps://github.com/cartodb/quadbin-py
SummaryHierarchical geospatial indexing system for square cells in Web Mercator projection
upload_time2023-12-26 12:01:24
maintainer
docs_urlNone
authorCARTO
requires_python>=2.7
licenseBSD 3-Clause
keywords quadbin hierarchical geospatial index visualization maps carto
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # quadbin-py

[![PyPI version](https://badge.fury.io/py/quadbin.svg)](https://badge.fury.io/py/quadbin)
[![PyPI downloads](https://img.shields.io/pypi/dm/quadbin.svg)](https://pypistats.org/packages/quadbin)
[![Tests](https://github.com/cartodb/quadbin-py/actions/workflows/ci.yml/badge.svg)](https://github.com/cartodb/quadbin-py/actions)

Python library for quadbin.

## Install

```bash
pip install quadbin
```

## Usage

```py
>>> import quadbin
>>> longitude = -3.7038
>>> latitude =  40.4168
>>> resolution = 10
>>> quadbin.point_to_cell(longitude, latitude, resolution)
5234261499580514303
```

## API

| Function |
|---|
| `is_valid_index(index)` |
| `is_valid_cell(cell)` |
| `cell_to_tile(cell)` |
| `tile_to_cell(tile)` |
| `cell_to_point(cell, geojson=False)` |
| `point_to_cell(longitude, latitude, resolution)` |
| `cell_to_boundary(cell, geojson=False)` |
| `cell_to_bounding_box(cell)` |
| `get_resolution(index)` |
| `index_to_string(index)` |
| `string_to_index(index)` |
| `k_ring(origin, k)` |
| `k_ring_distances(origin, k)` |
| `cell_sibling(cell, direction)` |
| `cell_to_parent(cell, parent_resolution)` |
| `cell_to_children(cell, children_resolution)` |
| `geometry_to_cells(geometry, resolution)` |
| `cell_area(cell)` |

## Development

Make commands:

- init: create the environment and install dependencies
- lint: run linter (flake8) + fix (black)
- test: run tests (pytest)
- publish-pypi: publish package in pypi.org
- publish-test-pypi: publish package in test.pypi.org
- clean: remove the environment

NOTE: Python2 is supported to enable the usage in platforms like [Amazon Redshift](https://aws.amazon.com/redshift/).

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/cartodb/quadbin-py",
    "name": "quadbin",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=2.7",
    "maintainer_email": "",
    "keywords": "quadbin,hierarchical,geospatial,index,visualization,maps,carto",
    "author": "CARTO",
    "author_email": "contact@carto.com",
    "download_url": "https://files.pythonhosted.org/packages/61/af/539e3fae3c34a148a782d97fcba71bf742b919c189b503b8339a1a0d4573/quadbin-0.2.1.tar.gz",
    "platform": null,
    "description": "# quadbin-py\n\n[![PyPI version](https://badge.fury.io/py/quadbin.svg)](https://badge.fury.io/py/quadbin)\n[![PyPI downloads](https://img.shields.io/pypi/dm/quadbin.svg)](https://pypistats.org/packages/quadbin)\n[![Tests](https://github.com/cartodb/quadbin-py/actions/workflows/ci.yml/badge.svg)](https://github.com/cartodb/quadbin-py/actions)\n\nPython library for quadbin.\n\n## Install\n\n```bash\npip install quadbin\n```\n\n## Usage\n\n```py\n>>> import quadbin\n>>> longitude = -3.7038\n>>> latitude =  40.4168\n>>> resolution = 10\n>>> quadbin.point_to_cell(longitude, latitude, resolution)\n5234261499580514303\n```\n\n## API\n\n| Function |\n|---|\n| `is_valid_index(index)` |\n| `is_valid_cell(cell)` |\n| `cell_to_tile(cell)` |\n| `tile_to_cell(tile)` |\n| `cell_to_point(cell, geojson=False)` |\n| `point_to_cell(longitude, latitude, resolution)` |\n| `cell_to_boundary(cell, geojson=False)` |\n| `cell_to_bounding_box(cell)` |\n| `get_resolution(index)` |\n| `index_to_string(index)` |\n| `string_to_index(index)` |\n| `k_ring(origin, k)` |\n| `k_ring_distances(origin, k)` |\n| `cell_sibling(cell, direction)` |\n| `cell_to_parent(cell, parent_resolution)` |\n| `cell_to_children(cell, children_resolution)` |\n| `geometry_to_cells(geometry, resolution)` |\n| `cell_area(cell)` |\n\n## Development\n\nMake commands:\n\n- init: create the environment and install dependencies\n- lint: run linter (flake8) + fix (black)\n- test: run tests (pytest)\n- publish-pypi: publish package in pypi.org\n- publish-test-pypi: publish package in test.pypi.org\n- clean: remove the environment\n\nNOTE: Python2 is supported to enable the usage in platforms like [Amazon Redshift](https://aws.amazon.com/redshift/).\n",
    "bugtrack_url": null,
    "license": "BSD 3-Clause",
    "summary": "Hierarchical geospatial indexing system for square cells in Web Mercator projection",
    "version": "0.2.1",
    "project_urls": {
        "Homepage": "https://github.com/cartodb/quadbin-py"
    },
    "split_keywords": [
        "quadbin",
        "hierarchical",
        "geospatial",
        "index",
        "visualization",
        "maps",
        "carto"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "40f350503875ca6271ccf9ede70d4140ac03e64154a0ed40610fe4410cab757a",
                "md5": "68f332ff143d49437222694a0b39d81e",
                "sha256": "36fcbe5a6e8f92301f0be3877b808c98240d66f16610b752a5299ca33a4a1711"
            },
            "downloads": -1,
            "filename": "quadbin-0.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "68f332ff143d49437222694a0b39d81e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=2.7",
            "size": 9979,
            "upload_time": "2023-12-26T12:01:23",
            "upload_time_iso_8601": "2023-12-26T12:01:23.100011Z",
            "url": "https://files.pythonhosted.org/packages/40/f3/50503875ca6271ccf9ede70d4140ac03e64154a0ed40610fe4410cab757a/quadbin-0.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "61af539e3fae3c34a148a782d97fcba71bf742b919c189b503b8339a1a0d4573",
                "md5": "1e3a2215387bc55e74737dc90c9ea1f5",
                "sha256": "322b9521b4ef96f07dbce555192b40a5d367fbf52daac21b93d1d98dabda315d"
            },
            "downloads": -1,
            "filename": "quadbin-0.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "1e3a2215387bc55e74737dc90c9ea1f5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=2.7",
            "size": 9824,
            "upload_time": "2023-12-26T12:01:24",
            "upload_time_iso_8601": "2023-12-26T12:01:24.994137Z",
            "url": "https://files.pythonhosted.org/packages/61/af/539e3fae3c34a148a782d97fcba71bf742b919c189b503b8339a1a0d4573/quadbin-0.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-26 12:01:24",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "cartodb",
    "github_project": "quadbin-py",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "quadbin"
}
        
Elapsed time: 0.54830s