Skip to content

get_tile

get_tile(
    x: int,
    y: int,
    z: int,
    image_assets: StringListInput,
    target: TargetOptions,
    arn: EarthObservationJobArn,
    *,
    config_overrides: Optional[SageMakerGeospatialClientConfig] = None,
    image_mask: Optional[bool] = None,
    output_format: Optional[str] = None,
    time_range_filter: Optional[str] = None,
    property_filters: Optional[str] = None,
    output_data_type: Optional[OutputType] = None,
    execution_role_arn: Optional[ExecutionRoleArn] = None,
) -> Generator[GetTileOutput]

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

Parameters:

  • x (int) –

    The x coordinate of the tile input.

  • y (int) –

    The y coordinate of the tile input.

  • z (int) –

    The z coordinate of the tile input.

  • image_assets (StringListInput) –

    The particular assets or bands to tile.

  • target (TargetOptions) –

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

  • arn (EarthObservationJobArn) –

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

  • image_mask (Optional[bool], default: None ) –

    Determines whether or not to return a valid data mask.

  • output_format (Optional[str], default: None ) –

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

  • time_range_filter (Optional[str], default: None ) –

    Time range filter applied to imagery to find the images to tile.

  • property_filters (Optional[str], default: None ) –

    Property filters for the imagery to tile.

  • output_data_type (Optional[OutputType], default: None ) –

    The output data type of the tile operation.

  • execution_role_arn (Optional[ExecutionRoleArn], default: None ) –

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

Raises:

Source code in docs_src/capo_sagemaker_geospatial/_services/sage_maker_geospatial.py
@contextmanager
def get_tile(
    self,
    x: int,
    y: int,
    z: int,
    image_assets: "capo_sagemaker_geospatial.types.string_list_input.StringListInput",
    target: "capo_sagemaker_geospatial.types.target_options.TargetOptions",
    arn: "capo_sagemaker_geospatial.types.earth_observation_job_arn.EarthObservationJobArn",
    *,
    config_overrides: Optional[SageMakerGeospatialClientConfig] = None,
    image_mask: Optional[bool] = None,
    output_format: Optional[str] = None,
    time_range_filter: Optional[str] = None,
    property_filters: Optional[str] = None,
    output_data_type: Optional[
        "capo_sagemaker_geospatial.types.output_type.OutputType"
    ] = None,
    execution_role_arn: Optional[
        "capo_sagemaker_geospatial.types.execution_role_arn.ExecutionRoleArn"
    ] = None,
) -> "Generator[capo_sagemaker_geospatial.types.get_tile_output.GetTileOutput]":
    """<p>Gets a web mercator tile for the given Earth Observation job.</p>

    Args:
        x: <p>The x coordinate of the tile input.</p>
        y: <p>The y coordinate of the tile input.</p>
        z: <p>The z coordinate of the tile input.</p>
        image_assets: <p>The particular assets or bands to tile.</p>
        target: <p>Determines what part of the Earth Observation job to tile. 'INPUT' or 'OUTPUT' are the valid options.</p>
        arn: <p>The Amazon Resource Name (ARN) of the tile operation.</p>
        image_mask: <p>Determines whether or not to return a valid data mask.</p>
        output_format: <p>The data format of the output tile. The formats include .npy, .png and .jpg.</p>
        time_range_filter: <p>Time range filter applied to imagery to find the images to tile.</p>
        property_filters: <p>Property filters for the imagery to tile.</p>
        output_data_type: <p>The output data type of the tile operation.</p>
        execution_role_arn: <p>The Amazon Resource Name (ARN) of the IAM role that you specify.</p>

    Raises:
        capo_sagemaker_geospatial.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_sagemaker_geospatial.errors.internal_server_exception.InternalServerException: <p>The request processing has failed because of an unknown error, exception, or failure.</p>
        capo_sagemaker_geospatial.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request references a resource which does not exist.</p>
        capo_sagemaker_geospatial.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_sagemaker_geospatial.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
        capo_sagemaker_geospatial.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_sagemaker_geospatial.types.get_tile_input.GetTileInput]",
    ) -> OperationResponse[
        "capo_sagemaker_geospatial.types.get_tile_output.GetTileOutput"
    ]:
        import capo_sagemaker_geospatial._operations.sage_maker_geospatial.get_tile

        output, http_response = (
            capo_sagemaker_geospatial._operations.sage_maker_geospatial.get_tile.get_tile(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_sagemaker_geospatial.types.get_tile_output.GetTileOutput",
    ) -> dict[str, Any]:
        import capo_sagemaker_geospatial.types.get_tile_output

        return capo_sagemaker_geospatial.types.get_tile_output.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetTile", redact_output=_redact_output)
    )
    input_: capo_sagemaker_geospatial.types.get_tile_input.GetTileInput = {
        "x": x,
        "y": y,
        "z": z,
        "image_assets": image_assets,
        "target": target,
        "arn": arn,
    }
    if image_mask is not None:
        input_["image_mask"] = image_mask
    if output_format is not None:
        input_["output_format"] = output_format
    if time_range_filter is not None:
        input_["time_range_filter"] = time_range_filter
    if property_filters is not None:
        input_["property_filters"] = property_filters
    if output_data_type is not None:
        input_["output_data_type"] = output_data_type
    if execution_role_arn is not None:
        input_["execution_role_arn"] = execution_role_arn

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    try:
        yield response.output
    finally:
        response.response.close()