Codota Logo
Geometry.difference
Code IndexAdd Codota to your IDE (free)

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

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

  • Common ways to obtain Geometry
private void myMethod () {
Geometry g =
  • Codota IconGeometryCollection gc;gc.getGeometryN(n)
  • Codota IconSimpleFeature feature;(Geometry) feature.getDefaultGeometry()
  • Codota IconString wellKnownText;new WKTReader().read(wellKnownText)
  • Smart code suggestions by Codota
}
origin: opentripplanner/OpenTripPlanner

  continue;
mainComponent = mainComponent.difference(geom);
origin: com.vividsolutions/jts

 public void difference(String wktA, String wktB, PrecisionModel pm)
   throws ParseException
 {
  System.out.println("-------------------------------------------");
  System.out.println("Running example using Precision Model = " + pm);
  GeometryFactory fact = new GeometryFactory(pm);
  WKTReader wktRdr = new WKTReader(fact);

  Geometry A = wktRdr.read(wktA);
  Geometry B = wktRdr.read(wktB);
  Geometry C = A.difference(B);

  System.out.println("A intersection B = " + C);
 }
}
origin: com.vividsolutions/jts

/**
 * Computes the set-theoretic difference of two {@link Geometry}s, using enhanced precision.
 * @param geom0 the first Geometry
 * @param geom1 the second Geometry, to be subtracted from the first
 * @return the Geometry representing the set-theoretic difference of the input Geometries.
 */
public Geometry difference(Geometry geom0, Geometry geom1)
{
 Geometry[] geom = removeCommonBits(geom0, geom1);
 return computeResultPrecision(geom[0].difference(geom[1]));
}
origin: com.vividsolutions/jts

public static Geometry lineStringSelfIntersections(LineString line)
{
 Geometry lineEndPts = getEndPoints(line);
 Geometry nodedLine = line.union(lineEndPts);
 Geometry nodedEndPts = getEndPoints(nodedLine);
 Geometry selfIntersections = nodedEndPts.difference(lineEndPts);
 return selfIntersections;
}
origin: com.vividsolutions/jts

Geometry result = geom0.difference(geom1);
return result;
origin: org.orbisgis/h2gis-functions

  /**
   * @param a Geometry instance.
   * @param b Geometry instance
   * @return the difference between two geometries
   */
  public static Geometry difference(Geometry a,Geometry b) {
    if(a==null || b==null) {
      return null;
    }
    return a.difference(b);
  }
}
origin: us.ihmc/ihmc-jmonkey-engine-toolkit

public static Geometry difference(Geometry a, Geometry b)
{
 return a.difference(b);
}
origin: org.geotools/gt-main

static public Geometry difference(Geometry arg0,Geometry arg1)
{
   if (arg0 == null || arg1 == null) return null;
   Geometry _this = arg0;
   return _this.difference(arg1);
}
origin: org.geotools/gt2-main

static public Geometry difference(Geometry arg0,Geometry arg1)
{
   Geometry _this = arg0;
   return _this.difference(arg1);
}
origin: org.orbisgis/h2gis

  /**
   * @param a Geometry instance.
   * @param b Geometry instance
   * @return the difference between two geometries
   */
  public static Geometry difference(Geometry a,Geometry b) {
    if(a==null || b==null) {
      return null;
    }
    return a.difference(b);
  }
}
origin: org.orbisgis/h2spatial

  /**
   * @param a Geometry instance.
   * @param b Geometry instance
   * @return the difference between two geometries
   */
  public static Geometry difference(Geometry a,Geometry b) {
    if(a==null || b==null) {
      return null;
    }
    return a.difference(b);
  }
}
origin: com.vividsolutions/jts-example

 public void difference(String wktA, String wktB, PrecisionModel pm)
   throws ParseException
 {
  System.out.println("-------------------------------------------");
  System.out.println("Running example using Precision Model = " + pm);
  GeometryFactory fact = new GeometryFactory(pm);
  WKTReader wktRdr = new WKTReader(fact);

  Geometry A = wktRdr.read(wktA);
  Geometry B = wktRdr.read(wktB);
  Geometry C = A.difference(B);

  System.out.println("A intersection B = " + C);
 }
}
origin: com.vividsolutions/jts-core

/**
 * Computes the set-theoretic difference of two {@link Geometry}s, using enhanced precision.
 * @param geom0 the first Geometry
 * @param geom1 the second Geometry, to be subtracted from the first
 * @return the Geometry representing the set-theoretic difference of the input Geometries.
 */
public Geometry difference(Geometry geom0, Geometry geom1)
{
 Geometry[] geom = removeCommonBits(geom0, geom1);
 return computeResultPrecision(geom[0].difference(geom[1]));
}
origin: com.googlecode.jaitools/jt-utils

@Override
public ROI subtract(ROI roi) {
  final Geometry geom = getGeometry(roi);
  if (geom != null) {
    return new ROIGeometry(theGeom.getGeometry().difference(geom));
  }
  throw new UnsupportedOperationException(UNSUPPORTED_ROI_TYPE);
}
origin: Stratio/cassandra-lucene-index

/**
 * Returns the difference of the specified shapes.
 *
 * @return the difference
 */
@Override
public JtsGeometry apply() {
  Geometry result = shapes.get(0).apply().getGeom();
  for (int i = 1; i < shapes.size(); i++) {
    result = result.difference(shapes.get(i).apply().getGeom());
  }
  return CONTEXT.makeShape(result);
}
origin: org.jboss.teiid/teiid-engine

public static GeometryType difference(GeometryType geom1, GeometryType geom2) throws FunctionExecutionException {
  Geometry g1 = getGeometry(geom1);
  Geometry g2 = getGeometry(geom2);
  return getGeometryType(g1.difference(g2));
}
origin: BaseXdb/basex

 @Override
 public Item item(final QueryContext qc, final InputInfo ii) throws QueryException {
  return toElement(checkGeo(0, qc).difference(checkGeo(1, qc)), qc);
 }
}
origin: com.vividsolutions/jts-example

public static Geometry lineStringSelfIntersections(LineString line)
{
 Geometry lineEndPts = getEndPoints(line);
 Geometry nodedLine = line.union(lineEndPts);
 Geometry nodedEndPts = getEndPoints(nodedLine);
 Geometry selfIntersections = nodedEndPts.difference(lineEndPts);
 return selfIntersections;
}
origin: teiid/teiid

public static GeometryType difference(GeometryType geom1, GeometryType geom2) throws FunctionExecutionException {
  Geometry g1 = getGeometry(geom1);
  Geometry g2 = getGeometry(geom2);
  return getGeometryType(g1.difference(g2), geom1.getSrid());
}
origin: org.teiid/teiid-engine

public static GeometryType difference(GeometryType geom1, GeometryType geom2) throws FunctionExecutionException {
  Geometry g1 = getGeometry(geom1);
  Geometry g2 = getGeometry(geom2);
  return getGeometryType(g1.difference(g2), geom1.getSrid());
}
com.vividsolutions.jts.geomGeometrydifference

Javadoc

Computes a Geometry representing the closure of the point-set of the points contained in this Geometry that are not contained in the other Geometry.

If the result is empty, it is an atomic geometry with the dimension of the left-hand input.

Non-empty GeometryCollection arguments are not supported.

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

  • Making http requests using okhttp
  • scheduleAtFixedRate (Timer)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • startActivity (Activity)
  • FileInputStream (java.io)
    A FileInputStream obtains input bytes from a file in a file system. What files are available depends
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • Path (java.nio.file)
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • JCheckBox (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now