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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
|
/******************************************************************************
*
* Project: OpenGIS Simple Features Reference Implementation
* Purpose: Private utilities within OGR OGRGeoJSON Driver.
* Author: Mateusz Loskot, mateusz@loskot.net
*
******************************************************************************
* Copyright (c) 2007, Mateusz Loskot
*
* SPDX-License-Identifier: MIT
****************************************************************************/
#ifndef OGR_GEOJSONUTILS_H_INCLUDED
#define OGR_GEOJSONUTILS_H_INCLUDED
#include "ogr_core.h"
#include "cpl_json_header.h"
#include "cpl_http.h"
#include "cpl_vsi.h"
#include "gdal_priv.h"
class OGRGeometry;
/************************************************************************/
/* GeoJSONSourceType */
/************************************************************************/
enum GeoJSONSourceType
{
eGeoJSONSourceUnknown = 0,
eGeoJSONSourceFile,
eGeoJSONSourceText,
eGeoJSONSourceService
};
GeoJSONSourceType GeoJSONGetSourceType(GDALOpenInfo *poOpenInfo);
GeoJSONSourceType GeoJSONSeqGetSourceType(GDALOpenInfo *poOpenInfo);
GeoJSONSourceType ESRIJSONDriverGetSourceType(GDALOpenInfo *poOpenInfo);
GeoJSONSourceType TopoJSONDriverGetSourceType(GDALOpenInfo *poOpenInfo);
GeoJSONSourceType JSONFGDriverGetSourceType(GDALOpenInfo *poOpenInfo);
/************************************************************************/
/* GeoJSONIsObject */
/************************************************************************/
bool GeoJSONIsObject(const char *pszText, GDALOpenInfo *poOpenInfo);
bool GeoJSONSeqIsObject(const char *pszText, GDALOpenInfo *poOpenInfo);
bool ESRIJSONIsObject(const char *pszText, GDALOpenInfo *poOpenInfo);
bool TopoJSONIsObject(const char *pszText, GDALOpenInfo *poOpenInfo);
bool JSONFGIsObject(const char *pszText, GDALOpenInfo *poOpenInfo);
/************************************************************************/
/* GeoJSONStringPropertyToFieldType */
/************************************************************************/
OGRFieldType GeoJSONStringPropertyToFieldType(json_object *poObject,
int &nTZFlag);
/************************************************************************/
/* GeoJSONHTTPFetchWithContentTypeHeader */
/************************************************************************/
CPLHTTPResult *GeoJSONHTTPFetchWithContentTypeHeader(const char *pszURL);
#endif // OGR_GEOJSONUTILS_H_INCLUDED
|