I have two-dimensional discrete spatial data I want to approximate the spatial boundaries of this data so that I have another dataset To build a conspiracy with
Ideally, this will be given an order of (x, y) points which can plot with matplotlib plt.Polygon () patch.
My initial effort is very irregular: I place a grid on the data, and where there is a data in a cell, a square matlab patch of that class is formed. The resolution of the boundary thus depends on the sampling frequency of the grid. Here is an example where the gray area contains data-containing cells, black where no data exists.
OK, the problem has been solved - why am I still here? Okay .... I want another "elegant" solution, or at least one who is fast (i.e. I do not want to do "real" work, I have to have some fun on this!). The best approach I can think is that a re-tracing approach - like:
- from xmin to xmax, at y = ymin, check whether the data limit interval exceeded in DX
- Y = ymin + dy, do 1
- Do 1-2, but now the sample in y
is defining an alternative center, and Sample space in R-theta - that is, in Radial Spot DTATA increments.
Both (x, y) will generate a set of points, but then how do I order / link the neighboring points to make the boundary?
For example (to borrow from geography) the closest neighbor approach is not suitable, an Istma (Panama thinks that adding N & S America) can be closed and separated from the area. Could. It can not behave very well with the holes seen in the data, which I have a different PLT. I would like to present in the form of polygon.
The solution probably comes from solving an area with the maximum problem. For a set of digits defining the data boundary, what is the maximum relevant area within those points, to create an enclosed area, what are the neighboring points for the ninth point? How holes will be treated in this scheme - is it a mess in topology now?
Forgiveness, it's thinking very loud that I would be grateful for some hints, suggestions or solutions. I suspect it has many problems with many solution techniques, but I find it easy to code and find something soon I am trying to ... I think everybody is really!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
OK, Here's the # 2 attempt by using the idea of Hooks Mark of the latter:
For this, I used qconvex from Qhull package, it is getting back to the extreme corner. For those interested:
cat [data] | Qconvex fx> out
The sample of the periphery seems quite low, and although I have not played much with the settings, I do not believe that I can improve integrity.
I think what you want, will indicate that if it is connected then its This will mean that all your points are in or connected to them.
Comments
Post a Comment