-void SGTime::updateLocal( double lon_rad, double lat_rad, const string& root ) {
- // sanity checking
- if ( lon_rad < -SGD_PI || lon_rad> SGD_PI ) {
- // not within -180 ... 180
- lon_rad = 0.0;
- }
- if ( lat_rad < -SGD_PI * 0.5 || lat_rad > SGD_PI * 0.5 ) {
- // not within -90 ... 90
- lat_rad = 0.0;
- }
- if ( lon_rad != lon_rad ) {
- // only true if lon_rad == nan
- SG_LOG( SG_EVENT, SG_ALERT,
- " Detected lon_rad == nan, resetting to 0.0" );
- lon_rad = 0.0;
- }
- if ( lat_rad != lat_rad ) {
- // only true if lat_rad == nan
- SG_LOG( SG_EVENT, SG_ALERT,
- " Detected lat_rad == nan, resetting to 0.0" );
- lat_rad = 0.0;
+void SGTime::updateLocal( const SGGeod& aLocation, const string& root ) {
+ SGGeod location(aLocation);
+ if (!aLocation.isValid()) {
+ location = SGGeod();