Isis 3 Developer Reference
Isis::GroundGrid Class Reference

Calculates a lat/lon grid over an area. More...

#include <GroundGrid.h>

Collaboration diagram for Isis::GroundGrid:
Collaboration graph

Public Member Functions

 GroundGrid (UniversalGroundMap *gmap, bool splitLatLon, bool extendGrid, unsigned int width, unsigned int height)
 This method initializes the class by allocating the grid, calculating the lat/lon range, and getting a default grid resolution. More...
 
virtual ~GroundGrid ()
 Delete the object. More...
 
void CreateGrid (Latitude baseLat, Longitude baseLon, Angle latInc, Angle lonInc, Progress *progress=0)
 This method draws the grid internally, using default resolutions. More...
 
void CreateGrid (Latitude baseLat, Longitude baseLon, Angle latInc, Angle lonInc, Progress *progress, Angle latRes, Angle lonRes)
 This method draws the grid internally. More...
 
void WalkBoundary ()
 This draws grid lines along the extremes of the lat/lon box of the grid. More...
 
void SetGroundLimits (Latitude minLat, Longitude minLon, Latitude maxLat, Longitude maxLon)
 This restricts (or grows) the ground range in which to draw grid lines. More...
 
bool PixelOnGrid (int x, int y)
 Returns true if the grid is on this point. More...
 
bool PixelOnGrid (int x, int y, bool latGrid)
 Returns true if the grid is on this point. More...
 
Latitude minLatitude () const
 Returns the minimum latitude for the grid. More...
 
Longitude minLongitude () const
 Returns the minimum longitude for the grid. More...
 
Latitude maxLatitude () const
 Returns the maximum latitude for the grid. More...
 
Longitude maxLongitude () const
 Returns the maximum longitude for the grid. More...
 
PvlGroupGetMappingGroup ()
 Returns a mapping group representation of the projection or camera. More...
 

Protected Member Functions

virtual bool GetXY (Latitude lat, Longitude lon, unsigned int &x, unsigned int &y)
 This method converts a lat/lon to an X/Y. More...
 
UniversalGroundMapGroundMap ()
 Returns the ground map for children. More...
 

Detailed Description

Calculates a lat/lon grid over an area.

This class, given a universal ground map, area width and height, base lat/lon, lat/lon increments, and optionalls a progress and resolutions will calculate where grid lines should lie.

Author
2010-01-06 Steven Lambright

Constructor & Destructor Documentation

◆ GroundGrid()

Isis::GroundGrid::GroundGrid ( UniversalGroundMap gmap,
bool  splitLatLon,
bool  extendGrid,
unsigned int  width,
unsigned int  height 
)

This method initializes the class by allocating the grid, calculating the lat/lon range, and getting a default grid resolution.

Parameters
gmapA universal ground map to use for calculating the grid
splitLatLonMake two grids: one for latitude lines and one for longitude lines
extendGridIf the grid should extend past the longitude domain boundary.
widthThe width of the grid; often cube samples
heightThe height of the grid; often cube samples

References Isis::PvlObject::findGroup(), Isis::Distance::meters(), and Isis::toDouble().

◆ ~GroundGrid()

Isis::GroundGrid::~GroundGrid ( )
virtual

Delete the object.

Member Function Documentation

◆ CreateGrid() [1/2]

void Isis::GroundGrid::CreateGrid ( Latitude  baseLat,
Longitude  baseLon,
Angle  latInc,
Angle  lonInc,
Progress progress = 0 
)

This method draws the grid internally, using default resolutions.

Parameters
baseLatLatitude to hit in the grid
baseLonLongitude to hit in the grid
latIncDistance between latitude lines
lonIncDistance between longitude lines
progressIf passed in, this progress will be used

◆ CreateGrid() [2/2]

void Isis::GroundGrid::CreateGrid ( Latitude  baseLat,
Longitude  baseLon,
Angle  latInc,
Angle  lonInc,
Progress progress,
Angle  latRes,
Angle  lonRes 
)

This method draws the grid internally.

It is not valid to call PixelOnGrid until this method has been called.

Parameters
baseLatLatitude to hit in the grid
baseLonLongitude to hit in the grid
latIncDistance between latitude lines
lonIncDistance between longitude lines
progressIf passed in, this progress will be used
latResResolution of latitude lines (in degrees/pixel)
lonResResolution of longitude lines (in degrees/pixel)

References _FILEINFO_, Isis::Progress::CheckStatus(), Isis::Angle::isValid(), Isis::Latitude::setErrorChecking(), and Isis::Progress::SetMaximumSteps().

◆ GetMappingGroup()

PvlGroup * Isis::GroundGrid::GetMappingGroup ( )

Returns a mapping group representation of the projection or camera.

This is useful for matching units with lat/lons.

Returns
Returns a mapping group representation of the projection or camera

◆ GetXY()

bool Isis::GroundGrid::GetXY ( Latitude  lat,
Longitude  lon,
unsigned int &  x,
unsigned int &  y 
)
protectedvirtual

This method converts a lat/lon to an X/Y.

This implementation converts to sample/line.

Parameters
latLatitude of Lat/Lon pair to convert to S/L
lonLongitude of Lat/Lon pair to convert to S/L
xOutput sample (0-based)
yOutput line (0-based)
Returns
bool Successful

◆ GroundMap()

UniversalGroundMap * Isis::GroundGrid::GroundMap ( )
protected

Returns the ground map for children.

◆ maxLatitude()

Latitude Isis::GroundGrid::maxLatitude ( ) const

Returns the maximum latitude for the grid.

Returns
Latitude The maximum latitude for the grid. If no maximum has been set, then a default Latitude object is returned.

◆ maxLongitude()

Longitude Isis::GroundGrid::maxLongitude ( ) const

Returns the maximum longitude for the grid.

Returns
Longitude The maximum longitude for the grid. If no maximum has been set, then a default Longitude object is returned.

◆ minLatitude()

Latitude Isis::GroundGrid::minLatitude ( ) const

Returns the minimum latitude for the grid.

Returns
Latitude The minimum latitude for the grid. If no minimum has been set, then a default Latitude object is returned.

◆ minLongitude()

Longitude Isis::GroundGrid::minLongitude ( ) const

Returns the minimum longitude for the grid.

Returns
Longitude The minimum longitude for the grid. If no minimum has been set, then a default Longitude object is returned.

◆ PixelOnGrid() [1/2]

bool Isis::GroundGrid::PixelOnGrid ( int  x,
int  y 
)

Returns true if the grid is on this point.

Parameters
xX-Coordinate of grid (0-based)
yY-Coordinate of grid (0-based)
Returns
bool Pixel lies on grid

◆ PixelOnGrid() [2/2]

bool Isis::GroundGrid::PixelOnGrid ( int  x,
int  y,
bool  latGrid 
)

Returns true if the grid is on this point.

Using this method is recommended if lat/lon grids are separate.

Parameters
xX-Coordinate of grid (0-based)
yY-Coordinate of grid (0-based)
latGridTrue for latitude lines, false for longitude lines
Returns
bool Pixel lies on grid

◆ SetGroundLimits()

void Isis::GroundGrid::SetGroundLimits ( Latitude  minLat,
Longitude  minLon,
Latitude  maxLat,
Longitude  maxLon 
)

This restricts (or grows) the ground range in which to draw grid lines.

Parameters
minLatThe lowest latitude extreme to draw grid lines to
maxLatThe highest latitude extreme to draw grid lines to
minLonThe lowest longitude extreme to draw grid lines to
maxLonThe highest longitude extreme to draw grid lines to

References Isis::Angle::isValid().

◆ WalkBoundary()

void Isis::GroundGrid::WalkBoundary ( )

This draws grid lines along the extremes of the lat/lon box of the grid.

References Isis::Latitude::setErrorChecking().


The documentation for this class was generated from the following files: