-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwriteGeometryToFile.cpp
More file actions
37 lines (32 loc) · 1.05 KB
/
Copy pathwriteGeometryToFile.cpp
File metadata and controls
37 lines (32 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/**
*
* \copyright
* Copyright (c) 2012-2015, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
*/
#include "writeGeometryToFile.h"
#include "BaseLib/FileTools.h"
#include "FileIO/XmlIO/Boost/BoostXmlGmlInterface.h"
#include "FileIO/Legacy/OGSIOVer4.h"
#include "GeoLib/GEOObjects.h"
namespace FileIO
{
void writeGeometryToFile(std::string const& geo_name,
GeoLib::GEOObjects& geo_objs, std::string const& fname)
{
std::string const extension(BaseLib::getFileExtension(fname));
if (extension == "gml" || extension == "GML") {
FileIO::BoostXmlGmlInterface xml(geo_objs);
xml.setNameForExport(geo_name);
xml.writeToFile(fname);
} else if (extension == "gli" || extension == "GLI") {
FileIO::Legacy::writeGLIFileV4(fname, geo_name, geo_objs);
} else {
ERR("Writing of geometry failed, since it was not possible to determine"
" the required format from file extension.");
}
}
}