-
Notifications
You must be signed in to change notification settings - Fork 8
Description
Problem:
When using cells_for_geo_points with dggs_vert0_lon set to 11.20, the resulting zone IDs are incorrect.
- Get zone centroids and ID using
grid_cell_centroids_for_extentwithdggs_vert0_lon == 11.20,
- Using the zone centroids from above as input to
cells_for_geo_pointswith the samedggs_vert0_lonsetting. The result zone IDs are different.
Finding:
It is found that when dggs_vert0_lon is set for the cells_for_geo_points, the meta file output for DGGRID consists of :
dggs_vert0_lon 11.2
dggs_vert0_lat None
dggs_vert0_azimuth None
The extra setting dggs_vert0_lat None causes DGGRID to return incorrect zone IDs. After the dggs_vert0_lat is removed, all zone IDs are identical to the grid_cell_centroids_for_extent result.
After checking, the problem arises in the following code segment:
dggrid4py/dggrid4py/dggrid_runner.py
Lines 989 to 992 in dc7bd3a
| if subset_conf: | |
| for elem, value in subset_conf.items(): | |
| metafile.append(f"{elem} " + str(value)) | |
A quick fix will be to only append the setting with the value != None
A long-term solution is to restructure the code similar to dgapi_grid_gen, but this would take some time.