org.geotools.geometry.jts
Class GeometryClipper

Object
  extended by GeometryClipper

public class GeometryClipper
extends Object

A stateful geometry clipper, can clip linestring on a specified rectangle. Trivial benchmarks report a speedup factor between 20 and 60 compared to JTS generic intersection algorithm. The class is not thread safe.

Author:
Andrea Aime - OpenGeo

Constructor Summary
GeometryClipper(Envelope bounds)
           
 
Method Summary
 Geometry clip(Geometry g, boolean ensureValid)
          Clips the geometry on the specified bounds.
 Envelope getBounds()
           
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeometryClipper

public GeometryClipper(Envelope bounds)
Method Detail

getBounds

public Envelope getBounds()

clip

public Geometry clip(Geometry g,
                     boolean ensureValid)
Clips the geometry on the specified bounds.

Parameters:
g - The geometry to be clipped
ensureValid - If false there is no guarantee the polygons returned will be valid according to JTS rules (but should still be good enough to be used for pure rendering)
Returns:


Copyright © 1996-2014 Geotools. All Rights Reserved.