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