FeatureCollectionTable constructor

FeatureCollectionTable({
  1. required List<Field> fields,
  2. required GeometryType geometryType,
  3. SpatialReference? spatialReference,
  4. bool hasZ = false,
  5. bool hasM = false,
})

Creates an empty FeatureCollectionTable from the specified fields, geometry type, spatial reference. The table can contain z and m values.

Parameters:

  • fields — A List of type Field. Contents of the List will be copied. Can be null.
  • geometryType — The type of geometry that will be held in this table. Can be GeometryType.unknown.
  • spatialReference — The spatial reference of the features that will be held in this table. Can be null as long as geometry_type is GeometryType.unknown.
  • hasZ — Boolean specifying whether the table supports geometries with Z values.
  • hasM — Boolean specifying whether the table supports geometries with M values.

Implementation

factory FeatureCollectionTable({
  required List<Field> fields,
  required GeometryType geometryType,
  SpatialReference? spatialReference,
  bool hasZ = false,
  bool hasM = false,
}) {
  _initializeArcGISEnvironmentIfNeeded();
  final coreFields = fields.toMutableArray(
    valueType: _ElementType.field,
  );
  final handle = _withThrowingErrorHandler((errorHandler) {
    return runtimecore.RT_FeatureCollectionTable_createWithZM(
      coreFields._handle,
      geometryType.coreValue,
      spatialReference?._handle ?? ffi.nullptr,
      hasZ,
      hasM,
      errorHandler,
    );
  });
  final FeatureCollectionTable object =
      FeatureTable._instanceCache.instanceWith(handle);
  object._fields.value.setCache(fields);
  object._spatialReference.cache(spatialReference);
  return object;
}