mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-27 00:33:48 -05:00
Make 'no data' handling consistent in the GPX provider and remove isnan() since it breaks Windows builds
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@1566 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
587a81065b
commit
ae4547df80
@ -24,7 +24,7 @@
|
||||
|
||||
|
||||
GPSPoint::GPSPoint() {
|
||||
ele = DOUBLE_NA;
|
||||
ele = -std::numeric_limits<double>::max();
|
||||
}
|
||||
|
||||
|
||||
|
@ -30,9 +30,6 @@
|
||||
#include "../../src/qgsrect.h"
|
||||
|
||||
|
||||
#define DOUBLE_NA (std::numeric_limits<double>::signaling_NaN())
|
||||
|
||||
|
||||
/** This is the parent class for all GPS data classes (except tracksegment).
|
||||
It contains the variables that all GPS objects can have.
|
||||
*/
|
||||
@ -138,7 +135,7 @@ class GPSData {
|
||||
successfully its index will be returned, otherwise a negative number
|
||||
will be returned. */
|
||||
int addWaypoint(double lat, double lon, std::string name = "",
|
||||
double ele = DOUBLE_NA);
|
||||
double ele = -std::numeric_limits<double>::max());
|
||||
|
||||
/** This function tries to add a new route. If the route was added
|
||||
successfully its index will be returned, otherwise a negative number
|
||||
|
@ -147,7 +147,7 @@ QgsFeature *QgsGPXProvider::getNextFeature(bool fetchAttributes) {
|
||||
result->addAttribute("name", wpt.name.c_str());
|
||||
result->addAttribute("lat", QString("%1").arg(wpt.lat));
|
||||
result->addAttribute("lon", QString("%1").arg(wpt.lon));
|
||||
if (isnan(wpt.ele))
|
||||
if (wpt.ele == -std::numeric_limits<double>::max())
|
||||
result->addAttribute("ele", "");
|
||||
else
|
||||
result->addAttribute("ele", QString("%1").arg(wpt.ele));
|
||||
@ -279,7 +279,7 @@ QgsFeature * QgsGPXProvider::getNextFeature(std::list<int>& attlist) {
|
||||
result->addAttribute("lon", QString("%1").arg(wpt.lon));
|
||||
break;
|
||||
case 3:
|
||||
if (isnan(wpt.ele))
|
||||
if (wpt.ele == -std::numeric_limits<double>::max())
|
||||
result->addAttribute("ele", "");
|
||||
else
|
||||
result->addAttribute("ele", QString("%1").arg(wpt.ele));
|
||||
|
Loading…
x
Reference in New Issue
Block a user