Class HexagonStore

All Implemented Interfaces:
PopupActivationListener, SpatialStore, Serializable, Comparable, EventListener, ListSelectionListener, TableModel

public class HexagonStore extends ShapeStore
A class to dynamically provide a hexagon rasterization of an input dataset.

Record numbers begin at 0.

See Also:
Serialized Form
  • Constructor Details

    • HexagonStore

      public HexagonStore(GeoRelationalStore as, Extent2D userExtent, int sideLength)
      Build a hexagon representation of an input dataset. The hexagons will be labeled by the index (row number) of the original polygons.
      Parameters:
      as - the polygon layer to turn in to hexagons
      userExtent - an extent to snap the grid to. If null then the grid will start at the low x,y position of the input dataset.
      sideLength - the length of the side of a hexagon
  • Method Details

    • getTopology

      public Topology getTopology()
      Get the fully connected touching topology for this hex layer
    • getTopology

      public Topology getTopology(TopologyCutter tc)
      Get the partially connected topology for this hex layer, as intersected by the barriers in the TopologyCutter.
      Parameters:
      tc - The TopologyCutter object that contains barriers
    • getValueAt

      public Object getValueAt(int row, int column, int period)
      Description copied from class: AttributeStore
      Get a cell value
      Specified by:
      getValueAt in class AttributeStore
      Parameters:
      row - The row containing the cell
      column - The column containing the cell
      period - The period of interest
      Returns:
      An object containing the cell value.
    • setValueAt

      public void setValueAt(Object o, int row, int column, int period)
      Description copied from class: AttributeStore
      Set the value in a cell and notify listeners that the value has changed.

      Implementing classes that override must call this method to ensure that joins are properly maintained.

      Overrides:
      setValueAt in class AttributeStore
      Parameters:
      o - The value to be set.
      row - The row containing the cell
      column - The column containing the cell
      period - The period of interest
    • close

      public void close()
      Description copied from class: AttributeStore
      Close the table and release resources. The table should be used again after this method has been called.

      In many cases you do not need to call this method when you are finished using a table. Most tables will close automatically when they are no longer referenced.

      It is possible that this method will be deprecated or removed in a future release.

      Overrides:
      close in class AttributeStore
    • getType

      public int getType()
      Return the shapefile type.
    • getRowCount

      public int getRowCount()
      Return the number of records in the shapefile.
      Specified by:
      getRowCount in interface SpatialStore
      Specified by:
      getRowCount in interface TableModel
      Specified by:
      getRowCount in class AttributeStore
      Returns:
      the number of rows in this store
    • getPeriodCount

      public int getPeriodCount()
      Description copied from class: AttributeStore
      Get the total number of periods that this store supports
      Specified by:
      getPeriodCount in class AttributeStore
      Returns:
      The number of periods in this store
    • getYearForPeriod

      public int getYearForPeriod(int period)
      Description copied from class: AttributeStore
      Get the ending year for a given period.
      Specified by:
      getYearForPeriod in class AttributeStore
      Parameters:
      period - The period of interest
      Returns:
      the year for a given period
    • getSelection

      public BitSet getSelection(Extent2D e)
      Description copied from interface: SpatialStore
      Get a set of records that fall within the selection rectangle.
      Parameters:
      e - The selection rectangle of interest
      Returns:
      A set of selected records
    • getShape

      public GeoShape getShape(int id, int period)
      Description copied from interface: SpatialStore
      Get the shape object for a individual feature
      Parameters:
      id - The record of interest
      period - The period of interest
      Returns:
      A shape object
    • getCoordinates

      public double[][] getCoordinates(int row)
      Description copied from interface: SpatialStore
      Get a list of raw coordinates for the points in this shape.
      Parameters:
      row - The row of interest
      Returns:
      An array of arrays of coordinate points. Each element in the outer array contains a 'part' of the underlying shape (for example, and island or a multi-part polygon). The inner array index holds the coordinate points of that part.
    • getExtent2D

      public Extent2D getExtent2D(int row, int period)
      Description copied from interface: SpatialStore
      Get the enclosing rectangle of a feature
      Parameters:
      row - The record of interest
      period - The period of interest
      Returns:
      A rectangle
    • centroid

      public Point2D centroid(int row)
      Get the centroid of the record
    • centroid

      public Point2D centroid(int rw, int cl)
      Get the centroid of the record
    • getProjectionInfo

      public String getProjectionInfo()
      Description copied from interface: SpatialStore
      Obtain projection information.
      Specified by:
      getProjectionInfo in interface SpatialStore
      Overrides:
      getProjectionInfo in class ShapeStore
    • hasSpatialIndex

      public boolean hasSpatialIndex()
      Description copied from interface: SpatialStore
      Query if this SpatialStore has a spatial index
    • canBuildSpatialIndex

      public boolean canBuildSpatialIndex()
      Description copied from interface: SpatialStore
      Query if this SpatialStore is capable of building a spatial index
    • makeSpatialIndex

      public void makeSpatialIndex()
      Description copied from interface: SpatialStore
      Request that this SpatialStore create a spatial index