thredds.datamodel.gis
Class AbstractGisFeature

java.lang.Object
  extended by thredds.datamodel.gis.AbstractGisFeature
All Implemented Interfaces:
GisFeature
Direct Known Subclasses:
GisFeatureAdapter

public abstract class AbstractGisFeature
extends java.lang.Object
implements GisFeature

Abstract class that implements common methods for concrete implementations of GisFeature.

Version:
$Id:AbstractGisFeature.java 63 2006-07-12 21:50:51Z edavis $
Author:
Russ Rew, John Caron

Constructor Summary
AbstractGisFeature()
           
 
Method Summary
abstract  java.awt.geom.Rectangle2D getBounds2D()
          Get the bounding box for this feature.
abstract  java.util.Iterator getGisParts()
          Get the parts of this feature, in the form of an iterator.
abstract  int getNumParts()
          Get number of parts comprising this feature.
abstract  int getNumPoints()
          Get total number of points in all parts of this feature.
 java.awt.Shape getProjectedShape(ProjectionImpl displayProject)
          Convert this GisFeature to a java.awt.Shape.
 java.awt.Shape getProjectedShape(ProjectionImpl dataProject, ProjectionImpl displayProject)
          Convert this GisFeature to a java.awt.Shape.
 java.awt.Shape getShape()
          Convert this GisFeature to a java.awt.Shape, using the default coordinate system, mapping gisFeature(x,y) -> screen(x,y).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractGisFeature

public AbstractGisFeature()
Method Detail

getBounds2D

public abstract java.awt.geom.Rectangle2D getBounds2D()
Description copied from interface: GisFeature
Get the bounding box for this feature.

Specified by:
getBounds2D in interface GisFeature
Returns:
rectangle bounding this feature

getNumPoints

public abstract int getNumPoints()
Description copied from interface: GisFeature
Get total number of points in all parts of this feature.

Specified by:
getNumPoints in interface GisFeature
Returns:
total number of points in all parts of this feature.

getNumParts

public abstract int getNumParts()
Description copied from interface: GisFeature
Get number of parts comprising this feature.

Specified by:
getNumParts in interface GisFeature
Returns:
number of parts comprising this feature.

getGisParts

public abstract java.util.Iterator getGisParts()
Description copied from interface: GisFeature
Get the parts of this feature, in the form of an iterator.

Specified by:
getGisParts in interface GisFeature
Returns:
the iterator over the parts of this feature. Each part is a GisPart.

getShape

public java.awt.Shape getShape()
Convert this GisFeature to a java.awt.Shape, using the default coordinate system, mapping gisFeature(x,y) -> screen(x,y). LOOK STILL HAVE TO crossSeam()

Returns:
shape corresponding to this feature.

getProjectedShape

public java.awt.Shape getProjectedShape(ProjectionImpl displayProject)
Convert this GisFeature to a java.awt.Shape. The data coordinate system is assumed to be (lat, lon), use the projection to transform points, so project.latLonToProj(gisFeature(x,y)) -> screen(x,y).

Parameters:
displayProject - Projection to use to display
Returns:
shape corresponding to this feature

getProjectedShape

public java.awt.Shape getProjectedShape(ProjectionImpl dataProject,
                                        ProjectionImpl displayProject)
Convert this GisFeature to a java.awt.Shape. The data coordinate system is in the coordinates of dataProject, and the screen is in the coordinates of displayProject. So: displayProject.latLonToProj( dataProject.projToLatLon(gisFeature(x,y))) -> screen(x,y).

Parameters:
dataProject - data Projection to use.
displayProject - display Projection to use.
Returns:
shape corresponding to this feature