RiverRat  - An MIT iCampus project http://web.mit.edu/riverrat/

Main Page | Software Documentation | Hardware Documentation | People | Contact | Wiki

Main Page | Class Hierarchy | Class List | File List | Class Members

riverrat.Map Class Reference

Finished prototype - Provides a data type for building Maps that translate latitude/longitude data to x/y screen data. More...

List of all members.

Public Member Functions

float getAspect ()
 Returns a float that specifies the ratio of width to height of the target.

boolean isFixedAspect ()
 Returns true if the aspect is fixed.

void setAspect (float asp)
 Sets the aspect ratio of the Map.

float getLonFromX (float x)
 Returns a longitude in decimal degrees that corresponds to a given x value from 0.0 to 1.0f If x is out of range, x is reset to the nearest edge.

float getLatFromY (float y)
 Returns a latitude in decimal degrees that corresponds to a given y value from 0.0 to 1.0f If y is out of range, y is reset to the nearest edge.

float getXFromLon (float lon)
 Returns an x value from 0.0 to 1.0 that corresponds to a given longitude on the map.

float getYFromLat (float lat)
 Returns an y value from 0.0 to 1.0 that corresponds to a given latitude on the map.

float getWidth ()
 Returns the width in decimal degrees of a Map.

float getHeight ()
 Returns the height in decimal degrees of a Map.

float getNorthLat ()
 Returns the latitude of the northern edge of a Map.

float getSouthLat ()
 Returns the latitude of the southern edge of a Map.

float getWestLon ()
 Returns the longitude of the western edge of a Map.

float getEastLon ()
 Returns the longitude of the eastern edge of Map.


Package Functions

 Map ()
 Default Constructor.

 Map (Fix f1, Fix f2)
 Constructor.


Static Package Attributes

final boolean DEBUG = false


Detailed Description

Finished prototype - Provides a data type for building Maps that translate latitude/longitude data to x/y screen data.

The first version of this class is complete.

Definition at line 9 of file Map.java.


Constructor & Destructor Documentation

riverrat.Map.Map  )  [package]
 

Default Constructor.

Creates a Map with two Fixes as its corners.

Definition at line 22 of file Map.java.

riverrat.Map.Map Fix  f1,
Fix  f2
[package]
 

Constructor.

Takes any two opposite corners of a box and makes a map with the appropriate dimensions and corners.

Parameters:
f1 a Fix object that is one corner of the box f2 a Fix object that is the opposite corner of the box

Definition at line 34 of file Map.java.

References riverrat.Fix.getLat(), and riverrat.Fix.getLon().


Member Function Documentation

float riverrat.Map.getAspect  ) 
 

Returns a float that specifies the ratio of width to height of the target.

Returns:
float with the ratio of width/height

Definition at line 70 of file Map.java.

References riverrat.Map.getHeight(), and riverrat.Map.getWidth().

float riverrat.Map.getEastLon  ) 
 

Returns the longitude of the eastern edge of Map.

Returns:
a float with decimal degrees of the eastern edge

Definition at line 234 of file Map.java.

References riverrat.Fix.getLon().

Referenced by riverrat.Map.getLonFromX().

float riverrat.Map.getHeight  ) 
 

Returns the height in decimal degrees of a Map.

Returns:
a float with decimal degrees of the map height

Definition at line 198 of file Map.java.

References riverrat.Fix.getLat().

Referenced by riverrat.Map.getAspect(), riverrat.Map.getLatFromY(), riverrat.Map.getYFromLat(), and riverrat.Map.setAspect().

float riverrat.Map.getLatFromY float  y  ) 
 

Returns a latitude in decimal degrees that corresponds to a given y value from 0.0 to 1.0f If y is out of range, y is reset to the nearest edge.

Parameters:
y a float from 0.0 to 1.0 giving a map y value
Returns:
the latitude at the specified y-coordinate

Definition at line 132 of file Map.java.

References riverrat.Map.getHeight(), and riverrat.Map.getSouthLat().

float riverrat.Map.getLonFromX float  x  ) 
 

Returns a longitude in decimal degrees that corresponds to a given x value from 0.0 to 1.0f If x is out of range, x is reset to the nearest edge.

Parameters:
x a float from 0.0 to 1.0 giving a map x value
Returns:
the longitude at the specified x-coordinate

Definition at line 118 of file Map.java.

References riverrat.Map.getEastLon(), and riverrat.Map.getWidth().

float riverrat.Map.getNorthLat  ) 
 

Returns the latitude of the northern edge of a Map.

Returns:
a float with decimal degrees of the northern edge

Definition at line 207 of file Map.java.

References riverrat.Fix.getLat().

float riverrat.Map.getSouthLat  ) 
 

Returns the latitude of the southern edge of a Map.

Returns:
a float with decimal degrees of the southern edge

Definition at line 216 of file Map.java.

References riverrat.Fix.getLat().

Referenced by riverrat.Map.getLatFromY(), and riverrat.Map.getYFromLat().

float riverrat.Map.getWestLon  ) 
 

Returns the longitude of the western edge of a Map.

Returns:
a float with decimal degrees of the western edge

Definition at line 225 of file Map.java.

References riverrat.Fix.getLon().

Referenced by riverrat.Map.getXFromLon().

float riverrat.Map.getWidth  ) 
 

Returns the width in decimal degrees of a Map.

Returns:
a float with decimal degrees of the map width

Definition at line 189 of file Map.java.

References riverrat.Fix.getLon().

Referenced by riverrat.Map.getAspect(), riverrat.Map.getLonFromX(), riverrat.Map.getXFromLon(), and riverrat.Map.setAspect().

float riverrat.Map.getXFromLon float  lon  ) 
 

Returns an x value from 0.0 to 1.0 that corresponds to a given longitude on the map.

Parameters:
lon a float with longitude in decimal degrees
Returns:
a float from 0.0 to 1.0

Definition at line 145 of file Map.java.

References riverrat.Map.getWestLon(), and riverrat.Map.getWidth().

float riverrat.Map.getYFromLat float  lat  ) 
 

Returns an y value from 0.0 to 1.0 that corresponds to a given latitude on the map.

Parameters:
lat a float with latitude in decimal degrees
Returns:
a float from 0.0 to 1.0

Definition at line 168 of file Map.java.

References riverrat.Map.getHeight(), and riverrat.Map.getSouthLat().

boolean riverrat.Map.isFixedAspect  ) 
 

Returns true if the aspect is fixed.

Returns:
boolean, true if the aspect is fixed

Definition at line 79 of file Map.java.

void riverrat.Map.setAspect float  asp  ) 
 

Sets the aspect ratio of the Map.

Used for resizing.

Parameters:
asp float with the ratio of width/height

Definition at line 88 of file Map.java.

References riverrat.Map.getHeight(), and riverrat.Map.getWidth().


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

Brought to you by the RiverRat team.