DouglasPeuckerSimplifier
Code IndexAdd Codota to your IDE (free)

Best code snippets using com.vividsolutions.jts.simplify.DouglasPeuckerSimplifier(Showing top 15 results out of 315)

origin: org.neo4j/neo4j-spatial

@Override    
protected GeoPipeFlow process(GeoPipeFlow flow) {
  setGeometry(flow, DouglasPeuckerSimplifier.simplify(flow.getGeometry(), distanceTolerance));
  return flow;
}
origin: org.geotools/gt-process-geometry

@DescribeProcess(title = "Simplify", description = "Returns a geometry that has been simplified (reduced in vertices) according to the Douglas-Peucker algorithm.")
@DescribeResult(description = "Simplified geometry")
static public Geometry simplify(@DescribeParameter(name = "geom", description="Input geometry") Geometry geom,
    @DescribeParameter(name = "distance", description="Simplification distance tolerance, in units of the input geometry") double distance) {
  return DouglasPeuckerSimplifier.simplify(geom, distance);
}
origin: com.vividsolutions/jts

public static Geometry simplify(Geometry geom, double distanceTolerance)
{
 DouglasPeuckerSimplifier tss = new DouglasPeuckerSimplifier(geom);
 tss.setDistanceTolerance(distanceTolerance);
 return tss.getResultGeometry();
}
origin: org.jboss.teiid/teiid-engine

public static GeometryType simplify(
    GeometryType geom, double tolerance) throws FunctionExecutionException {
  DouglasPeuckerSimplifier douglasPeuckerSimplifier = new DouglasPeuckerSimplifier(getGeometry(geom));
  douglasPeuckerSimplifier.setEnsureValid(false);
  douglasPeuckerSimplifier.setDistanceTolerance(tolerance);
  Geometry resultGeometry = douglasPeuckerSimplifier.getResultGeometry();
  return getGeometryType(resultGeometry);
}

origin: org.opengeo/geodb

/**
 * Returns a "simplified" version of the given geometry using the Douglas-Peuker algorithm.
 */
public static byte[] ST_Simplify( byte[] wkb, double tol ) {
  if ( wkb == null ) {
    return null;
  }
  
  Geometry g = gFromWKB(wkb);
  return gToWKB(DouglasPeuckerSimplifier.simplify(g,tol));
}

origin: org.geotools/gt-process-feature

public SimpleFeature next() throws NoSuchElementException {
  SimpleFeature f = delegate.next();
  for (Object attribute : f.getAttributes()) {
    if (attribute instanceof Geometry) {
      if (preserveTopology) {
        attribute = DouglasPeuckerSimplifier.simplify((Geometry) attribute,
            distance);
      } else {
        attribute = TopologyPreservingSimplifier.simplify((Geometry) attribute,
            distance);
      }
    }
    fb.add(attribute);
  }
  return fb.buildFeature(f.getID());
}
origin: codice/ddf

 private Geometry getSimplifiedGeometry(Geometry geometry) {
  for (int iterations = 0; iterations <= MAX_SIMPLIFY_ITERATIONS; iterations++) {
   double tolerance = SIMPLIFY_DISTANCE_TOLERANCE * Math.pow(2, iterations);
   Geometry simplifiedGeometry = DouglasPeuckerSimplifier.simplify(geometry, tolerance);
   if (simplifiedGeometry.getNumPoints() <= 0) {
    return null;
   }
   if (simplifiedGeometry.getNumPoints() <= MAX_POINTS_PER_FEATURE) {
    return simplifiedGeometry;
   }
  }
  return null;
 }
}
origin: orbisgis/h2gis

  /**
   * Simplify the geometry using the douglad peucker algorithm.
   * 
   * @param geometry
   * @param distance
   * @return 
   */
  public static Geometry simplify(Geometry geometry, double distance) {
    if(geometry == null){
      return null;
    }
    return DouglasPeuckerSimplifier.simplify(geometry, distance);
  }
}
origin: geotools/geotools

@DescribeProcess(title = "Simplify", description = "Returns a geometry that has been simplified (reduced in vertices) according to the Douglas-Peucker algorithm.")
@DescribeResult(description = "Simplified geometry")
static public Geometry simplify(@DescribeParameter(name = "geom", description="Input geometry") Geometry geom,
    @DescribeParameter(name = "distance", description="Simplification distance tolerance, in units of the input geometry") double distance) {
  return DouglasPeuckerSimplifier.simplify(geom, distance);
}
origin: org.geotools/gt-process-geometry

@DescribeProcess(title = "Simplify", description = "Returns a geometry that has been simplified (reduced in vertices) according to the Douglas-Peucker algorithm.")
@DescribeResult(description = "Simplified geometry")
static public Geometry simplify(@DescribeParameter(name = "geom", description="Input geometry") Geometry geom,
    @DescribeParameter(name = "distance", description="Simplification distance tolerance, in units of the input geometry") double distance) {
  return DouglasPeuckerSimplifier.simplify(geom, distance);
}
origin: jdeolive/geodb

/**
 * Returns a "simplified" version of the given geometry using the Douglas-Peuker algorithm.
 */
public static byte[] ST_Simplify( byte[] wkb, double tol ) {
  if ( wkb == null ) {
    return null;
  }
  
  Geometry g = gFromWKB(wkb);
  return gToWKB(DouglasPeuckerSimplifier.simplify(g,tol));
}

origin: org.teiid/teiid-engine

public static GeometryType simplify(
    GeometryType geom, double tolerance) throws FunctionExecutionException {
  DouglasPeuckerSimplifier douglasPeuckerSimplifier = new DouglasPeuckerSimplifier(getGeometry(geom));
  douglasPeuckerSimplifier.setEnsureValid(false);
  douglasPeuckerSimplifier.setDistanceTolerance(tolerance);
  Geometry resultGeometry = douglasPeuckerSimplifier.getResultGeometry();
  return getGeometryType(resultGeometry);
}

origin: com.vividsolutions/jts-core

/**
 * Simplifies a geometry using a given tolerance.
 * 
 * @param geom geometry to simplify
 * @param distanceTolerance the tolerance to use
 * @return a simplified version of the geometry
 */
public static Geometry simplify(Geometry geom, double distanceTolerance)
{
 DouglasPeuckerSimplifier tss = new DouglasPeuckerSimplifier(geom);
 tss.setDistanceTolerance(distanceTolerance);
 return tss.getResultGeometry();
}
origin: geotools/geotools

public SimpleFeature next() throws NoSuchElementException {
  SimpleFeature f = delegate.next();
  for (Object attribute : f.getAttributes()) {
    if (attribute instanceof Geometry) {
      if (preserveTopology) {
        attribute = DouglasPeuckerSimplifier.simplify((Geometry) attribute,
            distance);
      } else {
        attribute = TopologyPreservingSimplifier.simplify((Geometry) attribute,
            distance);
      }
    }
    fb.add(attribute);
  }
  return fb.buildFeature(f.getID());
}
origin: org.geotools/gt-process-feature

public SimpleFeature next() throws NoSuchElementException {
  SimpleFeature f = delegate.next();
  for (Object attribute : f.getAttributes()) {
    if (attribute instanceof Geometry) {
      if (preserveTopology) {
        attribute = DouglasPeuckerSimplifier.simplify((Geometry) attribute,
            distance);
      } else {
        attribute = TopologyPreservingSimplifier.simplify((Geometry) attribute,
            distance);
      }
    }
    fb.add(attribute);
  }
  return fb.buildFeature(f.getID());
}
com.vividsolutions.jts.simplifyDouglasPeuckerSimplifier

Javadoc

Simplifies a Geometry using the Douglas-Peucker algorithm. Ensures that any polygonal geometries returned are valid. Simple lines are not guaranteed to remain simple after simplification. All geometry types are handled. Empty and point geometries are returned unchanged. Empty geometry components are deleted.

Note that in general D-P does not preserve topology - e.g. polygons can be split, collapse to lines or disappear holes can be created or disappear, and lines can cross. To simplify geometry while preserving topology use TopologyPreservingSimplifier. (However, using D-P is significantly faster).

KNOWN BUGS
  • In some cases the approach used to clean invalid simplified polygons can distort the output geometry severely.

Most used methods

  • simplify
    Simplifies a geometry using a given tolerance.
  • <init>
    Creates a simplifier for a given geometry.
  • getResultGeometry
    Gets the simplified geometry.
  • setDistanceTolerance
    Sets the distance tolerance for the simplification. All vertices in the simplified geometry will be
  • setEnsureValid
    Controls whether simplified polygons will be "fixed" to have valid topology. The caller may choose t

Popular classes and methods

  • addToBackStack (FragmentTransaction)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getContentResolver (Context)
  • PrintStream (java.io)
    Wraps an existing OutputStream and provides convenience methods for writing common data types in a h
  • URL (java.net)
    Class URL represents a Uniform Resource Locator, a pointer to a "resource" on the World Wide Web.
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • JTextField (javax.swing)
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin

For IntelliJ IDEA and
Android Studio

  • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutContact Us
  • Terms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)