Skip to content

Erroneous Koop Logger warnings on missing fields  #1115

@efbenson

Description

@efbenson

if (!featureField || hasTypeMismatch(type, featureField)) {

If the field value is an empty string it will log the error field definition "myFieldName (String)" not found in first feature of provider's GeoJSON

code probably should check on undefined

if (featureField === undefined || hasTypeMismatch(type, featureField)) {

Also the field pull function needs to be changed to use ?? otherwise empty string fails and returns undefined if no alias is defined

function findFeatureProperty(properties, name, alias) {
  return properties[name] ?? properties[alias];
}

Making those 2 changes locally correctly removed the issue

Other things with that logging I noticed:

  • if field is nullable and there is a null you get the log
  • If the field is a double and you pass in a float you get the log

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions