Skip to content

cells_for_geo_points doesn't work correctly withdggs_vert0_lon is set #46

@tik65536

Description

@tik65536

Problem:
When using cells_for_geo_points with dggs_vert0_lon set to 11.20, the resulting zone IDs are incorrect.

  1. Get zone centroids and ID using grid_cell_centroids_for_extent with dggs_vert0_lon == 11.20,
Image
  1. Using the zone centroids from above as input to cells_for_geo_points with the same dggs_vert0_lon setting. The result zone IDs are different.
Image

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:

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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions