GDAL

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