-
Notifications
You must be signed in to change notification settings - Fork 361
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
Euclidean distance tiles #1552
Euclidean distance tiles #1552
Conversation
import geotrellis.vector.voronoi._ | ||
import scala.math.sqrt | ||
|
||
object EuclideanDistanceTile { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be moved out of root package; geotrellis.raster.distance
seems general enough to be a home for it.
Needs MethodExtensions[Traversable[Point]]
, and the corresponding machinery.
@@ -0,0 +1,97 @@ | |||
package geotrellis.vector.voronoi | |||
|
|||
class HalfEdge[V,F](val vert: V, var flip: HalfEdge[V,F], var next: HalfEdge[V,F], var face: Option[F]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Polygon method?
@jpolchlo this cannot be merged. Please update it to master. |
This pull request addresses issue #941 by creating a Euclidean distance field from a set of points. The operation creates a Voronoi diagram from the input points and rasterizes each resulting polygonal cell to an output DoubleArrayTile using a simple distance function from the point that generated the Voronoi cell.
A note on complexity: this method builds a Delaunay triangulation in O(n log n) time, generates the Voronoi diagram in O(n) time, and the rasterization function applied to each pixel is O(1). Thus, the expectation is that the performance of this module ought to be fairly reasonable.