Skip to content

Commit

Permalink
Remove TODOs + add dataset record id to OAF
Browse files Browse the repository at this point in the history
  • Loading branch information
rkettelerij committed Jun 11, 2024
1 parent 7f93a34 commit 12bf19c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
5 changes: 2 additions & 3 deletions ngr_spider/ogc_api_features.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ def __init__(self, url):
self.service_url = url
self._load_landing_page(url)

# TODO Get correct info for featuretypes info when available
def get_featuretypes(self):
def get_featuretypes(self, dataset_metadata_id: str):
collection_list = []
collections = self.data.get_collections()
for collection in collections:
Expand All @@ -87,7 +86,7 @@ def get_featuretypes(self):
collection_name,
collection_title,
collection_abstract,
"",
dataset_metadata_id,
)
collection_list.append(featuretype)
return collection_list
Expand Down
6 changes: 2 additions & 4 deletions ngr_spider/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,6 @@ def get_atom_service(
return AtomService(service_record.service_url, r.text)


# TODO check correctness when test data is available, retrieve data from correct source/location
def get_oaf_service(
service_record: CswServiceRecord,
) -> Union[OafService, ServiceError]:
Expand All @@ -288,7 +287,7 @@ def get_oaf_service(
title = oaf.title or oaf.service_desc.get_info().title or ""
description = oaf.description or oaf.service_desc.get_info().description or ""

featuretypes=oaf.get_featuretypes()
featuretypes=oaf.get_featuretypes(ds_md_id)
for featuretype in featuretypes:
featuretype.dataset_metadata_id = service_record.dataset_metadata_id or ""

Expand All @@ -297,7 +296,7 @@ def get_oaf_service(
abstract=description,
metadata_id=md_id,
url=url,
featuretypes=oaf.get_featuretypes(),
featuretypes=oaf.get_featuretypes(ds_md_id),
keywords=oaf.service_desc.get_tags(),
dataset_metadata_id=ds_md_id,
)
Expand Down Expand Up @@ -514,7 +513,6 @@ def flatten_layer(layer):

protocol = service["protocol"]

# TODO? do we need specific functions for flattening OGC:API tiles/features?
if protocol == "INSPIRE Atom":
raise NotImplementedError( # TODO: move check to argument parse function
"Flat output for INSPIRE Atom services has not been implemented (yet)."
Expand Down

0 comments on commit 12bf19c

Please sign in to comment.