@kalisio/kfs
v1.5.0
Published
Kalisio Features Services
Readme
kfs
Kalisio Features Service
kfs is a lightweight service that let you distribute geospatial data from applications developed using the Kalisio Development Kit like Kano using the OGC API Features standard (a.k.a. WFS v3).
Each service-based layer from Kano will generate two or one feature collection(s) depending if probes are used or not.
Note:
Under-the-hood feathers-distributed is used to access exposed services.
API
Please refer to the OGC API Features standard for details. Here are the current limitations:
- only the Part 1 of the standard is implemented
- only the GeoJson encoding is supported
- only a bbox in WGS 84 CRS is supported
- the following CQL filtering operators are supported
- logical operators
and,or,not - comparison operators
eq,lt,gt,lte,gte - spatial operators
intersects,within - temporal operators
before,after,during(targetting instant property not interval)
- logical operators
Note:
Only CQL JSON encoding is fully supported, only spatial filters are supported for CQL in text encoding.
/healthcheck (GET)
Check for the health of the service
Configuring
Here are the environment variables you can use to customize the service:
| Variable | Description | Defaults |
|-----------| ------------| ------------|
| HOSTNAME | Hostname | localhost |
| PORT | Port the API will respond on | 8081 |
| BASE_URL | Base service URL to be used to fill links | http://${hostname}:${port} |
| API_PREFIX | Prefix used on API routes | /api |
| LIMIT | Default pagination limit | 500 |
| OFFSET | Default pagination offset | 0 |
| MAX | Maximum pagination limit. If this value is set, it overrides the paginate.max value for all services. | null |
| DEBUG | The namespaces to enable debug output. Set it to kfs:* to enable full debug output. | - |
Note:
The pagination options from the FeatherJS services (
paginate.default,paginate.max) are retrieved and compared to the default limit set by KFS. If the default or maximum FeatherJS service limit is lower then it will be used instead as requiring more data will not work.
local.cjs
By default, kfs only exposes features services provided by Kano. You can write a local.cjs file to alter the default configuration.
Here is an example file that exposes services from another application:
module.exports = {
distribution: {
// Application key in feathers-distributed
remoteServices: (service) => (service.key === 'myapp')
},
// Declare here any additional service that is not a features service but complies its GeoJson interface
services: (serviceName, service) => {
// This specific service complies a GeoJson interface using a specific query parameters
if (serviceName === 'myservice') return {
query: { geoJson: true }
}
}
}Building
Manual build
You can build the image with the following command:
docker build -t <your-image-name> .Automatic build using Travis CI
This project is configured to use Travis to build and push the image on the Kalisio's Docker Hub.
The built image is tagged using the version property in the package.json file.
To enable Travis to do the job, you must define the following variable in the corresponding Travis project:
| Variable | Description |
|-----------| ------------|
| DOCKER_USER | your username |
| DOCKER_PASSWORD | your password |
Deploying
This image is designed to be deployed using the Kargo project.
Testing
To run the internal tests, use the subcommand test:
yarn testTo run the OGC API - Features Conformance Test Suite - available at https://github.com/opengeospatial/ets-ogcapi-features10 - the most simple way is to use the Docker container. In this case take care to use your local IP address and not localhost that will not work, run KFS with HOSTNAME=your_ip.
You can also run it manually like this:
- use the JAR file provided in
testor download the "all-in-one" JAR file that includes the test suite and all of its dependencies (e.g.1.7version) on the Maven central repository, - update the target URL in the
test/test-run-props.xmlfile if required - run the following command
java -jar ets-ogcapi-features10-1.7-aio.jar -o /path/to/output -h /path/to/test-run-props.xml
A useful tool to check your OpenAPI specification conformance is redocly-cli.
Contributing
Please read the Contributing file for details on our code of conduct, and the process for submitting pull requests to us.
Authors
This project is sponsored by

License
This project is licensed under the MIT License - see the license file for details
