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

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

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

origin: com.vividsolutions/jts

/**
 * Creates and returns a full copy of this {@link GeometryCollection} object.
 * (including all coordinates contained by it).
 *
 * @return a clone of this instance
 */
public Object clone() {
 GeometryCollection gc = (GeometryCollection) super.clone();
 gc.geometries = new Geometry[geometries.length];
 for (int i = 0; i < geometries.length; i++) {
  gc.geometries[i] = (Geometry) geometries[i].clone();
 }
 return gc;// return the clone
}
origin: com.vividsolutions/jts

/**
 * Computes the union of two geometries, 
 * either or both of which may be null.
 * 
 * @param g0 a Geometry
 * @param g1 a Geometry
 * @return the union of the input(s)
 * or null if both inputs are null
 */
private Geometry unionSafe(Geometry g0, Geometry g1)
{
  if (g0 == null && g1 == null)
    return null;
  if (g0 == null)
    return (Geometry) g1.clone();
  if (g1 == null)
    return (Geometry) g0.clone();
  
  return unionOptimized(g0, g1);
}
 
origin: com.vividsolutions/jts

private Geometry repeatedUnion(List geoms)
{
  Geometry union = null;
  for (Iterator i = geoms.iterator(); i.hasNext(); ) {
    Geometry g = (Geometry) i.next();
    if (union == null)
      union = (Geometry) g.clone();
    else
      union = union.union(g);
  }
  return union;
}
 
origin: com.vividsolutions/jts

/**
 * Creates and returns a full copy of this {@link Point} object.
 * (including all coordinates contained by it).
 *
 * @return a clone of this instance
 */
public Object clone() {
 Point p = (Point) super.clone();
 p.coordinates = (CoordinateSequence) coordinates.clone();
 return p;// return the clone
}
origin: com.vividsolutions/jts

/**
 * Creates and returns a full copy of this {@link LineString} object.
 * (including all coordinates contained by it).
 *
 * @return a clone of this instance
 */
public Object clone() {
 LineString ls = (LineString) super.clone();
 ls.points = (CoordinateSequence) points.clone();
 return ls;
}
origin: com.vividsolutions/jts

/**
 * Cretaes a new @link Geometry which is the result
 * of this transformation applied to the input Geometry.
 * 
 *@param seq  a <code>Geometry</code>
 *@return a transformed Geometry
 */
public Geometry transform(Geometry g)
{
 Geometry g2 = (Geometry) g.clone();
 g2.apply(this);
 return g2;    
}
 
origin: com.vividsolutions/jts

/**
 * Creates a new Geometry which is a normalized
 * copy of this Geometry. 
 * 
 * @return a normalized copy of this geometry.
 * @see #normalize()
 */
public Geometry norm()
{
 Geometry copy = (Geometry) clone();
 copy.normalize();
 return copy;
}
 
origin: com.vividsolutions/jts

/**
 * Creates and returns a full copy of this {@link Polygon} object.
 * (including all coordinates contained by it).
 *
 * @return a clone of this instance
 */
public Object clone() {
 Polygon poly = (Polygon) super.clone();
 poly.shell = (LinearRing) shell.clone();
 poly.holes = new LinearRing[holes.length];
 for (int i = 0; i < holes.length; i++) {
  poly.holes[i] = (LinearRing) holes[i].clone();
 }
 return poly;// return the clone
}
origin: com.vividsolutions/jts

private Geometry[] removeCommonBits(Geometry[] geom)
{
 cbr = new CommonBitsRemover();
 cbr.add(geom[0]);
 cbr.add(geom[1]);
 Geometry remGeom[] = new Geometry[2];
 remGeom[0] = cbr.removeCommonBits((Geometry) geom[0].clone());
 remGeom[1] = cbr.removeCommonBits((Geometry) geom[1].clone());
 return remGeom;
}
 
origin: com.vividsolutions/jts

public Geometry getResultGeometry()
{
 // empty input produces an empty result
 if (inputGeom.isEmpty()) return (Geometry) inputGeom.clone();
 
 return (new DPTransformer(isEnsureValidTopology)).transform(inputGeom);
}
origin: com.vividsolutions/jts

/**
 * Computes a copy of the input {@link Geometry} with the calculated common bits
 * removed from each coordinate.
 * @param geom0 the Geometry to remove common bits from
 * @return a copy of the input Geometry with common bits removed
 */
private Geometry removeCommonBits(Geometry geom0)
{
 cbr = new CommonBitsRemover();
 cbr.add(geom0);
 Geometry geom = cbr.removeCommonBits((Geometry) geom0.clone());
 return geom;
}
origin: com.vividsolutions/jts

 /**
  * Computes a copy of each input {@link Geometry}s with the calculated common bits
  * removed from each coordinate.
  * @param geom0 a Geometry to remove common bits from
  * @param geom1 a Geometry to remove common bits from
  * @return an array containing copies
  * of the input Geometry's with common bits removed
  */
 private Geometry[] removeCommonBits(Geometry geom0, Geometry geom1)
 {
  cbr = new CommonBitsRemover();
  cbr.add(geom0);
  cbr.add(geom1);
  Geometry geom[] = new Geometry[2];
  geom[0] = cbr.removeCommonBits((Geometry) geom0.clone());
  geom[1] = cbr.removeCommonBits((Geometry) geom1.clone());
  return geom;
 }
}
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;
}
origin: com.vividsolutions/jts

 public Geometry reverse()
 {
  Polygon poly = (Polygon) super.clone();
  poly.shell = (LinearRing) ((LinearRing) shell.clone()).reverse();
  poly.holes = new LinearRing[holes.length];
  for (int i = 0; i < holes.length; i++) {
   poly.holes[i] = (LinearRing) ((LinearRing) holes[i].clone()).reverse();
  }
  return poly;// return the clone
 }
}
origin: com.vividsolutions/jts

if (this.isEmpty()) return (Geometry) other.clone();
if (other.isEmpty()) return (Geometry) clone();
origin: com.vividsolutions/jts

/**
 * Computes a <code>Geometry</code> representing the closure of the point-set
 * of the points contained in this <code>Geometry</code> that are not contained in 
 * the <code>other</code> Geometry. 
 * <p>
 * If the result is empty, it is an atomic geometry
 * with the dimension of the left-hand input.
 * <p>
 * Non-empty {@link GeometryCollection} arguments are not supported.
 *
 *@param  other  the <code>Geometry</code> with which to compute the
 *      difference
 *@return a Geometry representing the point-set difference of this <code>Geometry</code> with
 *      <code>other</code>
 * @throws TopologyException if a robustness error occurs
 * @throws IllegalArgumentException if either input is a non-empty GeometryCollection
 */
public Geometry difference(Geometry other)
{
 // special case: if A.isEmpty ==> empty; if B.isEmpty ==> A
 if (this.isEmpty()) return OverlayOp.createEmptyResult(OverlayOp.DIFFERENCE, this, other, factory);
 if (other.isEmpty()) return (Geometry) clone();
 checkNotGeometryCollection(this);
 checkNotGeometryCollection(other);
 return SnapIfNeededOverlayOp.overlayOp(this, other, OverlayOp.DIFFERENCE);
}
origin: com.vividsolutions/jts

if (this.isEmpty()) return (Geometry) other.clone();
if (other.isEmpty()) return (Geometry) clone();
origin: org.geotools/gt-main

/**
 * Sets the geometry contained in this lite shape. Convenient to reuse this
 * object instead of creating it again and again during rendering
 *
 * @param g
 */
public void setGeometry(Geometry g) {
  this.geometry = (Geometry) g.clone();
}
origin: com.vividsolutions/jts-core

/**
 * Creates and returns a full copy of this {@link LineString} object.
 * (including all coordinates contained by it).
 *
 * @return a clone of this instance
 */
public Object clone() {
 LineString ls = (LineString) super.clone();
 ls.points = (CoordinateSequence) points.clone();
 return ls;
}
origin: com.vividsolutions/jts-core

private Geometry repeatedUnion(List geoms)
{
  Geometry union = null;
  for (Iterator i = geoms.iterator(); i.hasNext(); ) {
    Geometry g = (Geometry) i.next();
    if (union == null)
      union = (Geometry) g.clone();
    else
      union = union.union(g);
  }
  return union;
}
 
com.vividsolutions.jts.geomGeometryclone

Javadoc

Creates and returns a full copy of this Geometry object (including all coordinates contained by it). Subclasses are responsible for overriding this method and copying their internal data. Overrides should call this method first.

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,
  • apply,
  • getLength

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getSharedPreferences (Context)
  • getSupportFragmentManager (FragmentActivity)
  • findViewById (Activity)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Top plugins for Android Studio
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