CartoDB / quadbin-py

Other
1 stars 2 forks source link

quadbin-py

PyPI version PyPI downloads Tests

Python library for quadbin.

Install

pip install quadbin

Usage

>>> 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:

NOTE: Python2 is supported to enable the usage in platforms like Amazon Redshift.