Package org.vast.util

Class SpatialExtent

java.lang.Object
org.vast.util.SpatialExtent
Direct Known Subclasses:
Bbox

public class SpatialExtent extends Object

Class for storing the definition of a spatial domain. This mainly includes enveloppe coordinates and a crs.

Since:
Nov 15, 2005
  • Field Details

    • crs

      protected String crs
    • minX

      protected double minX
    • maxX

      protected double maxX
    • minY

      protected double minY
    • maxY

      protected double maxY
    • minZ

      protected double minZ
    • maxZ

      protected double maxZ
  • Constructor Details

    • SpatialExtent

      public SpatialExtent()
  • Method Details

    • copy

      public SpatialExtent copy()
      Returns:
      an exact copy of this SpatialExtent
    • getCenter

      public double[] getCenter()
    • getDiagonalDistance

      public double getDiagonalDistance()
    • getMaxDistance

      public double getMaxDistance()
    • getSizeX

      public double getSizeX()
    • getSizeY

      public double getSizeY()
    • getSizeZ

      public double getSizeZ()
    • isNull

      public boolean isNull()
    • isNull

      protected boolean isNull(boolean testZ)
    • nullify

      public void nullify()
    • resizeToContain

      public void resizeToContain(double x, double y, double z)
      Resize spatial extent so that it contains the given 3D point Point x,y,z coordinates must be in same Crs as SpatialExtent
      Parameters:
      x -
      y -
      z -
    • add

      public void add(SpatialExtent bbox)
      Combines given extent with this extent by computing the smallest rectangular extent that contains both of them.
      Parameters:
      bbox -
    • intersects

      public boolean intersects(SpatialExtent bbox)
      Finds out if this bbox intersects the given bbox.
      Parameters:
      bbox -
      Returns:
      true if both bbox intersect
    • contains

      public boolean contains(SpatialExtent bbox)
      Finds out if given extent is included in this one. Returns true if extent is completely contained within this extent
      Parameters:
      bbox -
      Returns:
      true if given bbox is contained in this bbox
    • checkCrs

      protected void checkCrs(SpatialExtent bbox)
      Checks if extents crs are compatible
      Parameters:
      bbox -
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getCrs

      public String getCrs()
    • setCrs

      public void setCrs(String crs)
    • getMaxX

      public double getMaxX()
    • setMaxX

      public void setMaxX(double maxX)
    • getMaxY

      public double getMaxY()
    • setMaxY

      public void setMaxY(double maxY)
    • getMaxZ

      public double getMaxZ()
    • setMaxZ

      public void setMaxZ(double maxZ)
    • getMinX

      public double getMinX()
    • setMinX

      public void setMinX(double minX)
    • getMinY

      public double getMinY()
    • setMinY

      public void setMinY(double minY)
    • getMinZ

      public double getMinZ()
    • setMinZ

      public void setMinZ(double minZ)
    • toString

      public String toString()
      Overrides:
      toString in class Object