deps and lint
This commit is contained in:
@@ -17,8 +17,11 @@ inline void ValidateCoordinate(const rapidjson::Value &coordinate)
|
||||
throw osrm::util::exception("Feature geometry has a non-array coordinate.");
|
||||
if (coordinate.Capacity() != 2)
|
||||
{
|
||||
throw osrm::util::exception("Feature geometry has a malformed coordinate with more than 2 values.");
|
||||
} else {
|
||||
throw osrm::util::exception(
|
||||
"Feature geometry has a malformed coordinate with more than 2 values.");
|
||||
}
|
||||
else
|
||||
{
|
||||
for (rapidjson::SizeType i = 0; i < coordinate.Size(); i++)
|
||||
{
|
||||
if (!coordinate[i].IsNumber() && !coordinate[i].IsDouble())
|
||||
@@ -32,7 +35,8 @@ inline void ValidateFeature(const rapidjson::Value &feature)
|
||||
if (!feature.HasMember("type"))
|
||||
{
|
||||
throw osrm::util::exception("Feature is missing type member.");
|
||||
} else if (!feature["type"].IsString())
|
||||
}
|
||||
else if (!feature["type"].IsString())
|
||||
{
|
||||
throw osrm::util::exception("Feature has non-string type member.");
|
||||
}
|
||||
@@ -56,13 +60,17 @@ inline void ValidateFeature(const rapidjson::Value &feature)
|
||||
if (!feature["geometry"].GetObject().HasMember("type"))
|
||||
{
|
||||
throw osrm::util::exception("Feature geometry is missing type member.");
|
||||
} else if (!feature["geometry"].GetObject()["type"].IsString()) {
|
||||
}
|
||||
else if (!feature["geometry"].GetObject()["type"].IsString())
|
||||
{
|
||||
throw osrm::util::exception("Feature geometry has non-string type member.");
|
||||
}
|
||||
if (!feature["geometry"].GetObject().HasMember("coordinates"))
|
||||
{
|
||||
throw osrm::util::exception("Feature geometry is missing coordinates member.");
|
||||
} else if (!feature["geometry"].GetObject()["coordinates"].IsArray()) {
|
||||
}
|
||||
else if (!feature["geometry"].GetObject()["coordinates"].IsArray())
|
||||
{
|
||||
throw osrm::util::exception("Feature geometry has a non-array coordinates member.");
|
||||
}
|
||||
const auto coord_array = feature["geometry"].GetObject()["coordinates"].GetArray();
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include <boost/filesystem/path.hpp>
|
||||
#include <boost/geometry.hpp>
|
||||
#include <boost/geometry/index/rtree.hpp>
|
||||
#include <boost/optional.hpp>
|
||||
|
||||
#include <rapidjson/document.h>
|
||||
|
||||
@@ -36,6 +37,7 @@ class Timezoner
|
||||
Timezoner(const boost::filesystem::path &tz_shapes_filename, std::time_t utc_time_now);
|
||||
|
||||
boost::optional<struct tm> operator()(const point_t &point) const;
|
||||
|
||||
private:
|
||||
void LoadLocalTimesRTree(rapidjson::Document &geojson, std::time_t utc_time);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user