forked from lukeroth/gdal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
go_ogr_wkb.c
36 lines (26 loc) · 1.51 KB
/
go_ogr_wkb.c
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
// Copyright 2019 AirMap Inc. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
#include "go_ogr_wkb.h"
#include <gdal_version.h>
#if GDAL_COMPUTE_VERSION(GDAL_VERSION_MAJOR, GDAL_VERSION_MINOR, GDAL_VERSION_PATCH) >= GDAL_COMPUTE_VERSION(2, 3, 0)
OGRErr go_CreateFromWkb(void* pabyData, OGRSpatialReferenceH hSRS, OGRGeometryH* phGeometry, int nBytes) {
return OGR_G_CreateFromWkb(pabyData, hSRS, phGeometry, nBytes);
}
OGRErr go_ImportFromWkb(OGRGeometryH hGeom, void* pabyData, int nSize) {
return OGR_G_ImportFromWkb(hGeom, pabyData, nSize);
}
OGRErr go_ExportToWkb(OGRGeometryH hGeom, OGRwkbByteOrder eOrder, unsigned char* pabyDstBuffer) {
return OGR_G_ExportToWkb(hGeom, eOrder, pabyDstBuffer);
}
#elif GDAL_COMPUTE_VERSION(GDAL_VERSION_MAJOR, GDAL_VERSION_MINOR, GDAL_VERSION_PATCH) < GDAL_COMPUTE_VERSION(2, 3, 0)
OGRErr go_CreateFromWkb(void* pabyData, OGRSpatialReferenceH hSRS, OGRGeometryH* phGeometry, int nBytes) {
return OGR_G_CreateFromWkb((unsigned char*)pabyData, hSRS, phGeometry, nBytes);
}
OGRErr go_ImportFromWkb(OGRGeometryH hGeom, void* pabyData, int nSize) {
return OGR_G_ImportFromWkb(hGeom, (unsigned char*)pabyData, nSize);
}
OGRErr go_ExportToWkb(OGRGeometryH hGeom, OGRwkbByteOrder eOrder, unsigned char* pabyDstBuffer) {
return OGR_G_ExportToWkb(hGeom, eOrder, pabyDstBuffer);
}
#endif // GDAL_COMPUTE_VERSION(GDAL_VERSION_MAJOR, GDAL_VERSION_MINOR, GDAL_VERSION_PATCH) >= GDAL_COMPUTE_VERSION(2, 3, 0)