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)- Reference to a geoscience object containing the spatial locations of known values. Must be a pointset or downhole-intervals object.
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)- Reference to the geoscience object where the IDW results will be stored. A new attribute containing the estimated values is created on this object. Must be a pointset, downhole-intervals, regular-3d-grid, or regular-masked-3d-grid object.
attribute(geoscience object attribute target)- Target that points to the attribute where the IDW results will be created or updated.
filter(object, optional)- Restricts the estimation to a subset of the target locations by filtering on an attribute of the target object. Locations that are filtered out are left as
NaN. See Filtering.
- Restricts the estimation to a subset of the target locations by filtering on an attribute of the target object. Locations that are filtered out are left as
-
{"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": {"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 , where is the distance in the anisotropic search space and is the power. Common values are
1.0and2.0; larger values give nearby samples greater dominance.
- Positive number controlling how quickly a neighbor's influence decreases with distance. Weights are proportional to , where is the distance in the anisotropic search space and is the power. Common values are
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).
// 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]
}
]
}
}
Example
For more information, see the inverse-distance-weighting API reference.
Request
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']",
},
"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"
},
},
"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,
},
"power": 2.0,
},
)
Result
{
"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",
"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.