-
Notifications
You must be signed in to change notification settings - Fork 34
/
ogr_fdw_gdal.h
70 lines (57 loc) · 1.65 KB
/
ogr_fdw_gdal.h
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
66
67
68
69
70
#ifndef _OGR_FDW_GDAL_H
#define _OGR_FDW_GDAL_H 1
/*
* Quiet warnings due to double use of
* pkgconfig macros in GDAL and PgSQL
*/
#ifdef PACKAGE_VERSION
#undef PACKAGE_VERSION
#endif
#ifdef PACKAGE_TARNAME
#undef PACKAGE_TARNAME
#endif
#ifdef PACKAGE_STRING
#undef PACKAGE_STRING
#endif
#ifdef PACKAGE_NAME
#undef PACKAGE_NAME
#endif
#ifdef PACKAGE_BUGREPORT
#undef PACKAGE_BUGREPORT
#endif
#ifdef PACKAGE_VERSION
#undef PACKAGE_VERSION
#endif
/*
* OGR library API
*/
#include "gdal.h"
#include "ogr_api.h"
#include "ogr_srs_api.h"
#include "cpl_error.h"
#include "cpl_string.h"
/*
* As far as possible code is GDAL2 compliant, and these
* mappings are used to convert to GDAL1-style function
* names. For GDALDatasetH opening, there are specific
* code blocks to handle version differences between
* GDALOpenEx() and OGROpen()
*/
#if GDAL_VERSION_MAJOR < 2
/* Redefine variable types */
#define GDALDatasetH OGRDataSourceH
#define GDALDriverH OGRSFDriverH
/* Rename GDAL2 functions to OGR equivs */
#define GDALGetDriverCount() OGRGetDriverCount()
#define GDALGetDriver(i) OGRGetDriver(i)
#define GDALAllRegister() OGRRegisterAll()
#define GDALGetDriverByName(name) OGRGetDriverByName(name)
#define GDALClose(ds) OGR_DS_Destroy(ds)
#define GDALDatasetGetLayerByName(ds,name) OGR_DS_GetLayerByName(ds,name)
#define GDALDatasetGetLayerCount(ds) OGR_DS_GetLayerCount(ds)
#define GDALDatasetGetLayer(ds,i) OGR_DS_GetLayer(ds,i)
#define GDALGetDriverShortName(dr) OGR_Dr_GetName(dr)
#define GDALGetDatasetDriver(ds) OGR_DS_GetDriver(ds)
#define GDALDatasetTestCapability(ds,cap) OGR_Dr_TestCapability(ds,cap)
#endif /* GDAL 1 support */
#endif /* _OGR_FDW_GDAL_H */