1 /*
2  *    Copyright 2016-2018 Kai Pastor
3  *
4  *    This file is part of OpenOrienteering.
5  *
6  *    OpenOrienteering is free software: you can redistribute it and/or modify
7  *    it under the terms of the GNU General Public License as published by
8  *    the Free Software Foundation, either version 3 of the License, or
9  *    (at your option) any later version.
10  *
11  *    OpenOrienteering is distributed in the hope that it will be useful,
12  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *    GNU General Public License for more details.
15  *
16  *    You should have received a copy of the GNU General Public License
17  *    along with OpenOrienteering.  If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef OPENORIENTEERING_OGR_FILE_FORMAT_H
21 #define OPENORIENTEERING_OGR_FILE_FORMAT_H
22 
23 #include <memory>
24 
25 #include <QString>
26 
27 #include "fileformats/file_format.h"
28 
29 namespace OpenOrienteering {
30 
31 class Importer;
32 class Exporter;
33 class Map;
34 class MapView;
35 
36 
37 /**
38  * A FileFormat for geospatial vector data supported by OGR.
39  *
40  * Geospatial vector data cannot be loaded as a regular (OpenOrienteering) Map
41  * because it has no scale. However, it typically has a spatial reference, and
42  * so it can be imported into an existing map. This is the major reason for
43  * implementing the OGR support as a FileFormat.
44  */
45 class OgrFileImportFormat : public FileFormat
46 {
47 public:
48 	/**
49 	 * Constructs a new OgrFileImportFormat.
50 	 */
51 	OgrFileImportFormat();
52 
53 
54 	/**
55 	 * Creates an importer for files supported by OGR.
56 	 */
57 	std::unique_ptr<Importer> makeImporter(const QString& path, Map* map, MapView* view) const override;
58 };
59 
60 class OgrFileExportFormat : public FileFormat
61 {
62 public:
63 	/**
64 	  * Constructs a new OgrFileExportFormat.
65 	  */
66 	OgrFileExportFormat();
67 
68 	/**
69 	  * Creates an exporter for files supported by OGR.
70 	  */
71 	std::unique_ptr<Exporter> makeExporter(const QString &path, const Map *map, const MapView *view) const override;
72 };
73 
74 
75 }  // namespace OpenOrienteering
76 
77 #endif // OPENORIENTEERING_OGR_FILE_FORMAT_H
78