GDAL

ogrlibjsonutils.h
1// SPDX-License-Identifier: MIT
2// Copyright 2007, Mateusz Loskot
3// Copyright 2008-2024, Even Rouault <even.rouault at spatialys.com>
4
5#ifndef OGRLIBJSONUTILS_H_INCLUDED
6#define OGRLIBJSONUTILS_H_INCLUDED
7
10#include "cpl_port.h"
11#include "cpl_json_header.h"
12
13#include "ogr_api.h"
14
15 bool CPL_DLL OGRJSonParse(const char *pszText, json_object **ppoObj,
16 bool bVerboseError = true);
17
18json_object CPL_DLL *CPL_json_object_object_get(struct json_object *obj,
19 const char *key);
20json_object CPL_DLL *json_ex_get_object_by_path(json_object *poObj,
21 const char *pszPath);
22
23/************************************************************************/
24/* GeoJSON Parsing Utilities */
25/************************************************************************/
26
27lh_entry CPL_DLL *OGRGeoJSONFindMemberEntryByName(json_object *poObj,
28 const char *pszName);
29json_object CPL_DLL *OGRGeoJSONFindMemberByName(json_object *poObj,
30 const char *pszName);
31
32/************************************************************************/
33/* GeoJSONPropertyToFieldType */
34/************************************************************************/
35
36 OGRFieldType CPL_DLL GeoJSONPropertyToFieldType(json_object *poObject,
37 OGRFieldSubType &eSubType,
38 bool bArrayAsString = false);
39
40 CPL_C_START
41/* %.XXXf formatting */
42json_object CPL_DLL *json_object_new_double_with_precision(double dfVal,
43 int nCoordPrecision);
44
45/* %.XXXg formatting */
46json_object CPL_DLL *
47json_object_new_double_with_significant_figures(double dfVal,
48 int nSignificantFigures);
49 CPL_C_END
50
53#endif
cpl_port.h
Core portability definitions for CPL.
CPL_C_END
#define CPL_C_END
Macro to end a block of C symbols.
Definition: cpl_port.h:283
CPL_C_START
#define CPL_C_START
Macro to start a block of C symbols.
Definition: cpl_port.h:279
ogr_api.h
C API and defines for OGRFeature, OGRGeometry, and OGRDataSource related classes.
OGRFieldSubType
OGRFieldSubType
List of field subtypes.
Definition: ogr_core.h:816
OGRFieldType
OGRFieldType
List of feature field types.
Definition: ogr_core.h:788