Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/polyconvert/PCLoaderArcView.h
169666 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 PCLoaderArcView.h
15
/// @author Daniel Krajzewicz
16
/// @author Michael Behrisch
17
/// @date Sept 2002
18
///
19
// A reader of pois and polygons from shape files
20
/****************************************************************************/
21
#pragma once
22
#include <config.h>
23
24
#include <string>
25
#include <utils/common/UtilExceptions.h>
26
27
28
// ===========================================================================
29
// class declarations
30
// ===========================================================================
31
class OptionsCont;
32
class PCPolyContainer;
33
class PCTypeMap;
34
#ifdef HAVE_GDAL
35
class OGRLineString;
36
#endif
37
38
39
// ===========================================================================
40
// class definitions
41
// ===========================================================================
42
/**
43
* @class PCLoaderArcView
44
* @brief A reader of pois and polygons from shape files
45
*
46
* The current importer works only if SUMO was compiled with GDAL-support.
47
* If not, an error message is generated.
48
*
49
* @todo reinsert import via shapelib
50
*/
51
class PCLoaderArcView {
52
public:
53
/** @brief Loads pois/polygons assumed to be stored as shape files-files
54
*
55
* If the option "shape-files" is set within the given options container,
56
* the files stored herein are parsed using "load", assuming this
57
* option contains file paths to files containing pois and polygons stored
58
* as shape-files.
59
*
60
* @param[in] oc The options container to get further options from
61
* @param[in] toFill The poly/pois container to add loaded polys/pois to
62
* @param[in] tm The type map to use for setting values of loaded polys/pois
63
* @exception ProcessError if something fails
64
*/
65
static void loadIfSet(OptionsCont& oc, PCPolyContainer& toFill, PCTypeMap& tm);
66
67
68
private:
69
#ifdef HAVE_GDAL
70
static const PositionVector toShape(OGRLineString* geom, const std::string& tid);
71
#endif
72
73
/** @brief Parses pois/polys stored within the given file
74
* @param[in] oc The options container to get further options from
75
* @param[in] toFill The poly/pois container to add loaded polys/pois to
76
* @param[in] tm The type map to use for setting values of loaded polys/pois
77
* @exception ProcessError if something fails
78
*/
79
static void load(const std::string& file, OptionsCont& oc, PCPolyContainer& toFill, PCTypeMap& tm);
80
81
private:
82
static bool myWarnMissingProjection;
83
84
private:
85
/// @brief Invalidated copy constructor.
86
PCLoaderArcView(const PCLoaderArcView&);
87
88
/// @brief Invalidated assignment operator.
89
PCLoaderArcView& operator=(const PCLoaderArcView&);
90
91
};
92
93