Search in sources :

Example 1 with ScaledNoder

use of com.revolsys.geometry.noding.ScaledNoder in project com.revolsys.open by revolsys.

the class NodingFunctions method scaledNoding.

/**
 * Runs a ScaledNoder on input.
 * Input vertices should be rounded to precision model.
 *
 * @param geom
 * @param scaleFactor
 * @return the noded geometry
 */
public static Geometry scaledNoding(final Geometry geom, final double scaleFactor) {
    final List segs = newSegmentStrings(geom);
    final Noder noder = new ScaledNoder(new MCIndexSnapRounder(1.0), scaleFactor);
    noder.computeNodes(segs);
    final Collection nodedSegStrings = noder.getNodedSubstrings();
    return fromSegmentStrings(nodedSegStrings);
}
Also used : ScaledNoder(com.revolsys.geometry.noding.ScaledNoder) MCIndexSnapRounder(com.revolsys.geometry.noding.snapround.MCIndexSnapRounder) Collection(java.util.Collection) ArrayList(java.util.ArrayList) List(java.util.List) MCIndexNoder(com.revolsys.geometry.noding.MCIndexNoder) Noder(com.revolsys.geometry.noding.Noder) ScaledNoder(com.revolsys.geometry.noding.ScaledNoder)

Example 2 with ScaledNoder

use of com.revolsys.geometry.noding.ScaledNoder in project com.revolsys.open by revolsys.

the class Buffer method bufferFixedPrecision.

private static Geometry bufferFixedPrecision(final GeometryFactory precisionModel, final Geometry geometry, final double distance, final BufferParameters parameters) {
    final MCIndexSnapRounder rounder = new MCIndexSnapRounder(1.0);
    final double scale = precisionModel.getScaleXY();
    final Noder noder = new ScaledNoder(rounder, scale);
    return buffer(noder, precisionModel, geometry, distance, parameters);
}
Also used : ScaledNoder(com.revolsys.geometry.noding.ScaledNoder) MCIndexSnapRounder(com.revolsys.geometry.noding.snapround.MCIndexSnapRounder) MCIndexNoder(com.revolsys.geometry.noding.MCIndexNoder) Noder(com.revolsys.geometry.noding.Noder) ScaledNoder(com.revolsys.geometry.noding.ScaledNoder)

Aggregations

MCIndexNoder (com.revolsys.geometry.noding.MCIndexNoder)2 Noder (com.revolsys.geometry.noding.Noder)2 ScaledNoder (com.revolsys.geometry.noding.ScaledNoder)2 MCIndexSnapRounder (com.revolsys.geometry.noding.snapround.MCIndexSnapRounder)2 ArrayList (java.util.ArrayList)1 Collection (java.util.Collection)1 List (java.util.List)1