root/tools/osm2pgrouting/tags/release-0.1/src/Way.h

Revision 189, 2.6 KB (checked in by murray, 2 years ago)

osm2pgrouting: add a new tool to this project, which converts and imports osm data to a pgrouting
table

Line 
1/***************************************************************************
2 *   Copyright (C) 2008 by Daniel Wendt                                                                    *
3 *   gentoo.murray@gmail.com                                                                                       *
4 *                                                                         *
5 *   This program is free software; you can redistribute it and/or modify  *
6 *   it under the terms of the GNU General Public License as published by  *
7 *   the Free Software Foundation; either version 2 of the License, or     *
8 *   (at your option) any later version.                                   *
9 *                                                                         *
10 *   This program is distributed in the hope that it will be useful,       *
11 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
12 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
13 *   GNU General Public License for more details.                          *
14 *                                                                         *
15 *   You should have received a copy of the GNU General Public License     *
16 *   along with this program; if not, write to the                         *
17 *   Free Software Foundation, Inc.,                                       *
18 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
19 ***************************************************************************/
20#ifndef WAY_H
21#define WAY_H
22
23namespace osm
24{
25
26        class Node;
27
28/**
29\code
30 <way id="20215432" visible="true" timestamp="2008-01-09T22:35:16+00:00" user="Pferdo">
31    <nd ref="213794929"/>
32    <nd ref="213795470"/>
33    <nd ref="213795483"/>
34    <nd ref="213795493"/>
35    <nd ref="213795506"/>
36    <nd ref="213795517"/>
37    <nd ref="213795527"/>
38    <nd ref="213795541"/>
39    <nd ref="213795552"/>
40    <nd ref="213795561"/>
41    <nd ref="213795571"/>
42    <tag k="name" v="Pfänderweg"/>
43    <tag k="created_by" v="JOSM"/>
44    <tag k="highway" v="residential"/>
45  </way>
46\endcode
47*/
48class Way
49{
50public:
51        //! Do not delete nodes in this container!
52        std::vector<Node*> m_NodeRefs;
53        //! ID of the way
54        long long id;
55        bool visible;
56        //! name of the street
57        std::string name;
58        //! type of the street, for example "motorway"
59        std::string highway;
60        //! geometry of the street
61        std::string geom;
62        //! length of the street
63        double length;
64public:
65        /**
66         *      Constructor
67         *      @param id ID of the way
68         */
69        Way( long long id, bool visible );
70        //! Destructor
71        ~Way();
72        /**
73         *      saves the nodes of the way 
74         *      @param pNode node
75         */
76        void AddNodeRef( Node* pNode );
77};
78
79
80} // end namespace osm
81#endif
Note: See TracBrowser for help on using the browser.