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    PCLoaderArcView.h
11 /// @author  Daniel Krajzewicz
12 /// @author  Michael Behrisch
13 /// @date    Sept 2002
14 /// @version $Id$
15 ///
16 // A reader of pois and polygons from shape files
17 /****************************************************************************/
18 #ifndef PCLoaderArcView_h
19 #define PCLoaderArcView_h
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
27 #include <string>
28 #include <utils/common/UtilExceptions.h>
29 
30 
31 // ===========================================================================
32 // class declarations
33 // ===========================================================================
34 class OptionsCont;
35 class PCPolyContainer;
36 class PCTypeMap;
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,
66                           PCTypeMap& tm);
67 
68 
69 protected:
70     /** @brief Parses pois/polys stored within the given file
71      * @param[in] oc The options container to get further options from
72      * @param[in] toFill The poly/pois container to add loaded polys/pois to
73      * @param[in] tm The type map to use for setting values of loaded polys/pois
74      * @exception ProcessError if something fails
75      */
76     static void load(const std::string& file, OptionsCont& oc, PCPolyContainer& toFill,
77                      PCTypeMap& tm);
78 
79 
80 private:
81     /// @brief Invalidated copy constructor.
82     PCLoaderArcView(const PCLoaderArcView&);
83 
84     /// @brief Invalidated assignment operator.
85     PCLoaderArcView& operator=(const PCLoaderArcView&);
86 
87 };
88 
89 
90 #endif
91 
92 /****************************************************************************/
93 
94