diff options
author | Lev Dragunov <l.dragunov@corp.mail.ru> | 2015-10-27 16:25:30 +0300 |
---|---|---|
committer | Lev Dragunov <l.dragunov@corp.mail.ru> | 2015-10-27 16:25:30 +0300 |
commit | 17f7099da64a8e0a891dbcbfc516218deecbef86 (patch) | |
tree | 12dd3273f5400c670f0b7f01906e5f70fc31cf9d /routing/cross_routing_context.hpp | |
parent | ba3db415505896e05a45c0daa6a0fef1678c9a86 (diff) |
Using LatLon for WGS coordinates in cross routing.
Diffstat (limited to 'routing/cross_routing_context.hpp')
-rw-r--r-- | routing/cross_routing_context.hpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/routing/cross_routing_context.hpp b/routing/cross_routing_context.hpp index 428d2f74af..f99578ff16 100644 --- a/routing/cross_routing_context.hpp +++ b/routing/cross_routing_context.hpp @@ -2,6 +2,7 @@ #include "coding/file_container.hpp" +#include "geometry/latlon.hpp" #include "geometry/point2d.hpp" #include "geometry/rect2d.hpp" #include "geometry/tree4d.hpp" @@ -20,17 +21,17 @@ static size_t constexpr kInvalidAdjacencyIndex = numeric_limits<size_t>::max(); struct IngoingCrossNode { - m2::PointD m_point; + ms::LatLon m_point; WritedNodeID m_nodeId; size_t m_adjacencyIndex; IngoingCrossNode() - : m_point(m2::PointD::Zero()) + : m_point(ms::LatLon::Zero()) , m_nodeId(INVALID_CONTEXT_EDGE_NODE_ID) , m_adjacencyIndex(kInvalidAdjacencyIndex) { } - IngoingCrossNode(WritedNodeID nodeId, m2::PointD const & point, size_t const adjacencyIndex) + IngoingCrossNode(WritedNodeID nodeId, ms::LatLon const & point, size_t const adjacencyIndex) : m_point(point), m_nodeId(nodeId), m_adjacencyIndex(adjacencyIndex) { } @@ -39,24 +40,24 @@ struct IngoingCrossNode size_t Load(Reader const & r, size_t pos, size_t adjacencyIndex); - m2::RectD const GetLimitRect() const { return m2::RectD(m_point, m_point); } + m2::RectD const GetLimitRect() const { return m2::RectD(m_point.lat, m_point.lon, m_point.lat, m_point.lon); } }; struct OutgoingCrossNode { - m2::PointD m_point; + ms::LatLon m_point; WritedNodeID m_nodeId; unsigned char m_outgoingIndex; size_t m_adjacencyIndex; OutgoingCrossNode() - : m_point(m2::PointD::Zero()) + : m_point(ms::LatLon::Zero()) , m_nodeId(INVALID_CONTEXT_EDGE_NODE_ID) , m_outgoingIndex(0) , m_adjacencyIndex(kInvalidAdjacencyIndex) { } - OutgoingCrossNode(WritedNodeID nodeId, size_t const index, m2::PointD const & point, + OutgoingCrossNode(WritedNodeID nodeId, size_t const index, ms::LatLon const & point, size_t const adjacencyIndex) : m_point(point) , m_nodeId(nodeId) @@ -86,7 +87,7 @@ public: const string & GetOutgoingMwmName(OutgoingCrossNode const & mwmIndex) const; - bool FindIngoingNodeByPoint(m2::PointD const & point, IngoingCrossNode & node) const; + bool FindIngoingNodeByPoint(ms::LatLon const & point, IngoingCrossNode & node) const; WritedEdgeWeightT GetAdjacencyCost(IngoingCrossNode const & ingoing, OutgoingCrossNode const & outgoing) const; @@ -108,10 +109,10 @@ class CrossRoutingContextWriter public: void Save(Writer & w) const; - void AddIngoingNode(WritedNodeID const nodeId, m2::PointD const & point); + void AddIngoingNode(WritedNodeID const nodeId, ms::LatLon const & point); void AddOutgoingNode(WritedNodeID const nodeId, string const & targetMwm, - m2::PointD const & point); + ms::LatLon const & point); void ReserveAdjacencyMatrix(); |