6

I have a series of points fed into a voronoi graph class that returns a series of edges defining the bounds between these points, the process works it returns a series of edges.

I now need to do a ray/fill using the points and these edges to build polygons around each point.... for the life of me I can't seem to figure out a process of doing this or a code sample... C# code or thought process would be great .... maybe ray collision?

Sample Voroni

whuber
  • 69,783
  • 15
  • 186
  • 281
Jamo
  • 1,457
  • 1
  • 14
  • 21
  • 1
    Are you doing this in straight C#, or are you using a library like ArcGIS? Does the process not return any other information than the edges? – Anthony -GISCOE- Jan 31 '11 at 13:59
  • I've used http://www.codeproject.com/KB/recipes/fortunevoronoi.aspx class it return a series of edges with left and right nodes, this is being done in c# with the sharpmap library, I only have the point information available – Jamo Jan 31 '11 at 22:07

2 Answers2

2

How about PolygonBuilder in nettopologysuite

NetTopologySuite is a C#/.NET port of JTS Topology Suite, a Java library for GIS operations, (OpenGIS compliant).

underdark
  • 84,148
  • 21
  • 231
  • 413
  • I think I've got an idea for this particular set of data if I draw a line from each node to the center of each edge the edges that have only 1 intersection are the ones that create a closed polygon.... might not be the prettiest routine but it will get the job done... or else I will look into NetTopologySuite – Jamo Feb 01 '11 at 01:52
1

Does this question help?

julien
  • 10,186
  • 6
  • 55
  • 93
  • 1
    That question is apt. The point hinted at by @Anthony in a comment to the question is that one shouldn't have to go to such lengths: any procedure to compute Voronoi polygons already "knows" the topology and ought to be able to communicate it directly to the caller. – whuber Jan 31 '11 at 19:45
  • Exactly. If you have the reference to the left and right nodes, you should just be able to create polygons by finding all the edges for a specific node, i.e. using the soltion for the question above. – Anthony -GISCOE- Feb 01 '11 at 16:41