geojson_p.h 988 Bytes
Newer Older
Volker Krause's avatar
Volker Krause committed
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
/*
    SPDX-FileCopyrightText: 2021 Volker Krause <vkrause@kde.org>

    SPDX-License-Identifier: LGPL-2.0-or-later
*/

#ifndef KPUBLICTRANSPORT_GEOJSON_P_H
#define KPUBLICTRANSPORT_GEOJSON_P_H

#include "kpublictransport_export.h"

class QJsonObject;
class QPointF;
class QPolygonF;

namespace KPublicTransport {

/** GeoJSON utilities.
 *  @internal only exported for unit tests
 */
namespace GeoJson
{
    /** Coordinate of a point geometry object. */
    KPUBLICTRANSPORT_EXPORT QPointF readPoint(const QJsonObject &obj);

26
27
28
    /** Reads a line string object. */
    QPolygonF readLineString(const QJsonObject &obj);

Volker Krause's avatar
Volker Krause committed
29
30
    /** Outer path of a polygon or multi-polygon geometry object. */
    QPolygonF readOuterPolygon(const QJsonObject &obj);
31
32
33

    /** Creates a line string object. */
    QJsonObject writeLineString(const QPolygonF &lineString);
34
35
36

    /** Create a polygon object. */
    QJsonObject writePolygon(const QPolygonF &polygon);
Volker Krause's avatar
Volker Krause committed
37
38
39
40
41
}

}

#endif // KPUBLICTRANSPORT_GEOJSON_P_H