createFromFiles static method

Future<DiscreteField> createFromFiles({
  1. required List<Uri> filePaths,
  2. required int band,
  3. SpatialReference? spatialReference,
})

Creates a discrete field from one or more raster files.

If no spatial reference is given, the spatial reference of the first raster file is used.

If a spatial reference is given, the raster content is projected into that spatial reference using the most suitable transformation available. Projection transforms only the horizontal coordinate system, not the field values.

The field extent is the union of the raster file extents.

Supports reading of all raster pixel types except float (32-bit or 64-bit). 32-bit signed integer data is supported for rasters that don't contain values greater than 2147483647. If values exceed this, creation of the field will fail. Returns an error if creation of a DiscreteField is unsuccessful.

Parameters:

  • filePaths — One or more raster file paths.
  • band — Zero-based index identifying a raster band.
  • spatialReference — The spatial reference into which to project the raster content.

Return Value: A DiscreteField created from raster files, or an error if creation of a DiscreteField is unsuccessful.