Grids

grid generators


source

SquareGridBoundary

 SquareGridBoundary (x_min:float, y_min:float, x_max:float, y_max:float)

Reusing Boundary. x_min, y_min, x_max, and y_max are in the the target crs


source

SquareGridGenerator

 SquareGridGenerator (cell_size:float, grid_projection:str='EPSG:3857',
                      boundary:Union[__main__.SquareGridBoundary,List[floa
                      t]]=None)

Initialize self. See help(type(self)) for accurate signature.

Type Default Details
cell_size float height and width of a square cell in meters
grid_projection str EPSG:3857 projection of grid output
boundary Union None original boundary

source

SquareGridGenerator.create_cell

 SquareGridGenerator.create_cell (x:float, y:float)

Create a square cell based on the top left coordinates and cell_size

Type Details
x float x coord of top left
y float y coord of top left
Returns Polygon

source

SquareGridGenerator.create_grid_for_polygon

 SquareGridGenerator.create_grid_for_polygon (boundary, geometry)

source

SquareGridGenerator.generate_grid

 SquareGridGenerator.generate_grid
                                    (gdf:geopandas.geodataframe.GeoDataFra
                                    me)

source

H3GridGenerator

 H3GridGenerator (resolution:int, return_geometry:bool=True)

Initialize self. See help(type(self)) for accurate signature.

Type Default Details
resolution int Resolution of hexagon. See: https://h3geo.org/docs/core-library/restable/ for more info
return_geometry bool True If geometry should be returned. Setting this to false will only return hex_ids

source

H3GridGenerator.get_hexes_for_polygon

 H3GridGenerator.get_hexes_for_polygon
                                        (poly:shapely.geometry.polygon.Pol
                                        ygon)

source

H3GridGenerator.generate_grid

 H3GridGenerator.generate_grid (gdf:geopandas.geodataframe.GeoDataFrame)

source

BingTileGridGenerator

 BingTileGridGenerator (zoom_level:int, return_geometry:bool=True,
                        add_xyz_cols:bool=False)

Initialize self. See help(type(self)) for accurate signature.

Type Default Details
zoom_level int Zoom level of tile. See: https://docs.microsoft.com/en-us/bingmaps/articles/bing-maps-tile-system for more info
return_geometry bool True If geometry should be returned. Setting this to false will only return quadkeys
add_xyz_cols bool False If quadkey should be converted to their xy values.

source

BingTileGridGenerator.get_all_tiles_for_polygon

 BingTileGridGenerator.get_all_tiles_for_polygon
                                                  (polygon:shapely.geometr
                                                  y.polygon.Polygon)

Get the interseting tiles with polygon for a zoom level. Polygon should be in EPSG:4326


source

BingTileGridGenerator.generate_grid

 BingTileGridGenerator.generate_grid
                                      (gdf:geopandas.geodataframe.GeoDataF
                                      rame)

source

BingTileGridGenerator.generate_grid_join

 BingTileGridGenerator.generate_grid_join
                                           (gdf:geopandas.geodataframe.Geo
                                           DataFrame, filter:bool=True,
                                           n_workers=4, progress=True)