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
|
DGGRIDv8 meta configuration for IGEO7 with the Z7 index. |
IGEO7 cell polygons at |
|
Cell polygons for a list of IGEO7 Z7 cell ids (all of the same resolution). |
|
Cell centroids for a list of IGEO7 Z7 cell ids (all of the same resolution). |
|
|
Assign IGEO7 Z7 cell ids at |
|
Q2DI (quad, i, j) addresses for a list of IGEO7 Z7 cell ids (all of the same resolution). |
|
|
|
Resolution of a Z7 cell id in |
|
Z7 ids (DIGIT_STRING form) of the direct neighbours of |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- 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
resolutionto 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 incolumn. Usedggrid_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
resolutioncoveringclip_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') orINT64(DGGRID writes this as the 16 character Z7 hex string, e.g.'0042097fffffffff')**overrides – any other DGGRID parameters, e.g.
dggs_vert0_lonto change the default 11.20
- Returns:
keyword arguments for the DGGRIDv8 functions
- Return type:
- 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_mis the characteristic length scale of the resolution in metres (seedggrid_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_STRINGorINT64(hex string) form.