osrm-backend/include/extractor/query_node.hpp

54 lines
1.2 KiB
C++
Raw Normal View History

#ifndef QUERY_NODE_HPP
#define QUERY_NODE_HPP
2010-07-09 05:05:40 -04:00
2016-01-02 11:13:44 -05:00
#include "util/typedefs.hpp"
#include "util/coordinate.hpp"
2014-11-24 11:57:01 -05:00
#include <limits>
2010-07-14 10:22:29 -04:00
2016-01-05 10:51:13 -05:00
namespace osrm
{
namespace extractor
{
2014-08-29 06:37:07 -04:00
struct QueryNode
2014-05-07 12:39:16 -04:00
{
using key_type = OSMNodeID; // type of NodeID
2016-01-05 06:04:04 -05:00
using value_type = int; // type of lat,lons
2014-05-07 12:39:16 -04:00
explicit QueryNode(const util::FixedLongitude lon_,
const util::FixedLatitude lat_,
key_type node_id)
: lon(lon_), lat(lat_), node_id(std::move(node_id))
2016-01-05 06:04:04 -05:00
{
}
2014-08-29 06:37:07 -04:00
QueryNode()
: lon(std::numeric_limits<int>::max()), lat(std::numeric_limits<int>::max()),
node_id(SPECIAL_OSM_NODEID)
2014-05-07 12:39:16 -04:00
{
}
util::FixedLongitude lon;
util::FixedLatitude lat;
2016-01-29 06:42:08 -05:00
key_type node_id;
2014-05-07 12:39:16 -04:00
2014-08-29 06:37:07 -04:00
static QueryNode min_value()
2014-05-07 12:39:16 -04:00
{
return QueryNode(util::FixedLongitude(-180 * COORDINATE_PRECISION),
2016-05-27 15:05:04 -04:00
util::FixedLatitude(-90 * COORDINATE_PRECISION),
MIN_OSM_NODEID);
2014-05-07 12:39:16 -04:00
}
2014-08-29 06:37:07 -04:00
static QueryNode max_value()
2014-05-07 12:39:16 -04:00
{
return QueryNode(util::FixedLongitude(180 * COORDINATE_PRECISION),
2016-05-27 15:05:04 -04:00
util::FixedLatitude(90 * COORDINATE_PRECISION),
MAX_OSM_NODEID);
2014-05-07 12:39:16 -04:00
}
2010-07-09 05:05:40 -04:00
};
2016-01-05 10:51:13 -05:00
}
}
#endif // QUERY_NODE_HPP