Skip to content

Commit

Permalink
Update outfields in metadata files
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewMuehlhauserNRCan committed Dec 10, 2024
1 parent b9f0335 commit e773629
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 24 deletions.
12 changes: 5 additions & 7 deletions packages/geoview-core/public/datasets/geojson/metadata1.meta
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,11 @@
"queryable": true,
"nameField": "Project",
"outfields": [
[
{ "name": "program", "alias": "Program", "type": "string", "domain": null },
{ "name": "project_id", "alias": "Project ID", "type": "string", "domain": null },
{ "name": "geom_type", "alias": "Geometry type", "type": "string", "domain": null },
{ "name": "geom_area", "alias": "Geometry area", "type": "string", "domain": null },
{ "name": "SRID", "alias": "SRID", "type": "string", "domain": null }
]
{ "name": "program", "alias": "Program", "type": "string", "domain": null },
{ "name": "project_id", "alias": "Project ID", "type": "string", "domain": null },
{ "name": "geom_type", "alias": "Geometry type", "type": "string", "domain": null },
{ "name": "geom_area", "alias": "Geometry area", "type": "string", "domain": null },
{ "name": "SRID", "alias": "SRID", "type": "string", "domain": null }
]
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,17 @@
"queryable": "true",
"nameField": "label_en",
"outfields": [
[
{ "name": "label_en", "alias": "label_en", "type": "string", "domain": null },
{ "name": "percentile_en", "alias": "percentile_en", "type": "string", "domain": null },
{ "name": "period_en", "alias": "period_en", "type": "string", "domain": null },
{ "name": "scenario_en", "alias": "scenario_en", "type": "string", "domain": null },
{ "name": "time_begin", "alias": "time_begin", "type": "date", "domain": null },
{ "name": "time_end", "alias": "time_end Date", "type": "date", "domain": null },
{ "name": "time_step", "alias": "time_step", "type": "string", "domain": null },
{ "name": "uom", "alias": "uom", "type": "string", "domain": null },
{ "name": "value_type_en", "alias": "value_type_en", "type": "string", "domain": null },
{ "name": "variable_en", "alias": "variable_en", "type": "string", "domain": null },
{ "name": "values", "alias": "values", "type": "number", "domain": null }
]
{ "name": "label_en", "alias": "label_en", "type": "string", "domain": null },
{ "name": "percentile_en", "alias": "percentile_en", "type": "string", "domain": null },
{ "name": "period_en", "alias": "period_en", "type": "string", "domain": null },
{ "name": "scenario_en", "alias": "scenario_en", "type": "string", "domain": null },
{ "name": "time_begin", "alias": "time_begin", "type": "date", "domain": null },
{ "name": "time_end", "alias": "time_end Date", "type": "date", "domain": null },
{ "name": "time_step", "alias": "time_step", "type": "string", "domain": null },
{ "name": "uom", "alias": "uom", "type": "string", "domain": null },
{ "name": "value_type_en", "alias": "value_type_en", "type": "string", "domain": null },
{ "name": "variable_en", "alias": "variable_en", "type": "string", "domain": null },
{ "name": "values", "alias": "values", "type": "number", "domain": null }
]
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -578,10 +578,8 @@ export abstract class AbstractGVLayer extends AbstractBaseLayer {
dictFieldTypes[fieldName] = this.getFieldType(fieldName);
}
const fieldType = dictFieldTypes[fieldName];

if (outfields?.find((outfield) => outfield.name === fieldName)) {
const fieldEntry = outfields.find((outfield) => outfield.name === fieldName);

const fieldEntry = outfields?.find((outfield) => outfield.name === fieldName);
if (fieldEntry) {
featureInfoEntry.fieldInfo[fieldName] = {
fieldKey: fieldKeyCounter++,
value: this.getFieldValue(feature, fieldName, fieldEntry!.type as 'string' | 'number' | 'date'),
Expand Down

0 comments on commit e773629

Please sign in to comment.