GeoEco.SpatialAnalysis.Interpolation.Interpolator.InterpolateArcGISRasterValuesAtPoints

classmethod Interpolator.InterpolateArcGISRasterValuesAtPoints(rasters, points, fields, method='Automatic', where=None, noDataValue=None, rastersWrap=False, orderByFields=None, numBlocksToCacheInMemory=None, xBlockSize=None, yBlockSize=None)

Interpolates the values of rasters at points.

This tool provides the same capability as the ArcGIS Spatial Analyst’s Extract Values to Points tool, but offers some additional options and does not require a Spatial Analyst license to run.

Requires: ArcGIS Pro 3.2.0 or later or ArcGIS Server equivalent to ArcGIS Pro 3.2.0 or later, Python numpy module, Python bindings for the Geospatial Data Abstraction Library (GDAL).

Parameters:
  • rasters (list of str) – Rasters or raster layers to interpolate values from. Minimum length꞉ 1.

  • points (str) – Feature class or layer containing the points at which values should be interpolated. It is recommended but not required that the points and rasters use the same coordinate system. If they do not, this tool will attempt to project the points to the coordinate system of the rasters prior to doing the interpolation. This may fail if a datum transformation is required, in which case you will have to manually project the points and rasters to the same coordinate system before using this tool. Minimum length꞉ 1. Must exist.

  • fields (list of str) – Fields of the points to receive the interpolated values. You must provide a field for each raster. The fields must have floating-point or integer data types. If a field cannot represent the interpolated value at full precision, the closest approximation will be stored and a warning will be issued. This will happen, for example, when the raster uses a floating point data type but the field uses an integer data type. Minimum length꞉ 1. Must have the same length as rasters.

  • method (str, optional) –

    Interpolation method to use, one of:

    • Automatic - the tool will automatically select the interpolation method based on the data type of the raster: for integer rasters, nearest neighbor interpolation will be used; for floating-point rasters, linear interpolation will be used. This is the default.

    • Nearest - nearest neighbor interpolation. The interpolated value will simply be the value of the cell that contains the point.

    • Linear - linear interpolation (also known as bilinear interpolation). This method is suitable for continuous data, such as sea surface temperatures, but is not appropriate for categorical data (use nearest neighbor for categorical data). This method averages the values of the four nearest cells, weighting the contribution of each cell by the area of it that would be covered by a hypothetical cell centered on the point being interpolated. If the cell containing the point contains NoData, the result is NoData. Otherwise, and the result is based on the weighted average of the four nearest cells that do contain data, including the one that contains the cell. If any of the other three cells contain NoData, they are omitted from the average. This is the same algorithm implemented by the ArcGIS Spatial Analyst’s ExtractValuestoPoints() tool.

    Allowed values꞉ 'Automatic', 'Nearest', 'Linear'.

  • where (str, optional) –

    SQL WHERE clause expression that specifies the subset of points to process. If not provided, all of the points will be processed. If provided but the underlying storage format does not support WHERE clauses, an exception will be raised.

    The exact syntax of this expression depends on the underlying storage format. If the underlying data store will be accessed through ArcGIS, this article may document some of the possible syntax, but not all of it may be supported through ArcGIS’s underlying Python API.

    Minimum length꞉ 1.

  • noDataValue (float, optional) – Value to use when the interpolated value is NoData. If a value is not provided for this parameter, a database NULL value will be stored in the field when the interpolated value is NoData. If the field cannot store NULL values, as is the case with shapefiles, the value -9999 will be used.

  • rastersWrap (bool, optional) – Indicates whether or not the left and right edges of the rasters should be treated as connected. Enable this option when you have rasters that span 360 degrees of longitude and you wish the interpolator to consider cells on the opposite side of the raster when interpolating values for points very close to the left or right edge. This option has no effect if nearest neighbor interpolation is used, because the interpolated value will be based on the value of the single nearest cell.

  • orderByFields (list of str, optional) – Fields for defining the order in which the points are processed. The points may be processed faster if they are ordered geographically, such that points that are close in geographic space are processed sequentially. Ordering the points this way increases the probability that the value of a given point can be interpolated from data that is cached in memory, rather than from data that must be read from the disk or network, which is much slower. Choose fields that facilitate this. For example, if your points represent the locations of animals tracked by satellite telemetry, order the processing first by the animal ID and then by the transmission date or number. Minimum length꞉ 1.

  • numBlocksToCacheInMemory (int, optional) –

    Maximum number of blocks of data to cache in memory.

    To minimize the number of times that the disk or network must be accessed, this tool employs a simple caching strategy. When it processes the first point, it reads a square block of cells centered on that point and caches it in memory. When it processes the second and subsequent points, it first checks whether the cells needed for that point are contained by the block cached in memory. If so, it processes that point using the in-memory block, rather than reading from disk or the network again. If not, it reads another square block centered on that point and adds it to the cache.

    The tool processes the remaining points, adding additional blocks to the cache, as needed. To prevent the cache from exhausting all memory, it is only permitted to grow to the size specified by this parameter. When the cache is full but a new block is needed, the oldest block is discarded to make room for the newest block.

    If this parameter is 0, no blocks will be cached in memory.

    Minimum value꞉ 0.

  • xBlockSize (int, optional) – Size of the blocks of data to cache in memory in the x direction. The size is given as the number of cells. If this parameter is 0, no blocks will be cached in memory. Minimum value꞉ 0.

  • yBlockSize (int, optional) – Size of the blocks of data to cache in memory in the y direction. The size is given as the number of cells. If this parameter is 0, no blocks will be cached in memory. Minimum value꞉ 0.

Returns:

Updated points.

Return type:

str