ilog.views.maps.grids
Class IlvMGRSGridZone

java.lang.Object
  extended by ilog.views.maps.grids.IlvLatLonRectangleGridZone
      extended by ilog.views.maps.grids.IlvMGRSGridZone
All Implemented Interfaces:
IlvPersistentObject, IlvGridZone

public class IlvMGRSGridZone
extends IlvLatLonRectangleGridZone

A UTM or stereographic MGRS grid zone. This zone is identified by its band (from 'A' to 'Z') and its zone (from 1 to 60). Bands 'A','B','Y','Z' contain a single polar zones (half disc). The other bands divide the earth ellipsoid in 6 by 8 degrees rectangles. Each grid zone defines a specific projection, normalized by the MGRS standard.

Since:
JViews 7.5

Nested Class Summary
static class IlvMGRSGridZone.InvalidGridZone
          Exception thrown when creating an invalid grid zone (wrong band or zone number).
 
Field Summary
protected static String alphabet
          Sequence of letters to be used for the vertical identification letter of 100k meter zones.
protected static String alphabetpolex
          Sequence of letters to be used for the horizontal identification letter of 100k meter polar zones.
protected static String alphabetx
          Sequence of letters to be used for the horizontal identification letter of 100k meter UTM zones.
 
Constructor Summary
IlvMGRSGridZone(IlvInputStream stream)
          Creates a grid zone by reading parameters from the stream.
IlvMGRSGridZone(int zone, char band)
          Creates a UTM or stereographic MGRS grid zone.
 
Method Summary
static void addAllZones(IlvMGRSGrid grid)
          Adds grid zones from A to Z, 1 to 60.
static void addZones(IlvMGRSGrid grid, char minBand, char maxBand, int minZone, int maxZone)
          Creates and adds the Grid Zones into the grid.
 char getBand()
          Returns the band of the grid zone.
static String getIdentification(int zone, char band, double x, double y)
          Computes the 2 letter identification of the 100k meter zone for the specified coordinates.
 IlvProjection getProjection()
          Computes the projection to be used for this grid zone.
 String getSubgridIdentification(double x, double y)
          Returns the identification (displayed in grid center) of the grid subzone.
 int getZone()
          Returns The zone (1 to 60) of the grid zone.
 String toString()
          Returns Either the zone/band identification of this grid zone for UTM, or a single letter for UPS.
 void write(IlvOutputStream stream)
          Writes the attributes of the zone.
 
Methods inherited from class ilog.views.maps.grids.IlvLatLonRectangleGridZone
computeXYBounds, getLatMax, getLatMed, getLatMin, getLonMax, getLonMed, getLonMin, setLatMax, setLatMin, setLonMax, setLonMin
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

alphabet

protected static final String alphabet
Sequence of letters to be used for the vertical identification letter of 100k meter zones.

See Also:
Constant Field Values

alphabetpolex

protected static final String alphabetpolex
Sequence of letters to be used for the horizontal identification letter of 100k meter polar zones.

See Also:
Constant Field Values

alphabetx

protected static final String alphabetx
Sequence of letters to be used for the horizontal identification letter of 100k meter UTM zones.

See Also:
Constant Field Values
Constructor Detail

IlvMGRSGridZone

public IlvMGRSGridZone(int zone,
                       char band)
                throws IlvMGRSGridZone.InvalidGridZone
Creates a UTM or stereographic MGRS grid zone.

Parameters:
zone - MGRS zone (from 1 to 60).
band - MGRS band (from 'A' to 'Z').
Throws:
IlvMGRSGridZone.InvalidGridZone - if the band or zone is invalid (for example, there can be no X32 zone).

IlvMGRSGridZone

public IlvMGRSGridZone(IlvInputStream stream)
                throws IlvReadFileException
Creates a grid zone by reading parameters from the stream.

Parameters:
stream - Stream to read from.
Throws:
IlvReadFileException
Method Detail

addZones

public static void addZones(IlvMGRSGrid grid,
                            char minBand,
                            char maxBand,
                            int minZone,
                            int maxZone)
Creates and adds the Grid Zones into the grid. If minBand is greater than maxBand, or minZone is greater than maxBand, nothing will be created. Zones for bands 'A','B','Y','Z' are polar grid zones. Only one grid zone will be created for those bands.

Parameters:
grid - grid to add the zones into.
minBand - The first MGRS band (between 'A' and 'Z') created.
maxBand - The last MGRS band (between 'A' and 'Z') created.
minZone - The first valid MGRS zone (between 1 and 60) created.
maxZone - The last valid MGRS zone (between 1 and 60) created.

addAllZones

public static void addAllZones(IlvMGRSGrid grid)
Adds grid zones from A to Z, 1 to 60.

Parameters:
grid - grid to add zones into.

getBand

public char getBand()
Returns the band of the grid zone.

Returns:
A character from 'A' to 'Z'.

getProjection

public IlvProjection getProjection()
Computes the projection to be used for this grid zone.
For Universal Transverse Mercator Grid zones:
Projection: Transverse Mercator in zones 6 degrees wide.
 Ellipsoid: the ellipsoid specified at construction.
 Longitude of Origin: Central meridian (CM) of each projection zone.
 Latitude of Origin: 0 degrees (the Equator).
 Unit: Meters.
 False Northing: 0 meters at the Equator for the Northern Hemisphere; 10,000,000 meters at the Equator for the Southern Hemisphere.
 False Easting: 500,000 meters at the CM of each zone.
 Scale Factor at the Central Meridian: 0.9996. 

for Universal Polar Stereographic (UPS) Grid zones.
Projection: Polar Stereographic.
 Ellipsoid: World Geodetic System 1984
 Longitude of Origin: 0 degrees and 180 degrees E-W.
 Latitude of Origin: 90 degrees N and 90 degrees S.
 Unit: Meter.
 False Northing: 2,000,000 meters.
 False Easting: 2,000,000 meters.
 Scale Factor at the Origin: 0.994. 

Returns:
The projection to be used for this grid zone.

getZone

public int getZone()
Returns The zone (1 to 60) of the grid zone.

Returns:
The zone (1 to 60) of the grid zone.

toString

public String toString()
Returns Either the zone/band identification of this grid zone for UTM, or a single letter for UPS.

Overrides:
toString in class Object
Returns:
Either the zone/band identification of this grid zone for UTM, or a single letter for UPS.
See Also:
Object.toString()

write

public void write(IlvOutputStream stream)
           throws IOException
Writes the attributes of the zone.

Parameters:
stream - the output stream
Throws:
IOException - thrown when an exception occurs during the write operation for this object.
See Also:
IlvPersistentObject.write(ilog.views.io.IlvOutputStream)

getSubgridIdentification

public String getSubgridIdentification(double x,
                                       double y)
Returns the identification (displayed in grid center) of the grid subzone.

Parameters:
x - Projected x coordinate of subgrid center.
y - Projected y coordinate of subgrid center.
Returns:
A string.
See Also:
IlvGridZone.getSubgridIdentification(double, double)

getIdentification

public static String getIdentification(int zone,
                                       char band,
                                       double x,
                                       double y)
Computes the 2 letter identification of the 100k meter zone for the specified coordinates.

Parameters:
zone - Grid zone number.
band - Grid zone band.
x - Projected x coordinate.
y - Projected y coordinate.
Returns:
The two letter identification of the 100k meter zone.


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.