Revision 24069 trunk/libraries/libTopology/src/org/gvsig/jts/JtsUtil.java
JtsUtil.java | ||
---|---|---|
85 | 85 |
import com.vividsolutions.jts.geomgraph.Edge; |
86 | 86 |
import com.vividsolutions.jts.geomgraph.EdgeIntersectionList; |
87 | 87 |
import com.vividsolutions.jts.geomgraph.GeometryGraph; |
88 |
import com.vividsolutions.jts.precision.EnhancedPrecisionOp; |
|
88 | 89 |
import com.vividsolutions.jts.simplify.DouglasPeuckerSimplifier; |
89 | 90 |
import com.vividsolutions.jts.simplify.TopologyPreservingSimplifier; |
90 | 91 |
import com.vividsolutions.jump.util2.CoordinateArrays; |
... | ... | |
102 | 103 |
/** |
103 | 104 |
* Generalization factor to compute line generalization |
104 | 105 |
*/ |
105 |
public static Double GENERALIZATION_FACTOR = new Double(1d); |
|
106 |
public static Double GENERALIZATION_FACTOR = new Double(10d);
|
|
106 | 107 |
|
107 | 108 |
public static PrecisionModel GVSIG_PRECISION_MODEL = new PrecisionModel(10000); |
108 | 109 |
|
... | ... | |
935 | 936 |
public static Coordinate getCircumCenter(Coordinate a, Coordinate b, Coordinate c){ |
936 | 937 |
return Triangle.circumcentre(a, b, c); |
937 | 938 |
} |
939 |
|
|
940 |
public static Geometry difference(Geometry poly, List<Geometry> lineNeighbours){ |
|
941 |
Geometry solution = null; |
|
942 |
List<Geometry> differences = new ArrayList<Geometry>(); |
|
943 |
for(int i = 0; i < lineNeighbours.size(); i++){ |
|
944 |
Geometry neighbour = lineNeighbours.get(i); |
|
945 |
if(poly.overlaps(neighbour)) |
|
946 |
differences.add(EnhancedPrecisionOp.difference(poly, neighbour )); |
|
947 |
} |
|
948 |
solution = GEOMETRY_FACTORY.createGeometryCollection(differences.toArray(new Geometry[0])); |
|
949 |
return solution; |
|
950 |
} |
|
938 | 951 |
} |
Also available in: Unified diff