Tabnine Logo
Geometry.apply
Code IndexAdd Tabnine to your IDE (free)

How to use
apply
method
in
com.vividsolutions.jts.geom.Geometry

Best Java code snippets using com.vividsolutions.jts.geom.Geometry.apply (Showing top 20 results out of 324)

origin: opentripplanner/OpenTripPlanner

/**
 * Transform into GeometryCollection.
 * 
 * @param geom
 *         input geometry
 * @return
 *         a geometry collection
 */
private static GeometryCollection transformIntoPointGeometryCollection(Geometry geom) {
  UniqueCoordinateArrayFilter filter = new UniqueCoordinateArrayFilter();
  geom.apply(filter);
  Coordinate[] coord = filter.getCoordinates();
  
  Geometry[] geometries = new Geometry[coord.length];
  for (int i = 0 ; i < coord.length ; i++) {
    Coordinate[] c = new Coordinate[] { coord[i] };
    CoordinateArraySequence cs = new CoordinateArraySequence(c);
    geometries[i] = new Point(cs, geom.getFactory());
  }
  
  return new GeometryCollection(geometries, geom.getFactory());
}
origin: com.vividsolutions/jts

/**
 * Notifies this geometry that its coordinates have been changed by an external
 * party (for example, via a {@link CoordinateFilter}). 
 * When this method is called the geometry will flush
 * and/or update any derived information it has cached (such as its {@link Envelope} ).
 * The operation is applied to all component Geometries.
 */
public void geometryChanged() {
 apply(geometryChangedFilter);
}
origin: com.vividsolutions/jts

/**
 * Add a {@link Geometry} to the edges to be polygonized.
 * May be called multiple times.
 * Any dimension of Geometry may be added;
 * the constituent linework will be extracted and used
 *
 * @param g a {@link Geometry} with linework to be polygonized
 */
public void add(Geometry g)
{
 g.apply(lineStringAdder);
}
origin: com.vividsolutions/jts

public void apply(CoordinateFilter filter) {
   for (int i = 0; i < geometries.length; i++) {
    geometries[i].apply(filter);
   }
  }
origin: osmandapp/Osmand

nextTransformGeom.apply(RoundingFilter.INSTANCE);
origin: com.vividsolutions/jts

private void compute()
{
 if (minClearancePts != null) return;
 minClearancePts = new Coordinate[2];
 minClearance = Double.MAX_VALUE;
 inputGeom.apply(new VertexCoordinateFilter());
}
 
origin: com.vividsolutions/jts

public void apply(GeometryFilter filter) {
 filter.filter(this);
 for (int i = 0; i < geometries.length; i++) {
  geometries[i].apply(filter);
 }
}
origin: com.vividsolutions/jts

/**
 * Returns a list containing a point from each Polygon, LineString, and Point
 * found inside the specified geometry. Thus, if the specified geometry is
 * not a GeometryCollection, an empty list will be returned. The elements of the list 
 * are {@link com.vividsolutions.jts.operation.distance.GeometryLocation}s.
 */  
public static List getLocations(Geometry geom)
{
 List locations = new ArrayList();
 geom.apply(new ConnectedElementLocationFilter(locations));
 return locations;
}
origin: com.vividsolutions/jts

private List extractLines(Collection geoms)
{
 List lines = new ArrayList();
 LinearComponentExtracter lce = new LinearComponentExtracter(lines);
 for (Iterator it = geoms.iterator(); it.hasNext(); ) {
  Geometry geom = (Geometry) it.next();
  geom.apply(lce);
 }
 return lines;
}
origin: com.vividsolutions/jts

public void apply(GeometryComponentFilter filter) {
 filter.filter(this);
 for (int i = 0; i < geometries.length; i++) {
  geometries[i].apply(filter);
 }
}
origin: com.vividsolutions/jts

/**
 * Returns a list containing a Coordinate from each Polygon, LineString, and Point
 * found inside the specified geometry. Thus, if the specified geometry is
 * not a GeometryCollection, an empty list will be returned.
 */
public static List getCoordinates(Geometry geom)
{
 List pts = new ArrayList();
 geom.apply(new ConnectedElementPointFilter(pts));
 return pts;
}
origin: com.vividsolutions/jts

/**
 * Adds the common coordinate bits back into a Geometry.
 * The coordinates of the Geometry are changed.
 *
 * @param geom the Geometry to which to add the common coordinate bits
 */
public void addCommonBits(Geometry geom)
{
 Translater trans = new Translater(commonCoord);
 geom.apply(trans);
 geom.geometryChanged();
}
origin: com.vividsolutions/jts

private static Coordinate[] extractCoordinates(Geometry geom)
{
 UniqueCoordinateArrayFilter filter = new UniqueCoordinateArrayFilter();
 geom.apply(filter);
 return filter.getCoordinates();
}
origin: com.vividsolutions/jts

public static boolean hasSegment(Geometry geom, Coordinate p0, Coordinate p1)
{
 SegmentFindingFilter filter = new SegmentFindingFilter(p0, p1);
 geom.apply(filter);
 return filter.hasSegment();
}
 
origin: com.vividsolutions/jts

protected Geometry rotate(Geometry geom)
{
 if (rotationAngle != 0.0) {
  AffineTransformation trans = AffineTransformation.rotationInstance(rotationAngle, 
    dim.getCentre().x, dim.getCentre().y);
  geom.apply(trans);
 }
 return geom;
}
 
origin: com.vividsolutions/jts

public void apply(CoordinateSequenceFilter filter) {
 if (geometries.length == 0)
  return;
 for (int i = 0; i < geometries.length; i++) {
  geometries[i].apply(filter);
  if (filter.isDone()) {
   break;
  }
 }
 if (filter.isGeometryChanged())
  geometryChanged();
}
origin: com.vividsolutions/jts

private void computeMaxVertexDistance(Geometry curve)
{
MaxPointDistanceFilter distFilter = new MaxPointDistanceFilter(inputGeom);
curve.apply(distFilter);
maxPtDist.setMaximum(distFilter.getMaxPointDistance());
}
 
origin: com.vividsolutions/jts

private void computeMaxMidpointDistance(Geometry curve)
{
MaxMidpointDistanceFilter distFilter = new MaxMidpointDistanceFilter(inputGeom);
curve.apply(distFilter);
maxPtDist.setMaximum(distFilter.getMaxPointDistance());
}
 
origin: com.vividsolutions/jts

private void computeOrientedDistance(Geometry discreteGeom, Geometry geom, PointPairDistance ptDist)
{
 MaxPointDistanceFilter distFilter = new MaxPointDistanceFilter(geom);
 discreteGeom.apply(distFilter);
 ptDist.setMaximum(distFilter.getMaxPointDistance());
 
 if (densifyFrac > 0) {
  MaxDensifiedByFractionDistanceFilter fracFilter = new MaxDensifiedByFractionDistanceFilter(geom, densifyFrac);
  discreteGeom.apply(fracFilter);
  ptDist.setMaximum(fracFilter.getMaxPointDistance());
  
 }
}
origin: com.vividsolutions/jts

public Geometry getResultGeometry() 
{
 // empty input produces an empty result
 if (inputGeom.isEmpty()) return (Geometry) inputGeom.clone();
 
 linestringMap = new HashMap();
 inputGeom.apply(new LineStringMapBuilderFilter());
 lineSimplifier.simplify(linestringMap.values());
 Geometry result = (new LineStringTransformer()).transform(inputGeom);
 return result;
}
com.vividsolutions.jts.geomGeometryapply

Javadoc

Performs an operation with or on this Geometry's coordinates. If this method modifies any coordinate values, #geometryChanged must be called to update the geometry state. Note that you cannot use this method to modify this Geometry if its underlying CoordinateSequence's #get method returns a copy of the Coordinate, rather than the actual Coordinate stored (if it even stores Coordinate objects at all).

Popular methods of Geometry

  • getEnvelopeInternal
    Gets an Envelope containing the minimum and maximum x and y values in this Geometry. If the geometr
  • getCoordinates
    Returns an array containing the values of all the vertices for this geometry. If the geometry is a c
  • isEmpty
    Tests whether the set of points covered by this Geometry is empty.
  • getCentroid
    Computes the centroid of this Geometry. The centroid is equal to the centroid of the set of componen
  • getGeometryN
    Returns an element Geometry from a GeometryCollection(or this, if the geometry is not a collection).
  • toText
    Returns the Well-known Text representation of this Geometry. For a definition of the Well-known Text
  • getNumGeometries
    Returns the number of Geometrys in a GeometryCollection(or 1, if the geometry is not a collection).
  • getFactory
    Gets the factory which contains the context in which this geometry was created.
  • getGeometryType
    Returns the name of this Geometry's actual class.
  • getSRID
    Returns the ID of the Spatial Reference System used by the Geometry. JTS supports Spatial Reference
  • getCoordinate
    Returns a vertex of this Geometry (usually, but not necessarily, the first one). The returned coordi
  • intersection
    Computes a Geometry representing the point-set which is common to both this Geometry and the other
  • getCoordinate,
  • intersection,
  • buffer,
  • contains,
  • getArea,
  • getEnvelope,
  • intersects,
  • union,
  • getLength

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getSharedPreferences (Context)
  • getSupportFragmentManager (FragmentActivity)
  • findViewById (Activity)
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • JFrame (javax.swing)
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now