New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restructuring web api client for geospatial data #46
Comments
Restuctured and refactored the codebase for New folder structure:
And minilibraries as described on readme: The package contains also following mini-libraries, that can be used to import
All the mini-libraries have dependencies to equatable and geocore packages. The geojson_client and ogcapi_features_client libraries depends also on the http package. The geojson_client package uses Generic feature data source defined on common: /// A feature source providing geospatial features.
abstract class FeatureSource<ItemType extends FeatureItem,
ItemsType extends FeatureItems> {
/// Fetches a single feature by id (set in [query]) from this source.
///
/// Throws [FeatureException] in a case of a failure.
Future<ItemType> item(FeatureItemQuery query);
/// Fetches features matching [query] from this source.
///
/// This call accesses only one set of feature items (number of returned items
/// can be limited).
///
/// Throws [FeatureException] in a case of a failure.
Future<ItemsType> items(FeatureItemsQuery query);
/// Fetches features (as paged sets) matching [query] from this source.
///
/// This call returns a first set of feature items (number of returned items
/// can be limited), with a link to an optional next set of feature items.
///
/// Throws [FeatureException] in a case of a failure.
Future<Paged<ItemsType>> itemsPaged(FeatureItemsQuery query);
}
GeoJSON implementation implements this data source as is.
OGC API Features implementation specializes the data source:
```dart
/// A feature source compliant with the OGC API Features standard.
abstract class OGCFeatureSource
extends FeatureSource<OGCFeatureItem, OGCFeatureItems> {
/// Get metadata about the feature collection represented by this source.
Future<CollectionMeta> meta();
} .. and a service is modeled: /// A feature service compliant with the OGC API Features standard.
abstract class OGCFeatureService {
/// Get meta data (or "landing page" information) about this service.
Future<ResourceMeta> meta();
// todo API description: api();
/// Conformance classes this service is conforming to.
Future<Iterable<String>> conformance();
/// Get metadata about feature collections provided by this service.
Future<Iterable<CollectionMeta>> collections();
/// Get a feature source for a feature collection identified by [id].
Future<OGCFeatureSource> collection(String id);
} |
Implemented in pre-release |
DRAFT for some future version (0.8 or 0.9 maybe).
Planned structure for restructuring web api client for geospatial data, something like this
Services do not have common abstractions, as different services differ so much starting from standard specific stuff.
However
FeatureStore
above is meant to be common abstraction, letting accessing features (or other geospatial data) from different service types with shared interface. Services just provide async methods to access remote and local resources. Stores uses services, and may combine different services, and may cache data, and has mechanism to notify listeners.The text was updated successfully, but these errors were encountered: