Geography

The Geography incorporates geographical data such as longitude, latitude, altitude, ice covering etc. All data items are associated with a node of the SCellGrid.

Code:

Public Members

uint m_iNumCells;

Number of cells.

uint m_iMaxNeighbors;

Maximum number of neighbors (usually 4 or 6).

geonumber   m_dRadius;

“Real” earth radius.

geonumber   m_dSeaLevel;

Sea level (may change, depending on climate).

geonumber  *m_adLatitude;

“Real” latitude of cell center (radians).

geonumber  *m_adLongitude;

“Real” longitude of cell center (radians).

geonumber  *m_adAltitude;

“Real” altitude of cell center (meters).

geonumber  *m_adDistances;

Distances to neighbors: distances from cell k at m_adDistances[N*k, N*k+N-1], where N = max #neighbors.

geonumber  *m_adArea;

Areas of the cells.

bool       *m_abIce;

Ice coverage. One bool per cell: ice (1) or no ice (0).

geonumber  *m_adWater;

Presence of water (rivers in cell). One double per cell.

bool       *m_abCoastal;

Coast in neighborhood. One bool per cell: coast near (1) or no coast (0)

geonumber  *m_adAngles;
Orientation of direction to neighbors:

\(0\) -> east, \(\pi/2\) -> north, \(\pi\) -> west, \(3\pi/2\) -> south.

Direction of cell k to neighbor j is in m_adAngles[N*k+j] , where N = max #neighbors.

This must be explicily calculated with calcAngles().

bool m_bUpdated;

Update flag.

Public Methods

constructors

Geography(uint iNumCells, uint iMaxNeighbors, geonumber dRadius, geonumber dSeaLevel=0);
Geography();
iNumCells

Number of grid cells.

iMaxNeighbors

Maximum number of neighbors for a cell (usually 4 or 6 ).

dRadius

Sphere Radius (only makes sense for spherical grids).

dSeaLevel

Initial sea level.

The constructor allocates the arrays.

destructor

virtual ~Geography();

The destructors deletes all allocated arrays.

calcAngles

void calcAngles(SCellGrid* pCG);
pCG

SCellGrid object to calculate the angles on.

Calculates the orientation of the direction for each cell to each of its neighbors.