Skip to content

Latest commit

 

History

History
41 lines (26 loc) · 1 KB

README.md

File metadata and controls

41 lines (26 loc) · 1 KB

majortom

PyPI - Version PyPI - Python Version


An implementation of the ESA Major Tom Grid

Installation

pip install majortom_eg

Usage

import shapely.geometry
from shapely.io import to_geojson
from majortom_eg import MajorTomGrid, GridCell

# generate an overlapping grid with cells of 320m square
grid = MajorTomGrid(d=320, overlap=True)

# polygon 1/10 of a degree square
my_aoi = shapely.geometry.Polygon(((0., 0.), (0., 0.1), (0.1, 0.1), (0.1, 0.), (0., 0.)))

# iterate of cells returned from generator
for cell in grid.generate_grid_cells(my_aoi):
    # do something with cells
    print(f'cell id is {cell.id()}')
    print(f'cell geom is {to_geojson(cell.geom)}')

License

majortom is distributed under the terms of the MIT license.