1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
10 /// @file    PCLoaderDlrNavteq.h
11 /// @author  Daniel Krajzewicz
12 /// @author  Michael Behrisch
13 /// @date    Thu, 02.11.2006
14 /// @version $Id$
15 ///
16 // A reader of pois and polygons stored in DLR-Navteq (Elmar)-format
17 /****************************************************************************/
18 #ifndef PCLoaderDlrNavteq_h
19 #define PCLoaderDlrNavteq_h
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
27 #include <string>
28 #include "PCPolyContainer.h"
29 #include "PCTypeMap.h"
30 #include <utils/common/UtilExceptions.h>
31 
32 
33 // ===========================================================================
34 // class definitions
35 // ===========================================================================
36 class OptionsCont;
37 
38 
39 // ===========================================================================
40 // class declarations
41 // ===========================================================================
42 /**
43  * @class PCLoaderDlrNavteq
44  * @brief A reader of pois and polygons stored in DLR-Navteq (Elmar)-format
45  *
46  * Reads pois stored in "pointcollection.txt" and polygons stored in
47  *  "...polygons.txt"/"...water_polygons.txt", applies the given projection
48  *  and network offset and stores the so build pois/polys into the given map.
49  */
50 class PCLoaderDlrNavteq {
51 public:
52     /** @brief Loads pois/polygons assumed to be stored as according DLR-Navteq (Elmar)-files
53      *
54      * If the option "elmar-poi-files" is set within the given options container,
55      *  the files stored herein are parsed using "loadPOIFiles", assuming this
56      *  option contains file paths to files containing pois stored in DLR-Navteq
57      *  "pointcollection.txt"-format.
58      *
59      * If the option "elmar-poly-files" is set within the given options container,
60      *  the files stored herein are parsed using "loadPolyFiles", assuming this
61      *  option contains file paths to files containing polygons stored in DLR-Navteq
62      *  "...polygons.txt"/"...water_polygons.txt"-format.
63      *
64      * @param[in] oc The options container to get further options from
65      * @param[in] toFill The poly/pois container to add loaded polys/pois to
66      * @param[in] tm The type map to use for setting values of loaded polys/pois
67      * @exception ProcessError if something fails
68      */
69     static void loadIfSet(OptionsCont& oc, PCPolyContainer& toFill,
70                           PCTypeMap& tm);
71 
72 
73 protected:
74     /** @brief Loads pois assumed to be stored as according DLR-Navteq (Elmar)-files
75      *
76      * Goes through the list of files given in "elmar-poi-files". Calls
77      *  "loadPOIFile" using each of these as the first parameter.
78      *
79      * @param[in] oc The options container to get further options from
80      * @param[in] toFill The poly/pois container to add loaded pois to
81      * @param[in] tm The type map to use for setting values of loaded pois
82      * @exception ProcessError if something fails
83      */
84     static void loadPOIFiles(OptionsCont& oc, PCPolyContainer& toFill,
85                              PCTypeMap& tm);
86 
87 
88     /** @brief Loads polygons assumed to be stored as according DLR-Navteq (Elmar)-files
89      *
90      * Goes through the list of files given in "elmar-poly-files". Calls
91      *  "loadPolyFile" using each of these as the first parameter.
92      *
93      * @param[in] oc The options container to get further options from
94      * @param[in] toFill The poly/pois container to add loaded polys to
95      * @param[in] tm The type map to use for setting values of loaded polys
96      * @exception ProcessError if something fails
97      */
98     static void loadPolyFiles(OptionsCont& oc, PCPolyContainer& toFill,
99                               PCTypeMap& tm);
100 
101 
102     /** @brief Loads DLR-Navteq (Elmar)-pois from the given file
103      * @param[in] file The name of the file to parse
104      * @param[in] oc The options container to get further options from
105      * @param[in] toFill The poly/pois container to add loaded polys to
106      * @param[in] tm The type map to use for setting values of loaded polys
107      * @exception ProcessError if something fails
108      */
109     static void loadPOIFile(const std::string& file,
110                             OptionsCont& oc, PCPolyContainer& toFill,
111                             PCTypeMap& tm);
112 
113 
114     /** @brief Loads DLR-Navteq (Elmar)-polygons from the given file
115      * @param[in] file The name of the file to parse
116      * @param[in] oc The options container to get further options from
117      * @param[in] toFill The poly/pois container to add loaded polys to
118      * @param[in] tm The type map to use for setting values of loaded polys
119      * @exception ProcessError if something fails
120      */
121     static void loadPolyFile(const std::string& file,
122                              OptionsCont& oc, PCPolyContainer& toFill,
123                              PCTypeMap& tm);
124 
125 
126 };
127 
128 
129 #endif
130 
131 /****************************************************************************/
132 
133