GDAL

gnm_api.h
1/******************************************************************************
2 *
3 * Project: GDAL/OGR Geography Network support (Geographic Network Model)
4 * Purpose: GNM C API.
5 * Authors: Mikhail Gusev (gusevmihs at gmail dot com)
6 * Dmitry Baryshnikov, polimax@mail.ru
7 *
8 ******************************************************************************
9 * Copyright (c) 2014, Mikhail Gusev
10 * Copyright (c) 2014-2015, NextGIS <info@nextgis.com>
11 *
12 * Permission is hereby granted, free of charge, to any person obtaining a
13 * copy of this software and associated documentation files (the "Software"),
14 * to deal in the Software without restriction, including without limitation
15 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
16 * and/or sell copies of the Software, and to permit persons to whom the
17 * Software is furnished to do so, subject to the following conditions:
18 *
19 * The above copyright notice and this permission notice shall be included
20 * in all copies or substantial portions of the Software.
21 *
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
23 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
25 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
27 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
28 * DEALINGS IN THE SOFTWARE.
29 ****************************************************************************/
30
31#ifndef GNM_API
32#define GNM_API
33
34#include "gnm.h"
35
36#include "gdal_fwd.h"
37
38 CPL_C_START
39
40 const char CPL_DLL *CPL_STDCALL GNMGetName(GNMNetworkH hNet);
41
42 int CPL_DLL CPL_STDCALL GNMGetVersion(GNMNetworkH hNet);
43
44 CPLErr CPL_DLL CPL_STDCALL GNMDisconnectAll(GNMNetworkH hNet);
45
46 OGRFeatureH CPL_DLL CPL_STDCALL GNMGetFeatureByGlobalFID(GNMNetworkH hNet,
47 GNMGFID nGFID);
48
49 OGRLayerH CPL_DLL CPL_STDCALL GNMGetPath(GNMNetworkH hNet, GNMGFID nStartFID,
50 GNMGFID nEndFID,
51 GNMGraphAlgorithmType eAlgorithm,
52 char **papszOptions);
53
54 CPLErr CPL_DLL CPL_STDCALL GNMConnectFeatures(GNMGenericNetworkH hNet,
55 GNMGFID nSrcFID, GNMGFID nTgtFID,
56 GNMGFID nConFID, double dfCost,
57 double dfInvCost,
58 GNMDirection eDir);
59
60 CPLErr CPL_DLL CPL_STDCALL GNMDisconnectFeatures(GNMGenericNetworkH hNet,
61 GNMGFID nSrcFID,
62 GNMGFID nTgtFID,
63 GNMGFID nConFID);
64
65 CPLErr CPL_DLL CPL_STDCALL GNMDisconnectFeaturesWithId(GNMGenericNetworkH hNet,
66 GNMGFID nFID);
67
68 CPLErr CPL_DLL CPL_STDCALL GNMReconnectFeatures(
69 GNMGenericNetworkH hNet, GNMGFID nSrcFID, GNMGFID nTgtFID, GNMGFID nConFID,
70 double dfCost, double dfInvCost, GNMDirection eDir);
71
72 CPLErr CPL_DLL CPL_STDCALL GNMCreateRule(GNMGenericNetworkH hNet,
73 const char *pszRuleStr);
74
75 CPLErr CPL_DLL CPL_STDCALL GNMDeleteAllRules(GNMGenericNetworkH hNet);
76
77 CPLErr CPL_DLL CPL_STDCALL GNMDeleteRule(GNMGenericNetworkH hNet,
78 const char *pszRuleStr);
79
80 char CPL_DLL **CPL_STDCALL GNMGetRules(GNMGenericNetworkH hNet);
81
82 CPLErr CPL_DLL CPL_STDCALL GNMConnectPointsByLines(
83 GNMGenericNetworkH hNet, char **papszLayerList, double dfTolerance,
84 double dfCost, double dfInvCost, GNMDirection eDir);
85
86 CPLErr CPL_DLL CPL_STDCALL GNMChangeBlockState(GNMGenericNetworkH hNet,
87 GNMGFID nFID, bool bIsBlock);
88
89 CPLErr CPL_DLL CPL_STDCALL GNMChangeAllBlockState(GNMGenericNetworkH hNet,
90 int bIsBlock);
91
92 GNMNetworkH CPL_DLL CPL_STDCALL GNMCastToNetwork(GDALMajorObjectH hBase);
93
94 GNMGenericNetworkH CPL_DLL CPL_STDCALL
95GNMCastToGenericNetwork(GDALMajorObjectH hBase);
96
97 CPL_C_END
98
99#endif // GNM_API
CPLErr
CPLErr
Error category.
Definition cpl_error.h:37
CPL_C_END
#define CPL_C_END
Macro to end a block of C symbols.
Definition cpl_port.h:289
CPL_C_START
#define CPL_C_START
Macro to start a block of C symbols.
Definition cpl_port.h:285
gdal_fwd.h
Forward definitions of GDAL/OGR/OSR C handle types.
OGRLayerH
void * OGRLayerH
Opaque type for a layer (OGRLayer)
Definition gdal_fwd.h:157
GNMGenericNetworkH
void * GNMGenericNetworkH
Opaque type for a GNMGenericNetwork.
Definition gdal_fwd.h:212
GNMNetworkH
void * GNMNetworkH
Opaque type for a GNMNetwork.
Definition gdal_fwd.h:209
OGRFeatureH
void * OGRFeatureH
Opaque type for a feature (OGRFeature)
Definition gdal_fwd.h:141
GDALMajorObjectH
void * GDALMajorObjectH
Opaque type used for the C bindings of the C++ GDALMajorObject class.
Definition gdal_fwd.h:39