OGCAPIFeatures class
A class with static factory methods to create feature sources conforming to the OGC API Features standard.
A basic sample how to access and read metadata and geospatial feature items from a feature service compliant with OGC API Features standard.
// 1. Get a client instance for a Web API endpoint.
final client = OGCAPIFeatures.http(endpoint: Uri.parse('...'));
// 2. Access/check metadata (meta, OpenAPI, conformance, collections) as needed.
final conformance = await client.conformance();
if (!conformance.conformsToFeaturesCore(geoJSON: true)) {
return; // not conforming to core and GeoJSON - so return
}
// 3. Get a feature source for a specific collection.
final source = await client.collection('my_collection');
// 4. Access (and check) metadata for this collection.
final meta = await source.meta();
print('Collection title: ${meta.title}');
// 5. Access feature items.
final items = await source.itemsAll(limit: 100);
// 6. Check response metadata.
print('Timestamp: ${items.timeStamp}');
// 7. Get an iterable of feature objects.
final features = items.collection.features;
// 8. Loop through features (each with id, properties and geometry)
for (final feat in features) {
print('Feature ${feat.id} with geometry: ${feat.geometry}');
}
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
http(
{required Uri endpoint, Client? client, Map< String, String> ? headers, Map<String, String> ? extraParams, TextReaderFormat<FeatureContent> format = GeoJSON.feature, Duration metaMaxAge = const Duration(minutes: 15)}) → OGCFeatureService -
A client for accessing
OGC API Features
compliant sources via http(s) conforming toformat
.