Debian Codegraph @

ogr/ogrsf_frmts/libkml/ogrlibkmlfield.h

raw
1 /******************************************************************************
2 *
3 * Project: KML Translator
4 * Purpose: Implements OGRLIBKMLDriver
5 * Author: Brian Case, rush at winkey dot org
6 *
7 ******************************************************************************
8 * Copyright (c) 2010, Brian Case
9 * Copyright (c) 2014, Even Rouault <even dot rouault at spatialys.com>
10 *
11 * SPDX-License-Identifier: MIT
12 *****************************************************************************/
13
14 #ifndef OGRLIBKMLFIELD_H_INCLUDED
15 #define OGRLIBKMLFIELD_H_INCLUDED
16
17 #include "fieldconfig.h"
18
19 /******************************************************************************
20 Function to output ogr fields in kml.
21
22 args:
23 poOgrFeat pointer to the feature the field is in
24 poOgrLayer pointer to the layer the feature is in
25 poKmlFactory pointer to the libkml dom factory
26 poKmlPlacemark pointer to the placemark to add to
27
28 returns:
29 nothing
30
31 env vars:
32 LIBKML_TIMESTAMP_FIELD default: OFTDate or OFTDateTime named timestamp
33 LIBKML_TIMESPAN_BEGIN_FIELD default: OFTDate or OFTDateTime named begin
34 LIBKML_TIMESPAN_END_FIELD default: OFTDate or OFTDateTime named end
35 LIBKML_DESCRIPTION_FIELD default: none
36 LIBKML_NAME_FIELD default: OFTString field named name
37
38 ******************************************************************************/
39
40 #include "ogr_libkml.h"
41
42 #include <set>
43
44 void field2kml(OGRFeature *poOgrFeat, OGRLIBKMLLayer *poOgrLayer,
45 kmldom::KmlFactory *poKmlFactory,
46 kmldom::FeaturePtr poKmlPlacemark, int bUseSimpleField,
47 const fieldconfig &oFC);
48
49 /******************************************************************************
50 Function to read kml into ogr fields.
51 ******************************************************************************/
52
53 void kml2field(
54 OGRFeature *poOgrFeat, kmldom::FeaturePtr poKmlFeature,
55 const fieldconfig &oFC,
56 const std::map<std::string, int> &mapSimpleFieldNameToOgrFieldIx);
57
58 /******************************************************************************
59 Function create a simplefield from a FieldDefn.
60 ******************************************************************************/
61
62 kmldom::SimpleFieldPtr FieldDef2kml(const OGRFieldDefn *poOgrFieldDef,
63 kmldom::KmlFactory *poKmlFactory,
64 bool bApproxOK, const fieldconfig &oFC);
65
66 /******************************************************************************
67 Function to add the simpleFields in a schema to a featuredefn.
68 ******************************************************************************/
69
70 void kml2FeatureDef(kmldom::SchemaPtr poKmlSchema,
71 OGRFeatureDefn *poOgrFeatureDefn,
72 std::map<std::string, int> &mapSimpleFieldNameToOgrFieldIx,
73 std::set<std::string> &oSetSimpleFields);
74
75 int kmlAltitudeModeFromString(const char *pszAltitudeMode, int &isGX);
76
77 #endif /* OGRLIBKMLFIELD_H_INCLUDED */