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
39typedef void *GNMNetworkH;
40typedef void *GNMGenericNetworkH;
41
42const char CPL_DLL *CPL_STDCALL GNMGetName(GNMNetworkH hNet);
43
44int 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,
49 GNMGFID nGFID);
50
51 OGRLayerH CPL_DLL CPL_STDCALL GNMGetPath(GNMNetworkH hNet, GNMGFID nStartFID,
52 GNMGFID nEndFID,
53 GNMGraphAlgorithmType eAlgorithm,
54 char **papszOptions);
55
56 CPLErr CPL_DLL CPL_STDCALL GNMConnectFeatures(GNMGenericNetworkH hNet,
57 GNMGFID nSrcFID, GNMGFID nTgtFID,
58 GNMGFID nConFID, double dfCost,
59 double dfInvCost,
60 GNMDirection eDir);
61
62 CPLErr CPL_DLL CPL_STDCALL GNMDisconnectFeatures(GNMGenericNetworkH hNet,
63 GNMGFID nSrcFID,
64 GNMGFID nTgtFID,
65 GNMGFID nConFID);
66
67 CPLErr CPL_DLL CPL_STDCALL GNMDisconnectFeaturesWithId(GNMGenericNetworkH hNet,
68 GNMGFID nFID);
69
70 CPLErr CPL_DLL CPL_STDCALL GNMReconnectFeatures(
71 GNMGenericNetworkH hNet, GNMGFID nSrcFID, GNMGFID nTgtFID, GNMGFID nConFID,
72 double dfCost, double dfInvCost, GNMDirection eDir);
73
74 CPLErr CPL_DLL CPL_STDCALL GNMCreateRule(GNMGenericNetworkH hNet,
75 const char *pszRuleStr);
76
77 CPLErr CPL_DLL CPL_STDCALL GNMDeleteAllRules(GNMGenericNetworkH hNet);
78
79 CPLErr CPL_DLL CPL_STDCALL GNMDeleteRule(GNMGenericNetworkH hNet,
80 const char *pszRuleStr);
81
82char CPL_DLL **CPL_STDCALL GNMGetRules(GNMGenericNetworkH hNet);
83
84 CPLErr CPL_DLL CPL_STDCALL GNMConnectPointsByLines(
85 GNMGenericNetworkH hNet, char **papszLayerList, double dfTolerance,
86 double dfCost, double dfInvCost, GNMDirection eDir);
87
88 CPLErr CPL_DLL CPL_STDCALL GNMChangeBlockState(GNMGenericNetworkH hNet,
89 GNMGFID nFID, bool bIsBlock);
90
91 CPLErr CPL_DLL CPL_STDCALL GNMChangeAllBlockState(GNMGenericNetworkH hNet,
92 int bIsBlock);
93
94GNMNetworkH CPL_DLL CPL_STDCALL GNMCastToNetwork(GDALMajorObjectH hBase);
95
96GNMGenericNetworkH CPL_DLL CPL_STDCALL
97GNMCastToGenericNetwork(GDALMajorObjectH hBase);
98
99 CPL_C_END
100
101#endif // GNM_API
CPLErr
CPLErr
Error category.
Definition: cpl_error.h:53
CPL_C_END
#define CPL_C_END
Macro to end a block of C symbols.
Definition: cpl_port.h:299
CPL_C_START
#define CPL_C_START
Macro to start a block of C symbols.
Definition: cpl_port.h:295
GDALMajorObjectH
void * GDALMajorObjectH
Opaque type used for the C bindings of the C++ GDALMajorObject class.
Definition: gdal.h:288
OGRLayerH
void * OGRLayerH
Opaque type for a layer (OGRLayer)
Definition: ogr_api.h:688
OGRFeatureH
void * OGRFeatureH
Opaque type for a feature (OGRFeature)
Definition: ogr_api.h:422