mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-21 21:05:31 +08:00
Ref T668, moved KML utils to geo namespace
This commit is contained in:
68
src/blackmisc/geo/kmlutils.h
Normal file
68
src/blackmisc/geo/kmlutils.h
Normal file
@@ -0,0 +1,68 @@
|
||||
/* Copyright (C) 2019
|
||||
* swift project Community / Contributors
|
||||
*
|
||||
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||
* directory of this distribution. No part of swift project, including this file, may be copied, modified, propagated,
|
||||
* or distributed except according to the terms contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKMISC_GEO_KMLUTILS_H
|
||||
#define BLACKMISC_GEO_KMLUTILS_H
|
||||
|
||||
#include "blackmisc/geo/coordinategeodetic.h"
|
||||
#include "blackmisc/logcategorylist.h"
|
||||
#include "blackmisc/blackmiscexport.h"
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
namespace Geo
|
||||
{
|
||||
/*!
|
||||
* KML utils
|
||||
*/
|
||||
class BLACKMISC_EXPORT CKmlUtils
|
||||
{
|
||||
public:
|
||||
//! Log categories
|
||||
static const BlackMisc::CLogCategoryList &getLogCategories();
|
||||
|
||||
//! KML settings
|
||||
struct KMLSettings
|
||||
{
|
||||
//! Ctor
|
||||
KMLSettings(bool withAltitude, bool extrude) :
|
||||
withAltitude(withAltitude), extrude(extrude)
|
||||
{ }
|
||||
|
||||
//! Setting members @{
|
||||
bool withAltitude = true;
|
||||
bool extrude = false;
|
||||
bool tessellate = true;
|
||||
QString altitudeMode = "absolute";
|
||||
//! @}
|
||||
};
|
||||
|
||||
//! Wrap as KML document
|
||||
static QString wrapAsKmlDocument(const QString &content);
|
||||
|
||||
//! Wrap as KML coordinates
|
||||
static QString wrapAsKmlCoordinates(const QString &content);
|
||||
|
||||
//! As raw coordinates
|
||||
static QString asRawCoordinates(const Geo::ICoordinateGeodetic &coordinate, bool withAltitude);
|
||||
|
||||
//! As KML point
|
||||
static QString asPoint(const Geo::ICoordinateGeodetic &coordinate, const KMLSettings &settings);
|
||||
|
||||
//! As KML placemark
|
||||
static QString asPlacemark(const QString &name, const QString &description, const Geo::ICoordinateGeodetic &coordinate, const KMLSettings &settings);
|
||||
|
||||
//! As KML line
|
||||
static QString asLineString(const QString &coordinatesRaw, const KMLSettings &settings);
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
#endif // guard
|
||||
Reference in New Issue
Block a user