getTile method

Future<GetTileOutput> getTile({
  1. required String arn,
  2. required List<String> imageAssets,
  3. required TargetOptions target,
  4. required int x,
  5. required int y,
  6. required int z,
  7. String? executionRoleArn,
  8. bool? imageMask,
  9. OutputType? outputDataType,
  10. String? outputFormat,
  11. String? propertyFilters,
  12. String? timeRangeFilter,
})

Gets a web mercator tile for the given Earth Observation job.

May throw AccessDeniedException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter arn : The Amazon Resource Name (ARN) of the tile operation.

Parameter imageAssets : The particular assets or bands to tile.

Parameter target : Determines what part of the Earth Observation job to tile. 'INPUT' or 'OUTPUT' are the valid options.

Parameter x : The x coordinate of the tile input.

Parameter y : The y coordinate of the tile input.

Parameter z : The z coordinate of the tile input.

Parameter executionRoleArn : The Amazon Resource Name (ARN) of the IAM role that you specify.

Parameter imageMask : Determines whether or not to return a valid data mask.

Parameter outputDataType : The output data type of the tile operation.

Parameter outputFormat : The data format of the output tile. The formats include .npy, .png and .jpg.

Parameter propertyFilters : Property filters for the imagery to tile.

Parameter timeRangeFilter : Time range filter applied to imagery to find the images to tile.

Implementation

Future<GetTileOutput> getTile({
  required String arn,
  required List<String> imageAssets,
  required TargetOptions target,
  required int x,
  required int y,
  required int z,
  String? executionRoleArn,
  bool? imageMask,
  OutputType? outputDataType,
  String? outputFormat,
  String? propertyFilters,
  String? timeRangeFilter,
}) async {
  final $query = <String, List<String>>{
    'Arn': [arn],
    'ImageAssets': imageAssets,
    'Target': [target.value],
    if (executionRoleArn != null) 'ExecutionRoleArn': [executionRoleArn],
    if (imageMask != null) 'ImageMask': [imageMask.toString()],
    if (outputDataType != null) 'OutputDataType': [outputDataType.value],
    if (outputFormat != null) 'OutputFormat': [outputFormat],
    if (propertyFilters != null) 'PropertyFilters': [propertyFilters],
    if (timeRangeFilter != null) 'TimeRangeFilter': [timeRangeFilter],
  };
  final response = await _protocol.sendRaw(
    payload: null,
    method: 'GET',
    requestUri:
        '/tile/${Uri.encodeComponent(z.toString())}/${Uri.encodeComponent(x.toString())}/${Uri.encodeComponent(y.toString())}',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return GetTileOutput(
    binaryFile: await response.stream.toBytes(),
  );
}