koopjs / FeatureServer

An open source Geoservices Implementation (deprecated)
https://geoservices.github.io
Other
101 stars 32 forks source link

Refactor layer/layers metadata handlers. #218

Closed rgwozdz closed 2 years ago

rgwozdz commented 2 years ago

Motivation

Provider plugins can pass in options to override default values for layer metadata. Unfortunately, the patterns for doing so have been haphazard. Sometimes options are set at the geojson root-level, other times in geojson.metadata, and sometimes on the request.query object. This variable approach to options, as well as the legacy design pattern for overriding defaults with options, makes the code difficult to read, test, maintain and extend.

This PR refactors the generation of layer-metadata, leveraging a class based approach that abstract the more complex default overriding to class methods.

Almost a third of the file changes are deletes, and most others are minor changes related to decoupling.