diff --git a/include/cgimap/api06/changeset_upload/node.hpp b/include/cgimap/api06/changeset_upload/node.hpp index 1830af65..c52aa91c 100644 --- a/include/cgimap/api06/changeset_upload/node.hpp +++ b/include/cgimap/api06/changeset_upload/node.hpp @@ -5,6 +5,7 @@ #include #include +#include namespace api06 { @@ -52,12 +53,16 @@ class Node : public OSMObject { void set_lat(double lat) { if (lat < -90 || lat > 90) throw xml_error("Latitude outside of valid range"); + else if (!std::isfinite(lat)) + throw xml_error("Latitude not a valid finite number"); m_lat = lat; } void set_lon(double lon) { if (lon < -180 || lon > 180) throw xml_error("Longitude outside of valid range"); + else if (!std::isfinite(lon)) + throw xml_error("Longitude not a valid finite number"); m_lon = lon; }