Line data Source code
1 : /******************************************************************************
2 : * $Id$
3 : *
4 : * Project: KML Driver
5 : * Purpose: KML driver utilities
6 : * Author: Jens Oberender, j.obi@troja.net
7 : *
8 : ******************************************************************************
9 : * Copyright (c) 2007, Jens Oberender
10 : * Copyright (c) 2009, Even Rouault <even dot rouault at spatialys.com>
11 : *
12 : * Permission is hereby granted, free of charge, to any person obtaining a
13 : * copy of this software and associated documentation files (the "Software"),
14 : * to deal in the Software without restriction, including without limitation
15 : * the rights to use, copy, modify, merge, publish, distribute, sublicense,
16 : * and/or sell copies of the Software, and to permit persons to whom the
17 : * Software is furnished to do so, subject to the following conditions:
18 : *
19 : * The above copyright notice and this permission notice shall be included
20 : * in all copies or substantial portions of the Software.
21 : *
22 : * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
23 : * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24 : * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
25 : * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26 : * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
27 : * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
28 : * DEALINGS IN THE SOFTWARE.
29 : ****************************************************************************/
30 : #ifndef OGR_KMLUTILITY_H_INCLUDED
31 : #define OGR_KMLUTILITY_H_INCLUDED
32 :
33 : #include <string>
34 : #include <vector>
35 : #include "ogr_geometry.h"
36 :
37 : namespace OGRKML
38 : {
39 :
40 : enum Nodetype
41 : {
42 : Unknown,
43 : Empty,
44 : Mixed,
45 : Point,
46 : LineString,
47 : Polygon,
48 : Rest,
49 : MultiGeometry,
50 : MultiPoint,
51 : MultiLineString,
52 : MultiPolygon
53 : };
54 :
55 : struct Attribute
56 : {
57 : std::string sName;
58 : std::string sValue;
59 : };
60 :
61 : struct Coordinate
62 : {
63 : double dfLongitude;
64 : double dfLatitude;
65 : double dfAltitude;
66 : bool bHasZ;
67 :
68 6469 : Coordinate() : dfLongitude(0), dfLatitude(0), dfAltitude(0), bHasZ(false)
69 : {
70 6469 : }
71 : };
72 :
73 : struct Feature
74 : {
75 : Nodetype eType;
76 : std::string sName;
77 : std::string sDescription;
78 : OGRGeometry *poGeom;
79 :
80 727 : Feature() : eType(Unknown), poGeom(nullptr)
81 : {
82 727 : }
83 :
84 727 : ~Feature()
85 727 : {
86 727 : delete poGeom;
87 727 : }
88 : };
89 :
90 : } // namespace OGRKML
91 :
92 : using namespace OGRKML;
93 :
94 : #endif /* OGR_KMLUTILITY_H_INCLUDED */
|