Routino SVN Repository Browser

Check out the latest version of Routino: svn co http://routino.org/svn/trunk routino

ViewVC logotype

Annotation of /trunk/src/nodes.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 232 - (hide annotations) (download) (as text)
Sun Jul 19 14:10:27 2009 UTC (15 years, 8 months ago) by amb
File MIME type: text/x-chdr
File size: 2912 byte(s)
Include the number of super-nodes, super-segments etc in the database as useful
information to put in the statistics output.

1 amb 18 /***************************************
2 amb 232 $Header: /home/amb/CVS/routino/src/nodes.h,v 1.29 2009-07-19 14:10:26 amb Exp $
3 amb 18
4     A header file for the nodes.
5 amb 151
6     Part of the Routino routing software.
7 amb 18 ******************/ /******************
8 amb 151 This file Copyright 2008,2009 Andrew M. Bishop
9 amb 18
10 amb 151 This program is free software: you can redistribute it and/or modify
11     it under the terms of the GNU Affero General Public License as published by
12     the Free Software Foundation, either version 3 of the License, or
13     (at your option) any later version.
14    
15     This program is distributed in the hope that it will be useful,
16     but WITHOUT ANY WARRANTY; without even the implied warranty of
17     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18     GNU Affero General Public License for more details.
19    
20     You should have received a copy of the GNU Affero General Public License
21     along with this program. If not, see <http://www.gnu.org/licenses/>.
22 amb 18 ***************************************/
23    
24    
25     #ifndef NODES_H
26     #define NODES_H /*+ To stop multiple inclusions. +*/
27    
28     #include <stdint.h>
29    
30 amb 96 #include "types.h"
31 amb 179 #include "profiles.h"
32 amb 18
33    
34     /* Data structures */
35    
36    
37 amb 109 /*+ A structure containing a single node. +*/
38     struct _Node
39 amb 88 {
40 amb 109 index_t firstseg; /*+ The index of the first segment. +*/
41 amb 88
42 amb 109 ll_off_t latoffset; /*+ The node latitude offset within its bin. +*/
43     ll_off_t lonoffset; /*+ The node longitude offset within its bin. +*/
44     };
45 amb 88
46 amb 109
47 amb 19 /*+ A structure containing a set of nodes (mmap format). +*/
48 amb 109 struct _Nodes
49 amb 19 {
50 amb 232 uint32_t number; /*+ How many nodes in total? +*/
51     uint32_t snumber; /*+ How many super-nodes? +*/
52 amb 88
53 amb 99 uint32_t latbins; /*+ The number of bins containing latitude. +*/
54     uint32_t lonbins; /*+ The number of bins containing longitude. +*/
55    
56 amb 223 ll_bin_t latzero; /*+ The bin number of the furthest south bin. +*/
57     ll_bin_t lonzero; /*+ The bin number of the furthest west bin. +*/
58 amb 99
59 amb 219 index_t *offsets; /*+ An array of offset to the first node in each bin. +*/
60 amb 99
61 amb 88 Node *nodes; /*+ An array of nodes. +*/
62    
63     void *data; /*+ The memory mapped data. +*/
64 amb 109 };
65 amb 19
66    
67 amb 109 /* Macros */
68 amb 99
69 amb 202 /*+ Return a Node pointer given a set of nodes and an index. +*/
70     #define LookupNode(xxx,yyy) (&(xxx)->nodes[yyy])
71 amb 18
72 amb 109 /*+ Return a Segment points given a Node pointer and a set of segments. +*/
73 amb 174 #define FirstSegment(xxx,yyy,zzz) LookupSegment((xxx),SEGMENT((yyy)->nodes[zzz].firstseg))
74 amb 109
75     /*+ Return true if this is a super-node. +*/
76 amb 208 #define IsSuperNode(xxx,yyy) (((xxx)->nodes[yyy].firstseg)&NODE_SUPER)
77 amb 109
78    
79 amb 18 /* Functions */
80    
81    
82 amb 19 Nodes *LoadNodeList(const char *filename);
83 amb 18
84 amb 219 index_t FindNode(Nodes* nodes,Segments *segments,Ways *ways,double latitude,double longitude,distance_t *distance,Profile *profile);
85 amb 99
86 amb 219 void GetLatLong(Nodes *nodes,index_t index,double *latitude,double *longitude);
87 amb 99
88 amb 18
89     #endif /* NODES_H */

Properties

Name Value
cvs:description Header file for nodes.