1

I want to create a Voronoi Diagram within an outer polygon.

I want to retrieve a result very similar to this solution, which uses ST_DelaunayTriangles() to create Triangles.

Actually, it would suffice to decompose the polygon into multiple polygon with the blue markers as intersecting points:

enter image description here

I can't think of any approach to get the desired polygon set. The most crucial part is that the outer polygon has way much more points that describe the polygon than I need to create the polygon subsets. Simply using ST_DelaunayTriangles() would lead to several more polygons in the subset than are required and would contain even triangles outside the surrounding polygon, what I want to avoid at all.

This image shows an example of the problem:

enter image description here

This is an illustration of the result I want to retrieve:

enter image description here

Apart that, the outer lines are more complex, as you can see in the first image of the yellow outer polygon.

Any ideas?

Software Environment:

Java Backend with JDBC Connection to PostGIS Database. Frontend is a usual Web Application running with node.js.

  • Please always include a complete description of your software environment in every question. – Vince Feb 9 '17 at 14:11
  • Can you not clip the output of Delauney Triangles to the original containing polygon, ie, with ST_Intersection. I like your use of the term usual with node.js, though I tend to think of node.js as more backend. :-) – John Powell Feb 9 '17 at 14:20
  • I don't really understand what you mean by saying "clipt the output of Delauney Triangles". Could you explain this further? – byebb Feb 9 '17 at 14:42
  • You were saying that ST_DelauneyTriangles would produce triangles outside the enclosing polygon. If you use ST_Intersection, you could remove anything outside the enclosing polygon. It is slighly hard to understand what you want, as your three images don't appear to come from the same set of points. If you could show some actual SQL with data, it would be easier to understand. – John Powell Feb 9 '17 at 15:02
  • You mean something similar to gis.stackexchange.com/questions/39205/…, right? That might work.. The only problem that remains is the fact that the outer polygon (yellow) contains way more points than should be used for the triangulation. I would need to somehow smooth the polygon in order to reduce the number of total triangles. – byebb Feb 9 '17 at 15:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.