[postgis-devel] how to add my JTS in postgis?

xschen xschen at clustertech.com
Sat Aug 8 04:59:16 PDT 2015


I download the JTS source code , and add an algrithem in it.
  now , i want to remove the pervious JTS of postgis and add my JTS into 
it to test.
how to?



BTW,  the algrithem is to replace this package:

package com.vividsolutions.jts.geomgraph.index;
public class SimpleEdgeSetIntersector extends EdgeSetIntersector

     private void computeIntersects(Edge e0, Edge e1, SegmentIntersector 
si)
     {
         com.vividsolutions.jts.geom.Coordinate pts0[] = 
e0.getCoordinates();
         com.vividsolutions.jts.geom.Coordinate pts1[] = 
e1.getCoordinates();
         for(int i0 = 0; i0 < pts0.length - 1; i0++)
         {
             for(int i1 = 0; i1 < pts1.length - 1; i1++)
                 si.addIntersections(e0, i0, e1, i1);

         }

     }


if an n points line intersects an n points line ,the complexity will be 
O(n*n).
this algrithem wiil show very low performance, if n>10000

my algrithem is to cut each line into sevel small pieces, group them 
into 4 branch trees boxes and join, then calculate the intersects of 
small pieces in the same boxes.
so that the complexity will be O(nlog(n)).




More information about the postgis-devel mailing list