Forum

Thiessen Interpolation bug??

MM
Mason Marchildon, modified 2 Months ago.

Thiessen Interpolation bug??

Rookie Crystal gazer Posts: 19 Join Date: 5/1/17 Recent Posts
Hello all, I'm getting an odd result after interpolating a large data set with thiessenPolygon; see attached images.

These figures were created with same interpolated dataset where scalar data are spatially interpolated to subasin polygons; notice the snapshots are only a few days apart. There is an odd speckling of interpolated data seemingly occurring below a certain latitude. Any ideas?
IM
Ivo Miltenburg, modified 2 Months ago.

RE: Thiessen Interpolation bug??

Rookie Crystal gazer Posts: 13 Join Date: 3/12/13 Recent Posts
Hi Mason,
The ThiessenPolygon method is a 2 step method, where you first calculate the ThiessenPolygons based on your (scalar) input dataset, and subsequently map this to your output locationsSet.  This output can be polygons (eg subcatchments), but also a grid and scalar locations. It appears your are "exporting" the output to a polygon (subbasin) locationSet.

Have you tried also exporting the output to a grid? This would basically allow you to see the intermediate result of the ThiessenPolygon method (before it is mapped to a polygon subbasin output). Comparing this with your input dataset might give you some insights into what is happening.

As an aside, from your images I also see some (boundary) speckling in the "expected" image and I also see a bit of this boundary speckling above this "latitude" line in the speckling image. I think the boundary effect has something to do with the input data and some ThiessenPolygons returning as NaN's - potentially because of an issue with the <distanceGeoDatum>? I see some different ThiessenPolygon patterns between the 2 images and also some missing data....
MM
Mason Marchildon, modified 28 Days ago.

RE: Thiessen Interpolation bug??

Rookie Crystal gazer Posts: 19 Join Date: 5/1/17 Recent Posts
Thank you Ivo,

It is apparent to me that NaNs are causing the speckling issue, only that it occurs only rarely; sometimes it's fine, others drastic.  Given that the expected behaviour (ignoring NaNs) is reasonable, and that it appears infrequently, I maintain that this is an issue need fixing.

That said, I'm glad to hear that the ThiessenPolygons works in a two-step process, and is understandable why it takes much longer to compute than expected. Is there a way, then, to simply have a Nearest Neighbor to polygons?

After a long deliberation, I have decided to write interpolation schemes under a GA. Once complete I'll post to this thread.
IM
Ivo Miltenburg, modified 24 Days ago.

RE: Thiessen Interpolation bug??

Rookie Crystal gazer Posts: 13 Join Date: 3/12/13 Recent Posts
"I'm glad to hear that the ThiessenPolygons works in a two-step process, and is understandable why it takes much longer to compute than expected. Is there a way, then, to simply have a Nearest Neighbor to polygons?"
For the user, this is a one step process, but in the background the 2 steps take place (you will always need to map to the output (either scalar, output, etc) because a thiessen polygon is going to be different every timestep. You went another round, and that is fine (if something takes too much energy, search for a better solution). If I would go about this, I would break it up in 2 steps. (1) First run the ThiessenPolygon transformation with a (detailed) grid output. (2) Inspect the output grids and assess the issues with the NaN's. (3) Determine if some type of spatial interpolation is needed on the results from (1) to overcome these issues, or if you can improve the actual input data. (4) run the  InterpolationSpatialAverage transformation (or something similar) with appropriate settings to acquire your polygon outputs

"Given that the expected behaviour (ignoring NaNs) is reasonable, and that it appears infrequently, I maintain that this is an issue need fixing."
Given your description , I am not sure what the underlying issue is. Missing data is ignored it appears (as expected) - and the problem might be that for a given timestep your setup did not yield a thiessen polygon for certain locations (maybe due to your setting of the distanceGeoDatum?)...resulting in missing data when mapped to your polygons. 

If this is a bug would need to be determined, but I guess this is quite difficult to replicate...