Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should bbox diagonal refer to vertices or sites? #18

Open
Mono2 opened this issue Apr 22, 2020 · 7 comments
Open

Should bbox diagonal refer to vertices or sites? #18

Mono2 opened this issue Apr 22, 2020 · 7 comments

Comments

@Mono2
Copy link
Member

Mono2 commented Apr 22, 2020

The length of the diagonal of the bbox, which is required to determine the lag distance, is calculated on the basis of the vertices of the Voronoi diagram. In individual cases, this does not match the bounding box of the archaeological sites (determined by deldir::deldir), since vertices are not necessarily located on all sides of the rectangle.
This also applies to the calculation of the kriging grid.

Should we adjust the calculation of the bbox diagonal and the Kriging grid to the rectangle created by deldir::deldir?

@RobinCGN
Copy link
Member

Does this mean the vertices bbox is in your case smaller than the minimum bounding geometry of the sites?

I think it is good to compute the bbox diagonal in relation to the vertices, because these are the "observations" we want to interpolate.

@RobinCGN RobinCGN changed the title Is the the bbox diagonal calculation not working properly? Should bbox diagonal refer to vertices or sites? Apr 22, 2020
@Mono2
Copy link
Member Author

Mono2 commented Apr 22, 2020

Here is an example:
bbox
Black Points are sites, blue points are vertices. The dashed line is the bbox by deldir (here still +10%). The lag distance and the grid are, however, based upon the smallest rectangle around the vertices, illustrated in the figure above by the colored kriging result.
Although in the present case it is certainly due to the small data basis, this difference can also occur with a larger data basis. In the present case, none of the isolines would enclose 100% of the sites.
A possible solution would be to calculate the bbox diagonal and the grid based upon the bbox of deldir.

@RobinCGN
Copy link
Member

I get the point. This issue should be at least mentioned in our documentation as an option.

But i hesitate to change the code due to the fact that this will impact the results of the sample application. Have you compared the results of the sample app using the sites bbox instead of the vertices bbox?

@Mono2
Copy link
Member Author

Mono2 commented Apr 22, 2020

In the case of the example application, this problem does not occur because there is a vertex of the Voronoi diagram on each of the four sides of the deldir bbox. Hence, the change in the script files does not affect the results of the sample application.
I think this problem only occurs if there is a site that clearly stands apart from the other sites (see example above). The Thiessen polygon of the corresponding site is so large, that there is no vertex on one site of the bbox.
I can make two possible points with regard to the example above:

  • Because of the special location of this site, one could argue that it should be excluded from the calculation. The question arises, whether this should be done before the Voronoi diagram is created or after.
  • Another option would be to change calculation of bbox diagonal and grid, resulting in a inclusion of the outlying site. Though I am not sure if it makes sense from an archaeological perspective.

@VicluUiB
Copy link

Hi again,

Sorry for spreading my comments all over the place. I would like to give the kriging a try by changing the deldir to include a 10% size increase. How and where should I adjust the code to give this a try? Like I mentioned in one of other threads. Although increasing the size might add problems in terms of adding more data locations for kriging, a limited size might also skew the calculations relating to the increase of space or the percentage coverage, as isolines that intersect with the edges of the kriging raster will (at least in QGIS) be converted to polygons erroneously.

@RobinCGN
Copy link
Member

Have a look at issue #16. You have to drop the rw-parameter in the deldir-Function:

voronoi_vertices <- deldir::deldir(sites@coords[, 1],
sites@coords[, 2])

@VicluUiB
Copy link

Ok! I gave this a try.
This is what my code looks like now.

calculate vertices of voronoi diagram

voronoi_vertices <- deldir::deldir(sites@coords[, 1],
sites@coords[, 2],)

However, then right after when I try to extract the voronoi vertices at:

extraction of vertices

dirsgs

I get the following error:

extraction of vertices

dirsgs
Error: object 'dirsgs' not found

I suppose I'm missing something when creating the voronois?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants