dggrid4py.igeo7_ext

This extension module provides the IGEO7 wrappers around dggrid4py.DGGRIDv8. The wrappers apply the IGEO7 definition (dggs_vert0_lon = 11.20, Z7 hierarchical index, conversion between WGS84 and authalic latitudes), see IGEO7 for the background and examples. The module also contains experimental helper functions for raster data.

The dggrid4py.igeo7 module provides the functions on the Z7 index itself.

IGEO7 convenience wrappers around dggrid4py.DGGRIDv8.

All wrappers apply the current IGEO7 best practice:

  • DGGRIDv8 only, with the Z7 hierarchical index (HIERNDX / Z7)

  • dggs_vert0_lon = 11.20 (DGGRID’s default is 11.25)

  • WGS84 geometries are converted to the authalic sphere before they are passed to DGGRID, and DGGRID output geometries are converted back to WGS84 (geodetic latitude)

Functions

igeo7_meta_config([hier_ndx_form])

DGGRIDv8 meta configuration for IGEO7 with the Z7 index.

dggrid_igeo7_grid_cell_polygons_for_extent(...)

IGEO7 cell polygons at resolution covering clip_geom (a shapely geometry in WGS84).

dggrid_igeo7_grid_cell_polygons_from_cellids(...)

Cell polygons for a list of IGEO7 Z7 cell ids (all of the same resolution).

dggrid_igeo7_grid_cell_centroids_from_cellids(...)

Cell centroids for a list of IGEO7 Z7 cell ids (all of the same resolution).

dggrid_igeo7_cells_for_geo_points(...[, ...])

Assign IGEO7 Z7 cell ids at resolution to WGS84 points.

dggrid_igeo7_q2di_from_cellids(series, ...)

Q2DI (quad, i, j) addresses for a list of IGEO7 Z7 cell ids (all of the same resolution).

dggrid_get_res(dggrid_instance[, ...])

z7_resolution(cell_id[, hier_ndx_form])

Resolution of a Z7 cell id in DIGIT_STRING or INT64 (hex string) form.

z7_k1_ring_neighbours(z7_str, ...[, ...])

Z7 ids (DIGIT_STRING form) of the direct neighbours of z7_str.

to_parent_series(series)

z7_base_pentagons()

z7_get_base_pentagon(z7_str)

z7_is_pentagon(z7_str)

suggest_window_blocks_per_chunk(rs_src, ...)

extract_windows_with_bounds(raster_path[, ...])

get_crs_info(crs_wkt)

projected_distance(east1, north1, east2, north2)

get_raster_pixel_edge_len(rs_src, ...)

propose_dggs_level_for_pixel_length(...[, ...])

create_geopoints_for_window(full_transform, ...)

dggrid4py.igeo7_ext.dggrid_igeo7_cells_for_geo_points(geodf_points_wgs84, resolution, dggrid_instance, hier_ndx_form='DIGIT_STRING', column='name', **meta_overrides)

Assign IGEO7 Z7 cell ids at resolution to WGS84 points.

The point latitudes are converted to the authalic sphere before they are passed to DGGRID. Returns a copy of geodf_points_wgs84 (geometry unchanged, in WGS84) with the cell ids in column. Use dggrid_igeo7_grid_cell_polygons_from_cellids() to get the cell polygons for these ids.

dggrid4py.igeo7_ext.dggrid_igeo7_grid_cell_centroids_from_cellids(series, dggrid_instance, hier_ndx_form='DIGIT_STRING', to_geodetic=True, **meta_overrides)

Cell centroids for a list of IGEO7 Z7 cell ids (all of the same resolution).

Returns a GeoDataFrame in WGS84 (geodetic latitude), unless to_geodetic=False (then the coordinates stay on DGGRID’s authalic sphere).

dggrid4py.igeo7_ext.dggrid_igeo7_grid_cell_polygons_for_extent(clip_geom, resolution, dggrid_instance, hier_ndx_form='DIGIT_STRING', to_geodetic=True, **meta_overrides)

IGEO7 cell polygons at resolution covering clip_geom (a shapely geometry in WGS84).

The clip geometry is converted to the authalic sphere before it is passed to DGGRID, and the resulting cell polygons are converted back to WGS84 (unless to_geodetic=False).

dggrid4py.igeo7_ext.dggrid_igeo7_grid_cell_polygons_from_cellids(series, dggrid_instance, hier_ndx_form='DIGIT_STRING', to_geodetic=True, **meta_overrides)

Cell polygons for a list of IGEO7 Z7 cell ids (all of the same resolution).

Returns a GeoDataFrame in WGS84 (geodetic latitude), unless to_geodetic=False (then the coordinates stay on DGGRID’s authalic sphere).

dggrid4py.igeo7_ext.dggrid_igeo7_q2di_from_cellids(series, dggrid_instance, hier_ndx_form='DIGIT_STRING', **meta_overrides)

Q2DI (quad, i, j) addresses for a list of IGEO7 Z7 cell ids (all of the same resolution).

dggrid4py.igeo7_ext.igeo7_meta_config(hier_ndx_form='DIGIT_STRING', **overrides)

DGGRIDv8 meta configuration for IGEO7 with the Z7 index.

Parameters:
  • hier_ndx_form (str) – DIGIT_STRING (e.g. '003456231') or INT64 (DGGRID writes this as the 16 character Z7 hex string, e.g. '0042097fffffffff')

  • **overrides – any other DGGRID parameters, e.g. dggs_vert0_lon to change the default 11.20

Returns:

keyword arguments for the DGGRIDv8 functions

Return type:

dict

dggrid4py.igeo7_ext.z7_k1_ring_neighbours(z7_str, dggrid_instance, cls_m, stricter_clip=True, **meta_overrides)

Z7 ids (DIGIT_STRING form) of the direct neighbours of z7_str.

cls_m is the characteristic length scale of the resolution in metres (see dggrid_get_res()). All geometry work happens on DGGRID’s authalic sphere, so no WGS84 conversion is needed here.

dggrid4py.igeo7_ext.z7_resolution(cell_id, hier_ndx_form='DIGIT_STRING')

Resolution of a Z7 cell id in DIGIT_STRING or INT64 (hex string) form.