GeoDataCoordinates Class Reference
from PyKDE4.marble import *
Subclasses: Marble.GeoDataPoint
Namespace: Marble
Detailed Description
A 3d point representation
GeoDataCoordinates is the simple representation of a single three dimensional point. It can be used all through out marble as the data type for three dimensional objects. it comprises of a Quaternion for speed issues. This class was introduced to reflect the difference between a simple 3d point and the GeoDataGeometry object containing such a point. The latter is a GeoDataPoint and is simply derived from GeoDataCoordinates.
- See also:
- GeoDataPoint
Enumerations | |
| Notation | { Decimal, DMS } |
| Unit | { Radian, Degree } |
Methods | |
| __init__ (self, Marble.GeoDataCoordinates other) | |
| __init__ (self) | |
| __init__ (self, float lon, float lat, float alt=0, Marble.GeoDataCoordinates.Unit unit=GeoDataCoordinates.Radian, int detail=0) | |
| float | altitude (self) |
| int | detail (self) |
| geoCoordinates (self, float lon, float lat, Marble.GeoDataCoordinates.Unit unit=GeoDataCoordinates.Radian) | |
| bool | operator == (self, Marble.GeoDataCoordinates a0) |
| pack (self, QDataStream stream) | |
| Marble.Quaternion | quaternion (self) |
| set (self, float lon, float lat, float alt=0, Marble.GeoDataCoordinates.Unit unit=GeoDataCoordinates.Radian) | |
| setAltitude (self, float altitude) | |
| setDetail (self, int det) | |
| QString | toString (self) |
| QString | toString (self, Marble.GeoDataCoordinates.Notation notation) |
| unpack (self, QDataStream stream) | |
Static Methods | |
| Marble.GeoDataCoordinates.Notation | defaultNotation () |
| Marble.GeoDataCoordinates | fromString (QString string, bool successful) |
| float | normalizeLat (float lat) |
| float | normalizeLon (float lon) |
| normalizeLonLat (float lon, float lat) | |
| setDefaultNotation (Marble.GeoDataCoordinates.Notation notation) | |
Method Documentation
| __init__ | ( | self, | ||
| Marble.GeoDataCoordinates | other | |||
| ) |
| __init__ | ( | self ) |
| __init__ | ( | self, | ||
| float | lon, | |||
| float | lat, | |||
| float | alt=0, | |||
| Marble.GeoDataCoordinates.Unit | unit=GeoDataCoordinates.Radian, | |||
| int | detail=0 | |||
| ) |
create a geocoordinate from longitude and latitude
- Parameters:
-
_lon longitude _lat latitude alt altitude (default: 0) _unit units that lon and lat get measured in (default for Radian: north pole at pi/2, southpole at -pi/2) _detail detail (default: 0)
| float altitude | ( | self ) |
return the altitude of the Point
| Marble.GeoDataCoordinates.Notation defaultNotation | ( | ) |
return Notation of string representation
| int detail | ( | self ) |
return the detail flag
| Marble.GeoDataCoordinates fromString | ( | QString | string, | |
| bool | successful | |||
| ) |
try to parse the string into a coordinate pair
- Parameters:
-
successful becomes true if the conversion succeeds
- Returns:
- the geodatacoordinates
| geoCoordinates | ( | self, | ||
| float | lon, | |||
| float | lat, | |||
| Marble.GeoDataCoordinates.Unit | unit=GeoDataCoordinates.Radian | |||
| ) |
use this function to get the longitude and latitude with one call - use the unit parameter to switch between Radian and DMS
- Parameters:
-
lon longitude lat latitude unit units that lon and lat get measured in (default for Radian: north pole at pi/2, southpole at -pi/2)
| float normalizeLat | ( | float | lat | |
| ) |
normalize latitude to always be in -3.14159265358979323846264338327950288419717 / 2. <= lat <= +3.14159265358979323846264338327950288419717 / 2.
- Parameters:
-
lat latitude
| float normalizeLon | ( | float | lon | |
| ) |
normalize the longitude to always be -3.14159265358979323846264338327950288419717 <= lon <= +3.14159265358979323846264338327950288419717
- Parameters:
-
lon longitude
| normalizeLonLat | ( | float | lon, | |
| float | lat | |||
| ) |
normalize both longitude and latitude at the same time
- Parameters:
-
lon the longitude value lat the latitude value
| bool operator == | ( | self, | ||
| Marble.GeoDataCoordinates | a0 | |||
| ) |
| pack | ( | self, | ||
| QDataStream | stream | |||
| ) |
Serialize the contents of the feature to stream.
| Marble.Quaternion quaternion | ( | self ) |
return a Quaternion with the used coordinates
| set | ( | self, | ||
| float | lon, | |||
| float | lat, | |||
| float | alt=0, | |||
| Marble.GeoDataCoordinates.Unit | unit=GeoDataCoordinates.Radian | |||
| ) |
(re)set the coordinates in a GeoDataCoordinates
- Parameters:
-
_lon longitude _lat latitude alt altitude (default: 0) _unit units that lon and lat get measured in (default for Radian: north pole at pi/2, southpole at -pi/2)
| setAltitude | ( | self, | ||
| float | altitude | |||
| ) |
set the altitude of the Point
- Parameters:
-
altitude altitude
| setDefaultNotation | ( | Marble.GeoDataCoordinates.Notation | notation | |
| ) |
set the Notation of the string representation
- Parameters:
-
notation Notation
| setDetail | ( | self, | ||
| int | det | |||
| ) |
set the detail flag
- Parameters:
-
det detail
| QString toString | ( | self ) |
return a string representation of the coordinate this is a convenience function which uses the default notation
| QString toString | ( | self, | ||
| Marble.GeoDataCoordinates.Notation | notation | |||
| ) |
return a string with the notation given by notation
- Parameters:
-
notation set a notation different from the default one
| unpack | ( | self, | ||
| QDataStream | stream | |||
| ) |
Unserialize the contents of the feature from stream.
Enumeration Documentation
| Notation |
enum used to specify the notation / numerical system
For degrees there exist two notations: "Decimal" (base-10) and the "Sexagesimal DMS" (base-60) which is traditionally used in cartography. Decimal notation uses floating point numbers to specify parts of a degree. The Sexagesimal DMS notation uses integer based Degrees-(Arc)Minutes-(Arc)Seconds to describe parts of a degree.
- Enumerator:
-
Decimal DMS
| Unit |
enum used constructor to specify the units used
Internally we always use radian for mathematical convenience. However the Marble's interfaces to the outside should default to degrees.
- Enumerator:
-
Radian Degree
KDE 4.2 PyKDE API Reference for Marble