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

Euclidean distance tiles #1552

Merged
merged 14 commits into from
Jul 15, 2016

Conversation

jpolchlo
Copy link
Contributor

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.

@jpolchlo jpolchlo changed the title [WIP] Euclidean distance tiles Euclidean distance tiles Jun 16, 2016
import geotrellis.vector.voronoi._
import scala.math.sqrt

object EuclideanDistanceTile {
Copy link
Member

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]) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Polygon method?

@lossyrob
Copy link
Member

@jpolchlo this cannot be merged. Please update it to master.

@lossyrob lossyrob merged commit 2a74a3b into locationtech:master Jul 15, 2016
@lossyrob lossyrob added this to the 1.0 milestone Oct 18, 2016
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

Successfully merging this pull request may close these issues.

2 participants