net.sourceforge.jgrib.gdsgrids
Class GribGDSLambert

Object
  extended by GribRecordGDS
      extended by GribGDSLambert

public final class GribGDSLambert
extends GribRecordGDS

A class that represents the Grid Definition Section (GDS) of a GRIB record using the Lambert Conformal projection.

Author:
Capt Richard D. Gonzalez, Alesio Fabiani, Simone Giannecchini

Field Summary
protected  double grid_latin1
          Latin 1 - The first latitude from pole at which secant cone cuts the sperical earth.
protected  double grid_latin2
          Latin 2 - The second latitude from pole at which secant cone cuts the sperical earth.
protected  double grid_latsp
          latitude of south pole.
protected  double grid_lonsp
          longitude of south pole.
protected  double grid_startx
          starting x value using this projection.
protected  double grid_starty
          starting y value using this projection.
static int LAMBERT_GRID_TYPE
           
protected  int proj_center
          Projection Center Flag.
 
Fields inherited from class GribRecordGDS
adiacent_i, EARTH_RADIUS, grid_dx, grid_dy, grid_lat1, grid_lat2, grid_lon1, grid_lon2, grid_mode, grid_nx, grid_ny, grid_rotang, grid_scan, grid_type, length
 
Constructor Summary
GribGDSLambert()
          GribGDSLambert
GribGDSLambert(ImageInputStream in, int[] header)
          Constructs a GribRecordGDS object from a bit input stream.
 
Method Summary
 boolean canProduce(int GDSType)
           
 boolean equals(Object obj)
           
 double[] getGridCoords()
          Get grid coordinates in latitude/longitude adapted from J.P.
 double getGridDY()
          Get y-increment/distance between two grid points.
 double getGridLatin1()
          Get first latitude from the pole at which cone cuts spherical earth - see note 8 of Table D
 double getGridLatin2()
          Get second latitude from the pole at which cone cuts spherical earth - see note 8 of Table D
 double getGridLatSP()
          Get latitude of south pole.
 double[] getGridLonLatEnvelope()
           
 double getGridLonSP()
          Get longitude of south pole of a rotated latitude/longitude grid.
 double getGridLov()
          Get orientation of the grid
 int getGridScanmode()
          Get scan mode (sign of increments).
 Map getImplementationHints()
           
 String getName()
           
 int getProjCenter()
          Get Projection Center flag - see note 5 of Table D.
 double getRhoRef()
           
 double getStartX()
          Get starting x value for this grid - THIS IS NOT A LONGITUDE, but an x value calculated for this specific projection, based on an origin of latin1, lov.
 double getStartY()
          Get starting y value for this grid - THIS IS NOT A LATITUDE, but an y value calculated for this specific projection, based on an origin of latin1, lov.
 Set<Integer> getSupportedTypes()
           
 double[] getXCoords()
          Get all x Axis grid coordinates
 double[] getYCoords()
          Get all y Axis grid coordinates
 int hashCode()
           
 boolean isAvailable()
           
 void setGridLatin1(double grid_latin1)
           
 void setGridLatin2(double grid_latin2)
           
 void setProjCenter(int proj_center)
           
 void setRhoRef(double rhoRef)
           
 String toString()
          Get a string representation of this GDS.
 void writeTo(OutputStream out)
          writeTo
 
Methods inherited from class GribRecordGDS
compare, getGridDX, getGridLat1, getGridLat2, getGridLon1, getGridLon2, getGridMode, getGridNX, getGridNY, getGridRotAngle, 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

LAMBERT_GRID_TYPE

public static final int LAMBERT_GRID_TYPE
See Also:
Constant Field Values

proj_center

protected int proj_center
Projection Center Flag.


grid_latin1

protected double grid_latin1
Latin 1 - The first latitude from pole at which secant cone cuts the sperical earth. See Note 8 of ON388.


grid_latin2

protected double grid_latin2
Latin 2 - The second latitude from pole at which secant cone cuts the sperical earth. See Note 8 of ON388.


grid_latsp

protected double grid_latsp
latitude of south pole.


grid_lonsp

protected double grid_lonsp
longitude of south pole.


grid_startx

protected double grid_startx
starting x value using this projection. This is NOT a lat or lon, but a grid position in this projection


grid_starty

protected double grid_starty
starting y value using this projection. This is NOT a lat or lon, but a grid position in this projection

Constructor Detail

GribGDSLambert

public GribGDSLambert(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

GribGDSLambert

public GribGDSLambert()
GribGDSLambert

Method Detail

hashCode

public int hashCode()
Overrides:
hashCode in class GribRecordGDS

equals

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

getGridLov

public double getGridLov()
Get orientation of the grid

Returns:
east longitude value of meridian parallel to y axis.

getGridDY

public double getGridDY()
Get y-increment/distance between two grid points.

Overrides:
getGridDY in class GribRecordGDS
Returns:
y-increment

getProjCenter

public int getProjCenter()
Get Projection Center flag - see note 5 of Table D.

Returns:
Projection Center flag

getGridScanmode

public int getGridScanmode()
Get scan mode (sign of increments). Only 64, 128 and 192 supported so far.

Overrides:
getGridScanmode in class GribRecordGDS
Returns:
scan mode

getGridLatin1

public double getGridLatin1()
Get first latitude from the pole at which cone cuts spherical earth - see note 8 of Table D

Returns:
latitude of south pole

getGridLatin2

public double getGridLatin2()
Get second latitude from the pole at which cone cuts spherical earth - see note 8 of Table D

Returns:
latitude of south pole

getGridLatSP

public double getGridLatSP()
Get latitude of south pole.

Overrides:
getGridLatSP in class GribRecordGDS
Returns:
latitude of south pole

getGridLonSP

public double getGridLonSP()
Get longitude of south pole of a rotated latitude/longitude grid.

Overrides:
getGridLonSP in class GribRecordGDS
Returns:
longitude of south pole

getStartX

public double getStartX()
Get starting x value for this grid - THIS IS NOT A LONGITUDE, but an x value calculated for this specific projection, based on an origin of latin1, lov.

Returns:
x grid value of first point of this grid.

getStartY

public double getStartY()
Get starting y value for this grid - THIS IS NOT A LATITUDE, but an y value calculated for this specific projection, based on an origin of latin1, lov.

Returns:
y grid value of first point of this grid.

setGridLatin1

public void setGridLatin1(double grid_latin1)

setGridLatin2

public void setGridLatin2(double grid_latin2)

setProjCenter

public void setProjCenter(int proj_center)

getRhoRef

public double getRhoRef()

setRhoRef

public void setRhoRef(double rhoRef)

getXCoords

public double[] getXCoords()
Get all x Axis grid coordinates

Returns:
array of coordinates in the LC projection for the x axis. These are the LC coordinates that equate to the Longitudes along the x axis. rdg - modified to return in km, vice m

getYCoords

public double[] getYCoords()
Get all y Axis grid coordinates

Returns:
array of coordinates in the LC projection for the y axis. These are the LC coordinates that equate to the Latitudes along the y axis. rdg - converted to return km vice m

getGridCoords

public double[] getGridCoords()
Get grid coordinates in latitude/longitude 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/LambertConformalConicProjection.html Origin is where Lov intersects Latin1. Note: In GRIB table D, the first standard parallel (Latin1) is the one closest to the pole. In the mathematical formulas, the first standard parallel is the one closest to the equator. Therefore, the math looks backwards here, but it isn't.

Overrides:
getGridCoords in class GribRecordGDS
Returns:
latitide/longitude as doubles

getGridLonLatEnvelope

public double[] getGridLonLatEnvelope()

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.