net.sourceforge.jgrib.gdsgrids
Class GribGDSPolarStereo

Object
  extended by GribRecordGDS
      extended by GribGDSPolarStereo

public final class GribGDSPolarStereo
extends GribRecordGDS

A class that represents the grid definition section (GDS) of a GRIB record.

Author:
Benjamin Stark, Capt Richard D. Gonzalez

Field Summary
protected  double grid_center_lat
          Longitude of Center - assumed 60 N or 60 S based on note 2 of table D
protected  int grid_proj_center
          Projection Center Flag.
protected  double grid_startx
          starting x value using this projection.
protected  double grid_starty
          starting y value using this projection.
static int POLAR_STEREO_GRID_TYPE
           
protected  double SCALE_FACTOR
          Central Scale Factor.
 
Fields inherited from class GribRecordGDS
adiacent_i, EARTH_RADIUS, grid_dx, grid_dy, grid_lat1, grid_lat2, grid_latsp, grid_lon1, grid_lon2, grid_lonsp, grid_mode, grid_nx, grid_ny, grid_rotang, grid_scan, grid_type, length
 
Constructor Summary
GribGDSPolarStereo()
          GribGDSPolarStereo
GribGDSPolarStereo(ImageInputStream in, int[] header)
          Constructs a GribRecordGDS object from a bit input stream.
 
Method Summary
 boolean canProduce(int GDSType)
           
 boolean equals(Object obj)
           
 double getGridCenterLat()
          Get the Latitude of the circle where grid lengths are defined
 double[] getGridCoords()
          Get grid coordinates in longitude/latitude adapted from J.P.
 Map getImplementationHints()
           
 String getName()
           
 int getProjCenterFlag()
          Get projection center flag.
 Set<Integer> getSupportedTypes()
           
 double[] getXCoords()
          Get all longitide coordinates
 double[] getYCoords()
          Get all latitude coordinates
 int hashCode()
           
 boolean isAvailable()
           
 String toString()
          Get a string representation of this GDS.
 void writeTo(OutputStream out)
          writeTo
 
Methods inherited from class GribRecordGDS
compare, getGridDX, getGridDY, getGridLat1, getGridLat2, getGridLatSP, getGridLon1, getGridLon2, getGridLonSP, getGridMode, getGridNX, getGridNY, getGridRotAngle, getGridScanmode, getGridType, getLength, isAdiacent_i_Or_j, setGridDX, setGridDY, setGridLat1, setGridLat2, setGridLatSP, setGridLon1, setGridLon2, setGridLonSP, setGridMode, setGridNX, setGridNY, setGridRotAngle, setGridScanmode, setGridType, setLength
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

POLAR_STEREO_GRID_TYPE

public static final int POLAR_STEREO_GRID_TYPE
See Also:
Constant Field Values

grid_proj_center

protected int grid_proj_center
Projection Center Flag.


grid_startx

protected double grid_startx
starting x value using this projection. This is not a Longitude, but an x value based on the projection


grid_starty

protected double grid_starty
starting y value using this projection. This is not a Latitude, but a y value based on the projection


SCALE_FACTOR

protected final double SCALE_FACTOR
Central Scale Factor. Assumed 1.0

See Also:
Constant Field Values

grid_center_lat

protected double grid_center_lat
Longitude of Center - assumed 60 N or 60 S based on note 2 of table D

Constructor Detail

GribGDSPolarStereo

public GribGDSPolarStereo(ImageInputStream in,
                          int[] header)
                   throws IOException
Constructs a GribRecordGDS object from a bit input stream.

Parameters:
in - bit input stream with GDS content
header - - int array with first six octets of the GDS
Throws:
IOException - if stream can not be opened etc.
NoValidGribException - if stream contains no valid GRIB file
NotSupportedException - DOCUMENT ME!

GribGDSPolarStereo

public GribGDSPolarStereo()
GribGDSPolarStereo

Method Detail

hashCode

public int hashCode()
Overrides:
hashCode in class GribRecordGDS

equals

public boolean equals(Object obj)
Overrides:
equals in class GribRecordGDS

getProjCenterFlag

public int getProjCenterFlag()
Get projection center flag.

Returns:
projection center flag

getGridCenterLat

public double getGridCenterLat()
Get the Latitude of the circle where grid lengths are defined

Returns:
grid_center_lat

getXCoords

public double[] getXCoords()
Get all longitide coordinates

Returns:
longtitude as double

getYCoords

public double[] getYCoords()
Get all latitude coordinates

Returns:
latitude as double

getGridCoords

public double[] getGridCoords()
Get grid coordinates in longitude/latitude adapted from J.P. Snyder, Map Projections - A Working Manual, U.S. Geological Survey Professional Paper 1395, 1987 Maintained his symbols, so the code matches his work. Somewhat hard to follow, if interested, suggest looking up quick reference at http://mathworld.wolfram.com/PolarStereoConicProjection.html assumes scale factor of 1.0 rdg - may not be correct yet - did not align with display software I was using, but they implemented using a center point, vice LOV

Overrides:
getGridCoords in class GribRecordGDS
Returns:
longitide/latitude as doubles

toString

public String toString()
Get a string representation of this GDS.

Overrides:
toString in class GribRecordGDS
Returns:
string representation of this GDS

writeTo

public void writeTo(OutputStream out)
             throws IOException
Description copied from class: GribRecordGDS
writeTo

Specified by:
writeTo in class GribRecordGDS
Parameters:
out - OutputStream
Throws:
IOException - DOCUMENT ME!

getName

public String getName()

getSupportedTypes

public Set<Integer> getSupportedTypes()

isAvailable

public boolean isAvailable()

canProduce

public boolean canProduce(int GDSType)

getImplementationHints

public Map getImplementationHints()


Copyright © 2006-2010 GeoSolutions. All Rights Reserved.