Tabnine Logo
ReferencedEnvelope3D.getCoordinateReferenceSystem
Code IndexAdd Tabnine to your IDE (free)

How to use
getCoordinateReferenceSystem
method
in
org.geotools.geometry.jts.ReferencedEnvelope3D

Best Java code snippets using org.geotools.geometry.jts.ReferencedEnvelope3D.getCoordinateReferenceSystem (Showing top 6 results out of 315)

origin: geoserver/geoserver

@Test
public void testWgs84BoundsFromCompoundCRS() throws Exception {
  try {
    MapProjection.SKIP_SANITY_CHECKS = true;
    CatalogBuilder cb = new CatalogBuilder(getCatalog());
    ReferencedEnvelope3D bounds =
        new ReferencedEnvelope3D(
            142892, 470783, 16, 142900, 470790, 20, CRS.decode("EPSG:7415"));
    // used to throw an exception here
    ReferencedEnvelope latLonBounds =
        cb.getLatLonBounds(bounds, bounds.getCoordinateReferenceSystem());
    assertTrue(
        CRS.equalsIgnoreMetadata(
            CRS.decode("EPSG:4326"), latLonBounds.getCoordinateReferenceSystem()));
    // System.out.println(latLonBounds);
  } finally {
    MapProjection.SKIP_SANITY_CHECKS = false;
  }
}
origin: geotools/geotools

public String getSRS() {
  return CRS.toSRS(envelope.getCoordinateReferenceSystem());
}
origin: geotools/geotools

/**
 * Creates a new envelope from an existing envelope.
 *
 * @param envelope The envelope to initialize from
 * @throws MismatchedDimensionException if the CRS dimension is not valid.
 */
public ReferencedEnvelope3D(final ReferencedEnvelope3D envelope)
    throws MismatchedDimensionException {
  init(envelope);
  crs = envelope.getCoordinateReferenceSystem();
  checkCoordinateReferenceSystemDimension();
}
origin: geotools/geotools

@Test
public void empty() {
  // ensure empty can grab a default CRS when starting from nothing
  ReferencedEnvelope3D bbox = new ReferencedEnvelope3D(); // this is empty
  assertNull(bbox.getCoordinateReferenceSystem());
  ReferencedEnvelope3D australia = new ReferencedEnvelope3D(DefaultGeographicCRS.WGS84_3D);
  australia.include(40, 110, 0);
  australia.include(10, 150, 10);
  bbox.include(australia);
  assertEquals(australia.getCoordinateReferenceSystem(), bbox.getCoordinateReferenceSystem());
  assertEquals(0, bbox.getMinZ(), 0d);
  assertEquals(10, bbox.getMaxZ(), 0d);
}
origin: geotools/geotools

public Expression getExpression2() {
  // in this case, the 3D BBOX falls back to regular 2D bbox behaviour (until there is more
  // support for 3D geometries)
  // 3DBBOX must be run as a post-filter in order to support the third coordinate.
  Coordinate[] coords = new Coordinate[5];
  coords[0] = new Coordinate(envelope.getMinX(), envelope.getMinY());
  coords[1] = new Coordinate(envelope.getMinX(), envelope.getMaxY());
  coords[2] = new Coordinate(envelope.getMaxX(), envelope.getMaxY());
  coords[3] = new Coordinate(envelope.getMaxX(), envelope.getMinY());
  coords[4] = new Coordinate(envelope.getMinX(), envelope.getMinY());
  LinearRing ring = null;
  GeometryFactory gfac = new GeometryFactory();
  try {
    ring = gfac.createLinearRing(coords);
  } catch (TopologyException tex) {
    throw new IllegalFilterException(tex.toString());
  }
  Polygon polygon = gfac.createPolygon(ring, null);
  if (envelope instanceof ReferencedEnvelope3D) {
    ReferencedEnvelope3D refEnv = (ReferencedEnvelope3D) envelope;
    polygon.setUserData(refEnv.getCoordinateReferenceSystem());
  }
  return factory.literal(polygon);
}
origin: geotools/geotools

/**
 * Computes the intersection of two {@link Envelope}s.
 *
 * @param env the envelope to intersect with
 * @return a new Envelope representing the intersection of the envelopes (this will be the null
 *     envelope if either argument is null, or they do not intersect
 */
public ReferencedEnvelope3D intersection(ReferencedEnvelope3D env) {
  ensureCompatibleReferenceSystem(env);
  if (isNull() || env.isNull() || !intersects(env)) return new ReferencedEnvelope3D();
  double intMinX = getMinX() > env.getMinX() ? getMinX() : env.getMinX();
  double intMinY = getMinY() > env.getMinY() ? getMinY() : env.getMinY();
  double intMinZ = minz > env.minz ? minz : env.minz;
  double intMaxX = getMaxX() < env.getMaxX() ? getMaxX() : env.getMaxX();
  double intMaxY = getMaxY() < env.getMaxY() ? getMaxY() : env.getMaxY();
  double intMaxZ = maxz < env.maxz ? maxz : env.maxz;
  return new ReferencedEnvelope3D(
      intMinX,
      intMaxX,
      intMinY,
      intMaxY,
      intMinZ,
      intMaxZ,
      env.getCoordinateReferenceSystem());
}
org.geotools.geometry.jtsReferencedEnvelope3DgetCoordinateReferenceSystem

Popular methods of ReferencedEnvelope3D

  • <init>
    Creates a null envelope with the specified coordinate reference system.
  • getMaxZ
  • getMinZ
  • expandToInclude
  • getDimension
    Returns the number of dimensions.
  • getMaximum
    Returns the maximal ordinate along the specified dimension.
  • getMinimum
    Returns the minimal ordinate along the specified dimension.
  • init
    Sets this envelope to the specified bounding box.
  • intersects
    Check if this bounding box intersects the provided bounds.
  • isEmpty
    Returns true if lengths along all dimension are zero.
  • isNull
  • setToNull
    Makes this Envelope a "null" envelope, that is, the envelope of the empty geometry.
  • isNull,
  • setToNull,
  • centre,
  • checkCoordinateReferenceSystemDimension,
  • contains,
  • covers,
  • distance,
  • ensureCompatibleReferenceSystem,
  • equals

Popular in Java

  • Making http post requests using okhttp
  • onRequestPermissionsResult (Fragment)
  • onCreateOptionsMenu (Activity)
  • getSystemService (Context)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Top plugins for WebStorm
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