terrestris / react-geo

A set of geo related modules to use in combination with React, Ant Design and OpenLayers.
https://terrestris.github.io/react-geo/
BSD 2-Clause "Simplified" License
372 stars 58 forks source link

WFS DescribeFeature utility methods #567

Open marcjansen opened 6 years ago

marcjansen commented 6 years ago

This came up as a possible enhancement during the implementation of the WfsSearch #563.

I think it would be very usable to have some methid to determine fields from the DescribeFeatureType response. Sth. like:

fieldsFromDescribeFeatureType(describeFeatureTypeResponse, filterFn) {
  // returns an array of field objects with name, datatype, min and max etc.
}
fieldsFromFeatureType(wfsUrl, featureTypeName, filterFn) {
  // returns a promise, and eventually an array of fields
  // issue the correct DescribeFeatureType Request,
  // once we have the response call the above method
}

If one only want the names, one could provide a fieldFn, which decides how a field should be represented.

We should additionally have some utilitues to only fetch string-like fields which can be used for LIKE searches.

marcjansen commented 6 years ago

Is this still of relevance?

dnlkoch commented 6 years ago

Yes, the mentioned method isn't available at the moment, but I would prefer to have it placed in the ol-util repo.