Skip to content

[adjusters/foca] Exclude (by name) Skyguide features from FOCA dataset#30

Merged
mickmis merged 1 commit intomainfrom
12/filter-foca
Mar 17, 2026
Merged

[adjusters/foca] Exclude (by name) Skyguide features from FOCA dataset#30
mickmis merged 1 commit intomainfrom
12/filter-foca

Conversation

@mickmis
Copy link
Copy Markdown
Contributor

@mickmis mickmis commented Mar 12, 2026

Fix focagis/geoawareness-cis#12

I've opted to add a configuration option excluded_features_ed318_identifiers as I did not find a sensible way of parsing the Skyguide dataset. Please LMK if that's not OK and we can discuss how to do that.

Comment thread geospatial-utils/adjusters/foca.py Outdated
Comment thread geospatial-utils/adjusters/foca.py Outdated
Comment on lines +129 to +138
if "properties" not in f or f.properties is None:
return False
if "name" not in f.properties or f.properties.name is None:
return False

for name in f.properties.name:
if "text" not in name or name.text is None:
return False
if name.text in EXCLUDED_FEATURES_NAMES:
return True
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If other Features could be excluded for other reasons in the future, I would structure this to more easily allow that (see below). If this function is only ever going be used to exclude features by name, I would narrow the function name to reveal that choice (e.g., _feature_has_excluded_name or just _has_excluded_name).

Suggested change
if "properties" not in f or f.properties is None:
return False
if "name" not in f.properties or f.properties.name is None:
return False
for name in f.properties.name:
if "text" not in name or name.text is None:
return False
if name.text in EXCLUDED_FEATURES_NAMES:
return True
if "properties" in f and f.properties and "name" in f.properties and f.properties.name:
for name in f.properties.name:
if "text" in name and name.text in EXCLUDED_FEATURES_NAMES:
return True

Comment thread geospatial-utils/adjusters/foca.py Outdated
for za in f.properties.zoneAuthority:
za.purpose = _role_for(original_type)

# filter out features whose names are specified in EXCLUDED_FEATURES_NAMES
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With just my InterUSS hat on and naively reading the Issue, it seems like the exclusion might want to additionally or alternatively match on identifier (CTR0004, CTR0015)?

Either way, I would suggest not describing how _exclude_feature makes its decisions as that creates a brittle coupling between documentation and implementation:

Suggested change
# filter out features whose names are specified in EXCLUDED_FEATURES_NAMES
# filter out features that are intentionally excluded

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For background, the initial intention was to avoid duplicates between Skyguide and FOCA datasets by filtering out from the FOCA dataset the features that exist already in the Skyguide one, matching them on the name since the identifier is different (which is why in this PR I've opted for matching on the name).
And because deduplicating by comparing the two files does not seem to make sense within the context of this tool, I've opted for just listing the features to exclude.

But indeed the end result is not ideal. Matching on identifier and making this an additional parameter in the config (rather than part of the adjuster) seems more sensible, allow re-use, and enable easier changes in the future. I will modify this PR in consequence.

@mickmis
Copy link
Copy Markdown
Contributor Author

mickmis commented Mar 16, 2026

@BenjaminPelletier could you review the PR again? As I've changed it substantially. Thanks

@mickmis mickmis merged commit e261092 into main Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CTRs are published by Skyguide for u-space in Zurich.

2 participants