populateFromService method

Future<FeatureQueryResult> populateFromService({
  1. QueryParameters? parameters,
  2. required bool clearCache,
  3. required List<String> outFields,
})

Populate the OGC API - Features feature collection table with the results of a query.

Use the default (empty) QueryParameters to get all features from the service. Specifying null or an empty List for outfields will result in the default set of outfields being used. Spatial queries (those that specify geometries) must use the Intersects spatial relationship.

Parameters:

  • parameters — Parameters that define how features are returned from the service.
  • clearCache — If true, clears existing table data before populating it with features returned from the service.
  • outFields — A List containing String.

Return Value: A Future that returns a FeatureQueryResult type.

Implementation

Future<FeatureQueryResult> populateFromService({
  QueryParameters? parameters,
  required bool clearCache,
  required List<String> outFields,
}) {
  final coreOutFields = outFields.toMutableArray(
    valueType: _ElementType.string,
  );
  final taskHandle = _withThrowingErrorHandler((errorHandler) {
    return runtimecore.RT_OGCFeatureCollectionTable_populateFromService(
      _handle,
      parameters?._handle ?? ffi.nullptr,
      clearCache,
      coreOutFields._handle,
      errorHandler,
    );
  });
  return taskHandle.toFuture(
    (element) => element.getValueAsFeatureQueryResult()!,
  );
}