Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Erroneous Koop Logger warnings on missing fields #1115

Open
efbenson opened this issue Sep 26, 2024 · 0 comments
Open

Erroneous Koop Logger warnings on missing fields #1115

efbenson opened this issue Sep 26, 2024 · 0 comments

Comments

@efbenson
Copy link

efbenson commented Sep 26, 2024

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
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

No branches or pull requests

1 participant