Noding polygons

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
Report Content as Inappropriate

Noding polygons

Sandro Zacchino
Hi all,

I need an efficient algorithm to node all the edges of a set of
overlapping geometries with the intersections found.
Currently i'm following this algorithm (for two geometries) but the last
step i need is how to rebuild the original geometry (including its holes):

public static void noder(Geometry g1, Geometry g2){

   //GeometryFactory gf = new GeometryFactory();

   // add the linestrings to a list of NodedSegmentString;
   List list = new ArrayList();
   list.add(new NodedSegmentString(g1.getCoordinates(), null));
   list.add(new NodedSegmentString(g2.getCoordinates(), null));

   // create a noder and computes the nodes
   MCIndexNoder noder = new MCIndexNoder();
   noder.setSegmentIntersector(new IntersectionAdder(new


At this point which is the most efficient way to recreate the original
polygons (with holes) having their edges noded properly?
Is MCIndexNoder the best method to get all the intersections?

Thank you

Sandro Zacchino

jts-devel mailing list
[hidden email]