Skip to main content

Inverse distance weighting (IDW)

Inverse Distance Weighting (IDW) estimates the value at each evaluation point from a weighted average of its nearest known samples. Each neighbor's weight is inversely proportional to its distance raised to a chosen power, so closer samples contribute more than distant ones. With a higher power, nearby samples dominate; with a lower power, the estimate is smoother.

Parameters​

  • source (object)
    • object (geoscience object reference)
    • attribute (geoscience object attribute reference)
      • Reference to a one-dimensional continuous attribute inside the source object that contains the known values used for estimation.
    • filter (object, optional)
      • Restricts the estimation to a subset of the source samples by filtering on an attribute of the source object. See Filtering.
    • {
      "object": "https://{hub}.api.seequent.com/geoscience-object/orgs/{org_id}/workspaces/{workspace_id}/objects/path/my-pointset.json",
      "attribute": "locations.attributes[?name=='my-attribute']"
      }
  • target (object)
    • object (geoscience object reference)
    • attribute (geoscience object attribute target)
      • Target that points to the attribute where the IDW results will be created or updated.
      • operation (string, one of create, update)
        • Create a new attribute, or update an existing one.
      • name (string, required for create)
        • Name of the new attribute.
      • reference (geoscience object attribute reference, required for update)
        • Reference to the existing attribute to update, instead of name.
    • filter (object, optional)
      • Restricts the estimation to a subset of the target locations by filtering on an attribute of the target object. Values outside the filter are preserved or cleared according to update_mode. See Filtering.
    • update_mode (string, optional, one of auto, merge, replace; defaults to auto)
    • {
      "object": "https://{hub}.api.seequent.com/geoscience-object/orgs/{org_id}/workspaces/{workspace_id}/objects/path/my-pointset.json",
      "attribute": {
      "operation": "create",
      "name": "my-idw-result"
      }
      }
  • neighborhood (object)
    • Search parameters that determine which nearby samples to use for each evaluation point.
    • ellipsoid (object)
      • Defines the three-dimensional search region.
      • ellipsoid_ranges (object)
        • major, semi_major, minor (numbers, each greater than 0)
          • Axis lengths of the search ellipsoid, in the source coordinate units.
      • rotation (object)
        • dip_azimuth (number, optional, 0 to 360, defaults to 0)
          • First clockwise rotation, about the z-axis, in degrees.
        • dip (number, optional, 0 to 180, defaults to 0)
          • Second clockwise rotation, about the x-axis, in degrees.
        • pitch (number, optional, 0 to 360, defaults to 0)
          • Third clockwise rotation, about the z-axis, in degrees.
    • max_samples (integer, at least 1)
      • Maximum number of nearby samples to use for each estimate.
    • min_samples (integer, optional, defaults to 1)
      • Minimum number of samples required for an estimate. Must be between 1 and max_samples; locations with too few accepted samples are not estimated.
    • max_empty_octants (integer, optional, 0 to 8, defaults to 8)
      • Maximum number of empty octants (the eight three-dimensional sectors around the evaluation point). Use 0 to require a sample in every octant, or 8 to disable this check.
    • max_samples_per_octant (integer, optional, at least 1, defaults to null)
      • Maximum number of samples from each octant. Omit or set to null for no per-octant limit.
    • max_empty_quadrants (integer, optional, 0 to 4, defaults to null)
      • Maximum number of empty quadrants (four horizontal sectors, ignoring z). Omit, set to null, or use 4 to disable this check.
    • max_samples_per_quadrant (integer, optional, at least 1, defaults to null)
      • Maximum number of samples from each quadrant. Omit or set to null for no per-quadrant limit.
    • max_samples_per_drillhole (integer, optional, at least 1, defaults to null)
      • Maximum number of samples from each drillhole. Requires a downhole-intervals source. Omit or set to null for no per-drillhole limit.
    • max_drillholes (integer, optional, at least 1, defaults to null)
      • Maximum number of distinct drillholes contributing to an estimate. Requires a downhole-intervals source. Omit or set to null for no limit.
    • {
      "ellipsoid": {
      "ellipsoid_ranges": {
      "major": 100.0, // Major axis length of the search ellipsoid
      "semi_major": 75.0, // Semi-major axis length
      "minor": 50.0 // Minor axis length
      },
      "rotation": {
      "dip_azimuth": 45.0, // First rotation about z-axis (0-360 degrees)
      "dip": 30.0, // Second rotation about x-axis (0-180 degrees)
      "pitch": 0.0 // Third rotation about z-axis (0-360 degrees)
      }
      },
      "max_samples": 15 // Maximum number of nearby samples to use
      }
  • power (number)
    • Positive number controlling how quickly a neighbor's influence decreases with distance. Weights are proportional to 1/dp1 / d^{p}, where dd is the distance in the anisotropic search space and pp is the power. Common values are 1.0 and 2.0; larger values give nearby samples greater dominance.

Filtering​

Both source.filter and target.filter accept a filter expression with a single where clause. The where clause is either a leaf condition or a composite (all_of / any_of) of nested expressions.

A leaf condition uses an operator together with either values (for membership operators in / not_in) or threshold (for the comparison operators equal, not_equal, greater_than, greater_than_or_equal_to, less_than, less_than_or_equal_to).

  • where (object)
    • The filter expression to apply.
    • type (string, one of condition, all_of, any_of)
      • Use condition for a single attribute test, all_of to require every child expression, or any_of to require at least one.
    • attribute (geoscience object attribute reference, required for condition)
      • Attribute on the source or target object to test.
    • operator (string, required for condition)
      • Membership or numeric comparison operator from the list above.
    • values (array of strings or integers, required for membership tests)
      • Category names or integer category keys to match. Do not supply threshold with a membership test.
    • threshold (number, required for numeric comparisons)
      • Numeric value to compare against. Do not supply values with a numeric comparison.
    • filters (array of objects, required for all_of or any_of)
      • Child filter expressions, each with the same structure as where. Composite expressions use filters instead of attribute, operator, values, or threshold.
// Keep only samples whose "rock-type" is granite or basalt
{
"where": {
"type": "condition",
"attribute": "locations.attributes[?name=='rock-type']",
"operator": "in",
"values": ["granite", "basalt"]
}
}
// Keep only locations where "grade" is above a threshold AND "domain" is 1
{
"where": {
"type": "all_of",
"filters": [
{
"type": "condition",
"attribute": "locations.attributes[?name=='grade']",
"operator": "greater_than",
"threshold": 0.5
},
{
"type": "condition",
"attribute": "locations.attributes[?name=='domain']",
"operator": "in",
"values": [1]
}
]
}
}

Estimating one domain at a time​

A common workflow is to run the estimation once per domain, each run using target.filter to select that domain's locations, and write every run into the same attribute. target.update_mode controls what happens to the locations a run did not estimate.

  • auto (default) — merge when target.filter is set, replace otherwise. This is what you want for the workflow above: each run leaves the other domains' results untouched, and the final version holds every domain.
  • merge — always leave locations this run did not estimate at their previous values.
  • replace — always clear them, so the attribute only ever holds the results of the latest run.

After the first run, point target.attribute at the attribute the previous run wrote ("operation": "update"). Merging preserves what is already stored in that attribute, so a run that creates a new one has nothing to merge with.

Block model targets merge in BlockSync. Every other target type is written as a whole document, so the task reads the attribute's current values back and merges them itself, which costs one extra download per attribute.

"Did not estimate" covers both locations the filter excluded and locations inside the filter where the neighborhood search found no samples.

Run the domains sequentially. Each run builds on the version the previous one produced, so concurrent runs can overwrite each other.

Example​

For more information, see the inverse-distance-weighting API reference.

Request​

This example assumes the source pointset has an integer-coded category attribute named domain, and the target grid has a corresponding cell attribute.

requests.post(
"https://{hub}.api.seequent.com/compute/orgs/{org_id}/geostatistics/idw",
headers={"Authorization": "Bearer {token}"},
json={
"source": {
"object": "https://{hub}.api.seequent.com/geoscience-object/orgs/{org_id}/workspaces/{workspace_id}/objects/path/my-pointset.json",
"attribute": "locations.attributes[?name=='my-attribute']",
"filter": {
"where": {
"type": "condition",
"attribute": "locations.attributes[?name=='domain']",
"operator": "in",
"values": [1]
}
},
},
"target": {
"object": "https://{hub}.api.seequent.com/geoscience-object/orgs/{org_id}/workspaces/{workspace_id}/objects/path/my-grid.json",
"attribute": {
"operation": "create",
"name": "my-idw-result"
},
"filter": {
"where": {
"type": "condition",
"attribute": "cell_attributes[?name=='domain']",
"operator": "in",
"values": [1]
}
},
"update_mode": "auto",
},
"neighborhood": {
"ellipsoid": {
"ellipsoid_ranges": {
"major": 100.0,
"semi_major": 50.0,
"minor": 20.0
},
"rotation": {
"dip_azimuth": 45.0,
"dip": 30.0,
"pitch": 10.0
}
},
"max_samples": 50,
"min_samples": 10,
"max_empty_octants": 2,
"max_samples_per_octant": 8,
},
"power": 2.0,
},
)

Drillhole Search Example​

For a downhole-intervals source, add drillhole limits to the request's neighborhood:

{
# ... ellipsoid and other search settings as above
"max_samples_per_drillhole": 4,
"max_drillholes": 8,
}

Do not set these limits for a pointset or grid source.

Result​

The initial request returns 303 with a job status URL. The result endpoint returns the following when the task completes.

{
"message": "IDW estimation completed.",
"target": {
"reference": "https://{hub}.api.seequent.com/geoscience-object/orgs/{org_id}/workspaces/{workspace_id}/objects/path/my-grid.json",
"name": "My Grid",
"description": null,
"schema_id": "/objects/regular-3d-grid/1.3.0",
"attribute": {
"reference": "cell_attributes[?key=='3cc3aa58-c928-4e79-b8ca-550174bff59e']",
"name": "my-idw-result"
}
}
}

Tips​

  • The source and target can use the same object, but they don't have to.
  • IDW with power = 2.0 (inverse-distance-squared) is a common default. Use a higher power when you want closer samples to dominate; use a lower power for a smoother estimate.
  • For an unweighted average of the nearest neighbors (equal votes), use the k-nearest-neighbors task instead.

Was this page helpful?