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/nodesx.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 448 - (hide annotations) (download) (as text)
Sun Jul 11 10:56:51 2010 UTC (14 years, 8 months ago) by amb
File MIME type: text/x-chdr
File size: 3773 byte(s)
Made the planetsplitter slim mode handle the output node and segment data in a
slim way as well as in the input data.

1 amb 110 /***************************************
2 amb 448 $Header: /home/amb/CVS/routino/src/nodesx.h,v 1.24 2010-07-11 10:56:50 amb Exp $
3 amb 110
4     A header file for the extended nodes.
5 amb 151
6     Part of the Routino routing software.
7 amb 110 ******************/ /******************
8 amb 326 This file Copyright 2008-2010 Andrew M. Bishop
9 amb 110
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 110 ***************************************/
23    
24    
25     #ifndef NODESX_H
26     #define NODESX_H /*+ To stop multiple inclusions. +*/
27    
28     #include <stdint.h>
29    
30 amb 448 #include "nodes.h"
31    
32 amb 199 #include "typesx.h"
33 amb 110 #include "types.h"
34    
35    
36     /* Data structures */
37    
38    
39     /*+ An extended structure used for processing. +*/
40     struct _NodeX
41     {
42 amb 219 node_t id; /*+ The node identifier. +*/
43 amb 199
44 amb 223 latlong_t latitude; /*+ The node latitude. +*/
45     latlong_t longitude; /*+ The node longitude. +*/
46 amb 110 };
47    
48     /*+ A structure containing a set of nodes (memory format). +*/
49     struct _NodesX
50     {
51 amb 252 char *filename; /*+ The name of the temporary file. +*/
52     int fd; /*+ The file descriptor of the temporary file. +*/
53 amb 216
54 amb 252 uint32_t xnumber; /*+ The number of unsorted extended nodes. +*/
55 amb 249
56 amb 252 NodeX *xdata; /*+ The extended node data (sorted). +*/
57 amb 275 NodeX cached[2]; /*+ Two cached nodes read from the file in slim mode. +*/
58 amb 216
59 amb 219 uint32_t number; /*+ How many entries are still useful? +*/
60 amb 110
61 amb 278 node_t *idata; /*+ The extended node IDs (sorted by ID). +*/
62 amb 216
63 amb 281 uint8_t *super; /*+ A marker for super nodes (same order sorted nodes). +*/
64 amb 249
65 amb 281 Node *ndata; /*+ The actual nodes (same order as geographically sorted nodes). +*/
66 amb 257
67 amb 448 char *nfilename; /*+ The name of the temporary file for nodes in slim mode. +*/
68     int nfd; /*+ The file descriptor of the temporary file. +*/
69    
70     Node ncached[2]; /*+ Two cached nodes read from the file in slim mode. +*/
71    
72 amb 258 uint32_t latbins; /*+ The number of bins containing latitude. +*/
73     uint32_t lonbins; /*+ The number of bins containing longitude. +*/
74 amb 257
75 amb 258 ll_bin_t latzero; /*+ The bin number of the furthest south bin. +*/
76     ll_bin_t lonzero; /*+ The bin number of the furthest west bin. +*/
77 amb 257
78 amb 281 uint32_t latlonbin; /*+ A temporary index into the offsets array. +*/
79    
80 amb 258 index_t *offsets; /*+ An array of offset to the first node in each bin. +*/
81 amb 110 };
82    
83    
84     /* Functions */
85    
86 amb 326 NodesX *NewNodeList(int append);
87     void FreeNodeList(NodesX *nodesx,int keep);
88 amb 110
89     void SaveNodeList(NodesX *nodesx,const char *filename);
90    
91 amb 249 index_t IndexNodeX(NodesX* nodesx,node_t id);
92 amb 275 NodeX *LookupNodeX(NodesX* nodesx,index_t index,int position);
93 amb 110
94 amb 448 Node *LookupNodeXNode(NodesX* nodesx,index_t index,int position);
95     void PutBackNodeXNode(NodesX* nodesx,index_t index,int position);
96    
97 amb 219 void AppendNode(NodesX* nodesx,node_t id,double latitude,double longitude);
98 amb 110
99 amb 263 void SortNodeList(NodesX *nodesx);
100 amb 110
101 amb 212 void SortNodeListGeographically(NodesX* nodesx);
102    
103 amb 110 void RemoveNonHighwayNodes(NodesX *nodesx,SegmentsX *segmentsx);
104    
105 amb 212 void CreateRealNodes(NodesX *nodesx,int iteration);
106 amb 110
107 amb 209 void IndexNodes(NodesX *nodesx,SegmentsX *segmentsx);
108 amb 110
109    
110     #endif /* NODESX_H */

Properties

Name Value
cvs:description Extended nodes header.