2014-11-28 06:13:18 -05:00
|
|
|
#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"
|
2013-06-26 19:48:22 -04:00
|
|
|
|
2016-02-23 15:23:13 -05:00
|
|
|
#include "util/coordinate.hpp"
|
2014-11-24 11:57:01 -05:00
|
|
|
|
2016-06-24 01:01:37 -04:00
|
|
|
#include <cstdint>
|
2016-07-26 09:00:58 -04: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
|
|
|
{
|
2016-07-26 09:00:58 -04:00
|
|
|
using key_type = OSMNodeID; // type of NodeID
|
|
|
|
using value_type = std::int32_t; // type of lat,lons
|
2014-05-07 12:39:16 -04:00
|
|
|
|
2016-02-23 15:23:13 -05:00
|
|
|
explicit QueryNode(const util::FixedLongitude lon_,
|
|
|
|
const util::FixedLatitude lat_,
|
2016-06-24 01:01:37 -04:00
|
|
|
const key_type node_id_)
|
|
|
|
: lon(lon_), lat(lat_), node_id(node_id_)
|
2016-01-05 06:04:04 -05:00
|
|
|
{
|
|
|
|
}
|
2014-08-29 06:37:07 -04:00
|
|
|
QueryNode()
|
2016-06-24 01:01:37 -04:00
|
|
|
: lon{std::numeric_limits<value_type>::max()}, lat{std::numeric_limits<value_type>::max()},
|
2015-11-24 19:33:19 -05:00
|
|
|
node_id(SPECIAL_OSM_NODEID)
|
2014-05-07 12:39:16 -04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2016-02-23 15:23:13 -05: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
|
|
|
{
|
2016-06-24 01:01:37 -04:00
|
|
|
return QueryNode(util::FixedLongitude{static_cast<value_type>(-180 * COORDINATE_PRECISION)},
|
|
|
|
util::FixedLatitude{static_cast<value_type>(-90 * COORDINATE_PRECISION)},
|
2016-05-27 15:05:04 -04:00
|
|
|
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
|
|
|
{
|
2016-06-24 01:01:37 -04:00
|
|
|
return QueryNode(util::FixedLongitude{static_cast<value_type>(180 * COORDINATE_PRECISION)},
|
|
|
|
util::FixedLatitude{static_cast<value_type>(90 * COORDINATE_PRECISION)},
|
2016-05-27 15:05:04 -04:00
|
|
|
MAX_OSM_NODEID);
|
2014-05-07 12:39:16 -04:00
|
|
|
}
|
2010-07-09 05:05:40 -04:00
|
|
|
};
|
2020-11-26 10:21:39 -05:00
|
|
|
} // namespace extractor
|
|
|
|
} // namespace osrm
|
2016-01-05 10:51:13 -05:00
|
|
|
|
2014-11-28 06:13:18 -05:00
|
|
|
#endif // QUERY_NODE_HPP
|