The user layers are defined in the project configuration under
`imports.map.layers`.
Multiple layers may be defined and each layer may consist of one
or more GeoJSON files. Files are retrieved via the /files/ API
endpoint.
- A single get() function is used both to list all available
layers, if no layer name is given, or a single layer.
- The database no longer holds the actual layer contents,
only the path to the layer file(s), so the list() function
is now redundant as we return the full payload in every case.
- The /gis/layer and /gis/layer/:name endpoints now have the same
payload structure.
- Now a layer may consist of a path pointing to a directory plus a
glob, or a path pointing directly to a single file.
- If a file already exists in the database, check if the layer
name has changed and if so, update it.
- Do not import the actual file contents, as the path is enough
(it can be retrieved via the /file/:path API endpoint).
This is a limited implementation of layer backgrounds. The API
supports an arbitrary number of arbitrarily named background
layers, but for the time being we only recognise one background
layer named `Background` and of GeoJSON type.
Certain properties, such a colour/color, opacity, etc., are
recognised and applied as feature styles. If not, a default
style is used.
As the survey definitions will no longer be stored in files
under etc/surveys/ but directly on the database, this
function replaces configuration.surveys()
The Dougal database will no longer store physical file paths
but rather logical ones, relative to (config.yaml).imports.paths.
These functions translate between physical and logical paths.
Used to download files. It relies on `imports.paths` being set
appropriately in `etc/config.yaml` to indicate which parts of
the filesystem are accessible to users via Dougal.