GeoEco.SpatialAnalysis.Interpolation.Interpolator.InterpolateGridsValuesForTableOfPoints

classmethod Interpolator.InterpolateGridsValuesForTableOfPoints(grids, table, fields, xField=None, yField=None, zField=None, tField=None, xValue=None, yValue=None, zValue=None, tValue=None, spatialReference=None, where=None, orderBy=None, method='Automatic', noDataValue=None, gridsWrap=False, useAbsZ=False, seafloorZValue=None, numBlocksToCacheInMemory=None, xBlockSize=None, yBlockSize=None, zBlockSize=None, tBlockSize=None)

Interpolates the values of Grids at points represented as rows of a Table.

Requires: Python numpy module, Python bindings for the Geospatial Data Abstraction Library (GDAL).

Parameters:
  • grids (list of Grid) – List of Grids to interpolate values from. The grids must all have the same dimensions (i.e. all yz, all zyx, all tyx, or all tzyx), but are allowed to have different coordinate systems, spatial extents, cell sizes, shapes, data types, and NoData values. Minimum length꞉ 1.

  • table (Table) – Table containing the points at which values should be interpolated. It is recommended but not required that the points and grids use the same coordinate system. If they do not, this tool will attempt to project the points to the coordinate systems of the grids prior to doing the interpolations. This may fail if a datum transformation is required, in which case you will have to manually project the points and grids to the same coordinate system before using this function.

  • fields (list of str) – Fields of the Table to receive the interpolated values. You must provide a field for each grid. 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 grid uses a floating point data type but the field uses an integer data type. Minimum length꞉ 1. Must have the same length as grids.

  • xField (str, optional) – Field from which the x coordinate should be taken. The field must have a floating point or integer data types. If provided, yField must also be provided. If not provided, the x coordinate will be taken from xValue. If that is not provided, the x coordinate will be taken from the geometry field. If the table has no geometry field, an exception will be raised. Minimum length꞉ 1.

  • yField (str, optional) – Field from which the y coordinate should be taken. The field must have a floating point or integer data types. If provided, xField must also be provided. If not provided, the y coordinate will be taken from yValue. If that is not provided, the y coordinate will be taken from the geometry field. If the table has no geometry field, an exception will be raised. Minimum length꞉ 1.

  • zField (str, optional) – Field from which the z coordinate (depth) should be taken. Ignored if the grids do not have a z dimension. The field must have a floating point or integer data type. If not provided, the z coordinate will be taken from zValue. If that is not provided, the z coordinate will be taken from the geometry field. If the table has no geometry field, or the geometry field does not include a z coordinate, an exception will be raised. Minimum length꞉ 1.

  • tField (str, optional) – Field from which the t coordinate (time) should be taken. Ignored if the grids do not have a t dimension. The field must have a datetime data type. (If the field can only represent dates with no time component, the time will assumed to be 00:00:00.) If not provided, the t coordinate will be taken from tValue. If that is not provided, an exception will be raised. Minimum length꞉ 1.

  • xValue (float, optional) – Value to use for the x coordinate. Ignored if xField is provided. If provided, yValue must also be provided. If neither xField nor xValue are provided, the x coordinate will be taken from the geometry field. If the table has no geometry field, an exception will be raised.

  • yValue (float, optional) – Value to use for the y coordinate. Ignored if yField is provided. If provided, xValue must also be provided. If neither yField nor yValue are provided, the y coordinate will be taken from the geometry field. If the table has no geometry field, an exception will be raised.

  • zValue (float, optional) – Value to use for the z coordinate. Ignored if the grids do not have a z dimension or zField is provided. Otherwise, if neither zField nor zValue are provided, the z coordinate will be taken from the geometry field. If the table has no geometry field, or the geometry field does not include a z coordinate, an exception will be raised.

  • tValue (datetime, optional) – Value to use for the t coordinate. Ignored if the grids do not have a t dimension or tField is provided. Otherwise, if neither tField nor tValue are provided, an exception will be raised.

  • spatialReference (object, optional) – osgeo.osr.SpatialReference instance defining the spatial reference for the table. Ignored if neither xField nor xValue are provided or neither yField nor yValue are provided, in which case the spatial reference will be extracted from the table’s geometry field. Otherwise, if spatialReference is not provided, the values present in xField/xValue and yField/yValue are assumed to be in the same coordinate system as the grids.

  • where (str, optional) – SQL WHERE clause expression that specifies the subset of rows to process. If not provided, all of the rows 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.

  • orderBy (str, optional) –

    SQL ORDER BY clause that specifies the order in which the rows should be processed. If not provided, the rows will processed according to the default behavior of the underlying storage format and the programming library used to access it.

    The ORDER BY clause must be a comma-separated list of fields. Each field can optionally be followed by a space and the word ASC to indicate ascending order or DESC to indicate descending order. If neither is specified, ASC is assumed.

    The underlying storage format and library perform the actual evaluation of this parameter and determine the rules of sorting, such as whether string comparisons are case-sensitive or case-insensitive. At present, there is no mechanism to interrogate or manipulate these rules; you must live with the default behavior of the underlying format and library.

    Minimum length꞉ 1. Must match regular expression꞉ \s*\S+(\s+([aA][sS][cC]|[dD][eE][sS][cC]))?\s*(,\s*\S+(\s+([aA][sS][cC]|[dD][eE][sS][cC]))?\s*)*.

  • method (str, optional) –

    Interpolation method to use, one of:

    • Automatic - the tool will automatically select the interpolation method based on each grid’s data type: for integer grids, nearest neighbor interpolation; for floating-point grids, linear interpolation. 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. If the grid has two dimensions (yx), 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 grid has three dimensions (zyx or tyx), the eight nearest cells will be used (a cube). If the grid has four dimensions (tzyx), the 16 nearest cells will be used (a hypercube). If the cell containing the point contains NoData, the result is NoData. If any of the other cells to be averaged contain NoData, they are omitted from the average, and the result is based on the weighted average of the cells that do contain data.

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

  • 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.

  • gridsWrap (bool, optional) – Indicates whether or not the left and right edges of the grids should be treated as connected. Enable this option when you have grids that span 360 degrees of longitude and you wish the interpolator to consider cells on the opposite side of the grid 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.

  • useAbsZ (bool, optional) – If True, the absolute value of the z coordinate (depth) will be used when extracting values from the grids. Use this option if depths in your table are represented with negative numbers but depths in the grids are represented with positive numbers.

  • seafloorZValue (float, optional) – Value of the table’s z coordinate indicating that grid values should be extracted from the deepest cell with data, representing the seafloor. Use this as a convenience when you want to extract values along the seafloor but don’t want to bother with first looking up the seafloor’s depth at each point of interest. Instead, set the depth coordinate to a value such as -20000 (e.g. by passing -20000 for zValue), and then pass -20000 for seafloorZValue. The values for each point will then be extracted from the deepest cell with data at the point’s horizontal location.

  • numBlocksToCacheInMemory (int, optional) –

    Maximum number of blocks of data from each grid 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.

    The maximum size of the cache in bytes may be calculated by multiplying this parameter by the block size parameters and the data type of the grids. For example, if this parameter is 256 and the blocks are 32 by 32 and the grid uses the 32-bit floating point data type (32-bits is 4 bytes), the maximum size of the cache is 1048576 bytes (1 MB).

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

  • xBlockSize (int, optional) – Size of the blocks of grid 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 grid 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.

  • zBlockSize (int, optional) – Size of the blocks of grid data to cache in memory, in the z (depth) direction. The size is given as the number of cells. If this parameter is 0, no blocks will be cached in memory. This parameter is ignored if the grids do not have a z dimension. Minimum value꞉ 0.

  • tBlockSize (int, optional) – Size of the blocks of grid data to cache in memory, in the t (time) direction. The size is given as the number of cells. If this parameter is 0, no blocks will be cached in memory. This parameter is ignored if the grids do not have a t dimension. Minimum value꞉ 0.