grid generators

class SquareGridBoundary[source]

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

class SquareGridGenerator[source]

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

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 typing.Union[geowrangler.grids.SquareGridBoundary, typing.List[float]] None original boundary

SquareGridGenerator.create_cell[source]

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

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

Type Default Details
x float x coord of top left
y float y coord of top left

SquareGridGenerator.create_grid_for_polygon[source]

SquareGridGenerator.create_grid_for_polygon(boundary, geometry)

SquareGridGenerator.generate_grid[source]

SquareGridGenerator.generate_grid(gdf:GeoDataFrame)

class H3GridGenerator[source]

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

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

H3GridGenerator.get_hexes_for_polygon[source]

H3GridGenerator.get_hexes_for_polygon(poly:Polygon)

H3GridGenerator.generate_grid[source]

H3GridGenerator.generate_grid(gdf:GeoDataFrame)

class BingTileGridGenerator[source]

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

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.

BingTileGridGenerator.get_all_tiles_for_polygon[source]

BingTileGridGenerator.get_all_tiles_for_polygon(polygon:Polygon)

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

BingTileGridGenerator.generate_grid[source]

BingTileGridGenerator.generate_grid(gdf:GeoDataFrame)

BingTileGridGenerator.generate_grid_join[source]

BingTileGridGenerator.generate_grid_join(gdf:GeoDataFrame, filter:bool=True, n_workers=4, progress=True)