GDAL
gnm_priv.h
1/******************************************************************************
2 *
3 * Project: GDAL/OGR Geography Network support (Geographic Network Model)
4 * Purpose: GNM private and internal declarations.
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_PRIV
32#define GNM_PRIV
33
34#include "gdal_priv.h"
35
36/* -------------------------------------------------------------------- */
37/* Common constants for internal use */
38/* -------------------------------------------------------------------- */
39
40// General constants.
41#define GNM_VERSION "1.0"
42#define GNM_VERSION_NUM 100 // major * 100 + minor
43
44// Obligatory system layers.
45#define GNM_SYSLAYER_META "_gnm_meta"
46#define GNM_SYSLAYER_GRAPH "_gnm_graph"
47#define GNM_SYSLAYER_FEATURES "_gnm_features"
48
49// System field names.
50// FORMAT NOTE: Shapefile driver does not support field names more than 10
51// characters.
52
53#define GNM_SYSFIELD_PARAMNAME "key"
54#define GNM_SYSFIELD_PARAMVALUE "val"
55#define GNM_SYSFIELD_SOURCE "source"
56#define GNM_SYSFIELD_TARGET "target"
57#define GNM_SYSFIELD_CONNECTOR "connector"
58#define GNM_SYSFIELD_COST "cost"
59#define GNM_SYSFIELD_INVCOST "inv_cost"
60#define GNM_SYSFIELD_DIRECTION "direction"
61#define GNM_SYSFIELD_GFID "gnm_fid"
62#define GNM_SYSFIELD_LAYERNAME "ogrlayer"
63#define GNM_SYSFIELD_BLOCKED "blocked"
64#define GNM_SYSFIELD_PATHNUM "path_num"
65#define GNM_SYSFIELD_TYPE "ftype"
66
67// Rule strings key-words.
68#define GNM_RULEKW_CONNECTS "CONNECTS"
69#define GNM_RULEKW_WITH "WITH"
70#define GNM_RULEKW_VIA "VIA"
71#define GNM_RULEKW_ALLOW "ALLOW"
72#define GNM_RULEKW_DENY "DENY"
73#define GNM_RULEKW_ANY "ANY"
74
75#define GNM_BLOCK_NONE 0x0000 // no blocking (vertex or edge)
76#define GNM_BLOCK_SRC 0x0001 // the source vertex is blocked
77#define GNM_BLOCK_TGT 0x0002 // the target vertext is blocked
78#define GNM_BLOCK_CONN 0x0004 // the connection edge is blocked
79#define GNM_BLOCK_ALL GNM_BLOCK_SRC | GNM_BLOCK_TGT | GNM_BLOCK_CONN
80
81// Other string constants.
82#define GNM_SRSFILENAME "_gnm_srs.prj"
83
84// Correspondent datatype for identificator
85// (i.e. int -> OFTInteger -> GetFieldAsInteger and
86// GUIntBig -> OFTInteger64 -> GetFieldAsInteger64)
87#define GNMGFIDInt OFTInteger64
88#define GetFieldAsGNMGFID GetFieldAsInteger64
89#define GNMGFIDFormat CPL_FRMT_GIB
90
91#endif // GNM_PRIV
This file is legacy since GDAL 3.12, but will be kept at least in the whole GDAL 3....