Search code examples
gisgeospatialgeojsonvoronoi

Voronoi diagram from latitude ,longtime points and bounding box using Steven Fortune's code


I'm using http://ageeksnotes.blogspot.com/2010/11/fast-java-implementation-fortunes.html

 List<GraphEdge> allEdges = voronoi.generateVoronoi(latValues, lngValues, maxLatitude, minLatitude, minLongitiude, maxLongitude); 

i have a list of points(lat,long) and the bounding box of those points from these "Graph edges".

List allEdges should be all i need

60.1365210529365,-1.32798132296606
60.1338473169364,-1.33199657348365
60.1392706837279,-1.33043515202468
60.1405725317445,-1.33005929108147
60.1393406902,-1.32942830065997
60.1365210529365,-1.32798132296606

//bounding box.
minLatitude[60.1365210529365]
minLongitiude[-1.32798132296606] 
maxLatitude[60.1405725317445] 
maxLongitude[-1.33199657348365]

gives me a colleciton of graphEdges GraphEdge size [9] with results:

GraphEdge size [9] 
 SITE 1 [2] x1,y1 [60.1365210529365,-1.330748782763273] 
 SITE 2 [5] x2,y2 [60.13899079297949,-1.32798132296606] 
 SITE 1 [2] x1,y1 [60.1365210529365,-1.330748782763273] 
 SITE 2 [0] x2,y2 [60.13737030236351,-1.3297971588651558] 
 SITE 1 [2] x1,y1 [60.137370302363514,-1.3297971588651558] 
 SITE 2 [4] x2,y2 [60.13984127151547,-1.3299689655876374] 
 SITE 1 [4] x1,y1 [60.137370302363514,-1.3297971588651558] 
 SITE 2 [0] x2,y2 [60.138302150610734,-1.32798132296606] 
 SITE 1 [3] x1,y1 [60.139841271515465,-1.329968965587637] 
 SITE 2 [4] x2,y2 [60.1405725317445,-1.3285413738219385] 
 SITE 1 [1] x1,y1 [60.1365210529365,-1.330879162193689] 
 SITE 2 [5] x2,y2 [60.1365210529365,-1.330879162193689] 
 SITE 1 [3] x1,y1 [60.13907967819445,-1.32798132296606] 
 SITE 2 [0] x2,y2 [60.13907967819445,-1.32798132296606] 
 SITE 1 [2] x1,y1 [60.1404266690477,-1.33199657348365] 
 SITE 2 [3] x2,y2 [60.139841271515465,-1.329968965587637] 
 SITE 1 [1] x1,y1 [60.13678377186855,-1.33199657348365] 
 SITE 2 [2] x2,y2 [60.1365210529365,-1.3310840580808576] 

how am I suppose to 'visualize this'? i want to make polygons from the original points. the list of List allEdges should be all I need to generate the polygons.


Solution

  • I ended up using JTS topology suite to obtain needed output for visualization. https://mvnrepository.com/artifact/com.vividsolutions/jts/1.13