@@ -280,59 +280,59 @@ class RelationScanStore {
280280class WayStore {
281281
282282public:
283- using nodeid_vector_t = std::vector<NodeID , mmap_allocator<NodeID >>;
284- using element_t = std::pair<NodeID, nodeid_vector_t >;
283+ using latplon_vector_t = std::vector<LatpLon , mmap_allocator<LatpLon >>;
284+ using element_t = std::pair<WayID, latplon_vector_t >;
285285 using map_t = std::deque<element_t , mmap_allocator<element_t >>;
286286
287287 void reopen () {
288- mNodeLists = std::make_unique<map_t >();
288+ mLatpLonLists = std::make_unique<map_t >();
289289 }
290290
291291 // @brief Lookup a node list
292292 // @param i OSM ID of a way
293293 // @return A node list
294294 // @exception NotFound
295- nodeid_vector_t const &at (WayID wayid) const {
295+ latplon_vector_t const &at (WayID wayid) const {
296296 std::lock_guard<std::mutex> lock (mutex);
297297
298- auto iter = std::lower_bound (mNodeLists ->begin (), mNodeLists ->end (), wayid, [](auto const &e, auto wayid) {
298+ auto iter = std::lower_bound (mLatpLonLists ->begin (), mLatpLonLists ->end (), wayid, [](auto const &e, auto wayid) {
299299 return e.first < wayid;
300300 });
301301
302- if (iter == mNodeLists ->end () || iter->first != wayid)
302+ if (iter == mLatpLonLists ->end () || iter->first != wayid)
303303 throw std::out_of_range (" Could not find way with id " + std::to_string (wayid));
304304
305305 return iter->second ;
306306 }
307307
308308 // @brief Insert a node list.
309309 // @param i OSM ID of a way
310- // @param nodeVec a node vector to be inserted
310+ // @param llVec a coordinate vector to be inserted
311311 // @invariant The OSM ID i must be larger than previously inserted OSM IDs of ways
312312 // (though unnecessarily for current impl, future impl may impose that)
313313 void insert_back (std::vector<element_t > &new_ways) {
314314 std::lock_guard<std::mutex> lock (mutex);
315- auto i = mNodeLists ->size ();
316- mNodeLists ->resize (i + new_ways.size ());
317- std::copy (std::make_move_iterator (new_ways.begin ()), std::make_move_iterator (new_ways.end ()), mNodeLists ->begin () + i);
315+ auto i = mLatpLonLists ->size ();
316+ mLatpLonLists ->resize (i + new_ways.size ());
317+ std::copy (std::make_move_iterator (new_ways.begin ()), std::make_move_iterator (new_ways.end ()), mLatpLonLists ->begin () + i);
318318 }
319319
320320 // @brief Make the store empty
321321 void clear () {
322322 std::lock_guard<std::mutex> lock (mutex);
323- mNodeLists ->clear ();
323+ mLatpLonLists ->clear ();
324324 }
325325
326326 std::size_t size () const {
327327 std::lock_guard<std::mutex> lock (mutex);
328- return mNodeLists ->size ();
328+ return mLatpLonLists ->size ();
329329 }
330330
331331 void sort (unsigned int threadNum);
332332
333333private:
334334 mutable std::mutex mutex;
335- std::unique_ptr<map_t > mNodeLists ;
335+ std::unique_ptr<map_t > mLatpLonLists ;
336336};
337337
338338// relation store
@@ -624,7 +624,7 @@ class OSMStore
624624 // Relation -> MultiPolygon or MultiLinestring
625625 MultiPolygon wayListMultiPolygon (WayVec::const_iterator outerBegin, WayVec::const_iterator outerEnd, WayVec::const_iterator innerBegin, WayVec::const_iterator innerEnd) const ;
626626 MultiLinestring wayListMultiLinestring (WayVec::const_iterator outerBegin, WayVec::const_iterator outerEnd) const ;
627- void mergeMultiPolygonWays (std::vector<NodeDeque > &results, std::map<WayID,bool > &done, WayVec::const_iterator itBegin, WayVec::const_iterator itEnd) const ;
627+ void mergeMultiPolygonWays (std::vector<LatpLonDeque > &results, std::map<WayID,bool > &done, WayVec::const_iterator itBegin, WayVec::const_iterator itEnd) const ;
628628
629629 // /It is not really meaningful to try using a relation as a linestring. Not normally used but included
630630 // /if Lua script attempts to do this.
@@ -640,7 +640,7 @@ class OSMStore
640640 }
641641
642642 template <class WayIt >
643- Polygon nodeListPolygon (WayIt begin, WayIt end) const {
643+ Polygon llListPolygon (WayIt begin, WayIt end) const {
644644 Polygon poly;
645645 fillPoints (poly.outer (), begin, end);
646646 boost::geometry::correct (poly);
@@ -649,20 +649,19 @@ class OSMStore
649649
650650 // Way -> Linestring
651651 template <class WayIt >
652- Linestring nodeListLinestring (WayIt begin, WayIt end) const {
652+ Linestring llListLinestring (WayIt begin, WayIt end) const {
653653 Linestring ls;
654654 fillPoints (ls, begin, end);
655655 return ls;
656656 }
657657
658658private:
659659 // helper
660- template <class PointRange , class NodeIt >
661- void fillPoints (PointRange &points, NodeIt begin, NodeIt end) const {
660+ template <class PointRange , class LatpLonIt >
661+ void fillPoints (PointRange &points, LatpLonIt begin, LatpLonIt end) const {
662662 for (auto it = begin; it != end; ++it) {
663663 try {
664- LatpLon ll = nodes_at (*it);
665- boost::geometry::range::push_back (points, boost::geometry::make<Point>(ll.lon /10000000.0 , ll.latp /10000000.0 ));
664+ boost::geometry::range::push_back (points, boost::geometry::make<Point>(it->lon /10000000.0 , it->latp /10000000.0 ));
666665 } catch (std::out_of_range &err) {
667666 if (require_integrity) throw err;
668667 }
0 commit comments