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

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

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

origin: com.vividsolutions/jts

/**
 * Tests whether two geometries are exactly equal
 * in their normalized forms.
 * This is a convenience method which creates normalized
 * versions of both geometries before computing
 * {@link #equalsExact(Geometry)}.
 * <p>
 * This method is relatively expensive to compute.  
 * For maximum performance, the client 
 * should instead perform normalization on the individual geometries
 * at an appropriate point during processing.
 * 
 * @param g a Geometry
 * @return true if the input geometries are exactly equal in their normalized form
 */
public boolean equalsNorm(Geometry g)
{
 if (g == null) return false;
 return norm().equalsExact(g.norm());
}
 
origin: com.vividsolutions/jts-core

/**
 * Tests whether two geometries are exactly equal
 * in their normalized forms.
 * This is a convenience method which creates normalized
 * versions of both geometries before computing
 * {@link #equalsExact(Geometry)}.
 * <p>
 * This method is relatively expensive to compute.  
 * For maximum performance, the client 
 * should instead perform normalization on the individual geometries
 * at an appropriate point during processing.
 * 
 * @param g a Geometry
 * @return true if the input geometries are exactly equal in their normalized form
 */
public boolean equalsNorm(Geometry g)
{
 if (g == null) return false;
 return norm().equalsExact(g.norm());
}
 
origin: org.orbisgis/test-utilities

/**
 * Check Geometry type,X,Y,Z and SRID
 *
 * @param expectedWKT Expected value, in WKT
 * @param expectedSRID Expected SRID code,
 * @param valueObject Test value geometry ex rs.getObject(i)
 * @throws SQLException If WKT or WKB is not valid
 */
public static void assertGeometryEquals(String expectedWKT,int expectedSRID, Object valueObject) throws SQLException {
  if (expectedWKT == null) {
    assertNull(valueObject);
  } else {
    ValueGeometry expected = ValueGeometry.get(expectedWKT, expectedSRID);
    ValueGeometry actual = ValueGeometry.getFromGeometry(((Geometry)valueObject).norm());
    expected = ValueGeometry.getFromGeometry(expected.getGeometry().norm());
    String moreInfo = "";
    if(!actual.equals(expected)) {
      if(!GeometryCollection.class.getName().equals(expected.getGeometry().getClass().getName()) &&
          !GeometryCollection.class.getName().equals(actual.getGeometry().getClass().getName()) &&
          expected.getGeometry().equals(actual.getGeometry())) {
        moreInfo = "\n But are topologically equals";
      }
    }
    assertEquals("Expected:\n" + expected.getWKT() + "\nActual:\n" + actual.getWKT()+moreInfo, expected, actual);
  }
}
/**
origin: org.orbisgis/h2gis-test-utilities

/**
 * Check Geometry type,X,Y,Z and SRID
 *
 * @param expectedWKT Expected value, in WKT
 * @param expectedSRID Expected SRID code,
 * @param valueObject Test value geometry ex rs.getObject(i)
 * @throws SQLException If WKT or WKB is not valid
 */
public static void assertGeometryEquals(String expectedWKT,int expectedSRID, Object valueObject) throws SQLException {
  if (expectedWKT == null) {
    assertNull(valueObject);
  } else {
    ValueGeometry expected = ValueGeometry.get(expectedWKT, expectedSRID);
    ValueGeometry actual = ValueGeometry.getFromGeometry(((Geometry)valueObject).norm());
    expected = ValueGeometry.getFromGeometry(expected.getGeometry().norm());
    String moreInfo = "";
    if(!actual.equals(expected)) {
      if(!GeometryCollection.class.getName().equals(expected.getGeometry().getClass().getName()) &&
          !GeometryCollection.class.getName().equals(actual.getGeometry().getClass().getName()) &&
          expected.getGeometry().equals(actual.getGeometry())) {
        moreInfo = "\n But are topologically equals";
      }
    }
    assertEquals("Expected:\n" + expected.getWKT() + "\nActual:\n" + actual.getWKT()+moreInfo, expected, actual);
  }
}
/**
origin: org.locationtech.geogig/geogig-core

@Test
public void testEnforcesPolygonNormalization() throws Exception {
  // outer ring in cw order, inner rings in ccw order
  String normalizedWKT = "POLYGON((0 0, 0 9, 9 9, 9 0, 0 0), (3 3, 6 3, 6 6, 3 6, 3 3))";
  // outer ring in ccw order, inner rings in cc order
  String reversedWKT = "POLYGON((0 0, 9 0, 9 9, 0 9, 0 0), (3 3, 3 6, 6 6, 6 3, 3 3))";
  Geometry normalized = new WKTReader().read(normalizedWKT);
  Geometry reversed = new WKTReader().read(reversedWKT);
  assertTrue(normalized.equalsExact(normalized.norm()));
  assertFalse(reversed.equalsExact(reversed.norm()));
  RevFeatureBuilder builder = builder();
  RevFeature norm = builder.addValue(normalized).build();
  RevFeature rev = builder.reset().addValue(reversed).build();
  Geometry expected = (Geometry) norm.getValues().get(0).get();
  Geometry actual = (Geometry) rev.getValues().get(0).get();
  assertTrue(normalized.equalsExact(expected));
  assertTrue(normalized.equalsExact(actual));
}
origin: org.locationtech.geogig/geogig-core

assertFalse(normalized.equalsExact(normalized.norm()));// the linestring is not normalized
assertTrue(normalized.getGeometryN(2).equalsExact(normalized.getGeometryN(2).norm()));
assertFalse(reversed.getGeometryN(2).equalsExact(reversed.getGeometryN(2).norm()));
com.vividsolutions.jts.geomGeometrynorm

Javadoc

Creates a new Geometry which is a normalized copy of this Geometry.

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

  • Reactive rest calls using spring rest template
  • scheduleAtFixedRate (Timer)
  • getExternalFilesDir (Context)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • JTextField (javax.swing)
  • Sublime Text for Python
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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