Class GeoShape

java.lang.Object
ca.spatial.table.GeoShape
All Implemented Interfaces:
Shape, Comparable
Direct Known Subclasses:
LineGeoShape, PointGeoShape, PolygonGeoShape

public abstract class GeoShape extends Object implements Comparable, Shape
  • Constructor Details

    • GeoShape

      public GeoShape(AttributeStore as, int id, double[][] coords)
  • Method Details

    • setExtent

      public void setExtent(Extent2D extent)
    • getExtent

      public Extent2D getExtent()
    • getBounds2D

      public Rectangle2D getBounds2D()
      Specified by:
      getBounds2D in interface Shape
    • getBounds

      public Rectangle getBounds()
      Specified by:
      getBounds in interface Shape
    • getId

      public int getId()
    • getCoordinates

      public double[][] getCoordinates()
    • getAttributeStore

      public AttributeStore getAttributeStore()
    • setAttributeStore

      public void setAttributeStore(AttributeStore as)
    • getValueAt

      public Object getValueAt(int field, int period)
    • getIntAttr

      public int getIntAttr(int field, int period)
    • getDoubleAttr

      public double getDoubleAttr(int field, int period)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • distance

      public abstract double distance(double x, double y)
    • geometry

      public abstract org.locationtech.jts.geom.Geometry geometry()
    • magnitude

      public static double magnitude(double x, double y, double x1, double y1)
      Euclidean distance between two points.
    • distPointLine

      public static double distPointLine(double x, double y, double x1, double y1, double x2, double y2)
      Euclidean distance between a point and a segment. Compute intersection of line with a perpendicular line that travels through the point.
    • distPointLine

      public static double distPointLine(double x, double y, double[] coords)
      Euclidean distance between a point and a line.
    • isPointNearLine

      public static boolean isPointNearLine(double x, double y, double[] coords, double threshold)
      Test if a point is with a threshold distance of a line.
    • distanceToEdge

      public static double distanceToEdge(Shape shape, double x, double y)
      Compute the minimum distance from a point to an edge of this shape.
    • centroid

      public Point2D centroid()
    • centroid

      public static Point2D centroid(PathIterator pi)
    • length

      public double length()
    • length

      public static double length(PathIterator pi)
    • length

      public static double length(double[] coords)
    • area

      public double area()
    • area

      public static double area(PathIterator pi)
    • area

      public static double area(double[][] coords)
    • compareTo

      public int compareTo(Object o)
      Specified by:
      compareTo in interface Comparable
    • contains

      public boolean contains(double x, double y)
      Specified by:
      contains in interface Shape
    • contains

      public boolean contains(Point2D p)
      Specified by:
      contains in interface Shape
    • contains

      public boolean contains(double x, double y, double w, double h)
      Specified by:
      contains in interface Shape
    • contains

      public boolean contains(Rectangle2D r)
      Specified by:
      contains in interface Shape
    • intersects

      public boolean intersects(double x, double y, double w, double h)
      Specified by:
      intersects in interface Shape
    • intersects

      public boolean intersects(Rectangle2D r)
      Specified by:
      intersects in interface Shape
    • getPathIterator

      public PathIterator getPathIterator(AffineTransform at)
      Specified by:
      getPathIterator in interface Shape
    • getPathIterator

      public PathIterator getPathIterator(AffineTransform at, double flatness)
      Specified by:
      getPathIterator in interface Shape
    • thin

      public abstract GeoShape thin(double epsilon)
      Douglas Peucker recursive line thinning
    • thin

      public static double[] thin(double[] coords, double tolerance)