Skip to content

Commit

Permalink
Merge pull request #13 from DARPA-CRITICALMAAS/legend_ingest_fixs
Browse files Browse the repository at this point in the history
CDR Legend ingestion fixes
  • Loading branch information
asaxton authored Aug 6, 2024
2 parents c3492ac + 6cfa950 commit 961b5d6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cdrhook/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ def convert_cdr_schema_metadata_to_cmass_map_metadata(cdr_metadata:CogMetadataSc
return map_metadata

def convert_cdr_schema_legend_items_to_cmass_legend(cdr_legend:List[LegendItemResponse]) -> Legend:
if len(cdr_legend) == 0:
return None
legend = Legend(provenance=Provenance(name=cdr_legend[0].system, version=cdr_legend[0].system_version))
for item in cdr_legend:
map_unit = MapUnit(type=MapUnitType.from_str(item.category.lower()))
Expand All @@ -32,6 +34,8 @@ def convert_cdr_schema_legend_items_to_cmass_legend(cdr_legend:List[LegendItemRe
return legend

def convert_cdr_schema_area_extraction_to_layout(cdr_area_extraction:List[AreaExtractionResponse]) -> Layout:
if len(cdr_area_extraction) == 0:
return None
layout = Layout(provenance=Provenance(name=cdr_area_extraction[0].system, version=cdr_area_extraction[0].system_version))
for area in cdr_area_extraction:
if area.category == 'map_area':
Expand Down

0 comments on commit 961b5d6

Please sign in to comment.