A diagram describing the most important interfaces and classes needed when
interacting with API services compliant with the
OGC API Features standard:
Create feature service client instances
An OGC API Features service client can be created using the
OGCAPIFeatures.http() constructor that is defined as:
This returns a client for accessing OGC API Features compliant sources via
http(s) conforming to format.
Documentation about constructor parametrs:
The required endpoint should refer to a base url of a feature service.
When given an optional client is used for http requests, otherwise the default client of the package:http/http.dart package is used (a new instance of default client for each service request). When client is given, this allows a client to better maintain persistent connections to a service, but it’s also responsibility of a caller to close it appropriately. It’s also possible to set a standard RetryClient instance when retry-logic is needed.
When given headers are injected to http requests as http headers (however some can be overridden by the feature service implementation).
When given extraParams are injected to query part of http requests (however some can be overridden by the feature service implementation).
When format is not given, then GeoJSON with default settings is used as a default. Note that currently only GeoJSON is supported, but it’s possible to inject another format implementation (or with custom configuration) to the default one.
metaMaxAge specifies a max age to cache metadata objects retrieved from a service and that are cached internally (in-memory) by this client.
Using feature service clients
The OGC API Features service client created by OGCAPIFeatures.http() for some
endpoint has the following signature:
Using feature sources provided by service clients
The feature source returned by collection() provides following methods:
Specifying queries
Queries for items and itemsPaged are normally specified by
BoundedItemsQuery instances:
Feature collection data returned from feature sources
Methods accessing multiple feature items return a future of `OGCFeatureItems“
which provides:
Feature objects are available from the collection property. See the
geospatial features
chapter in the geobase package for more
information about Feature and FeatureCollection objects.
Information about queryable properties
The queryables metadata from a feature source is provide information about
queryable properties that a service supports: