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 252 - (hide annotations) (download) (as text)
Sat Sep 5 09:37:31 2009 UTC (15 years, 7 months ago) by amb
File MIME type: text/x-chdr
File size: 2888 byte(s)
Improve slim mode for nodes so that no data is not loaded into RAM at all.

1 amb 110 /***************************************
2 amb 252 $Header: /home/amb/CVS/routino/src/nodesx.h,v 1.14 2009-09-05 09:37:31 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 151 This file Copyright 2008,2009 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 199 #include "typesx.h"
31 amb 110 #include "types.h"
32    
33    
34     /* Data structures */
35    
36    
37     /*+ An extended structure used for processing. +*/
38     struct _NodeX
39     {
40 amb 219 node_t id; /*+ The node identifier. +*/
41 amb 199
42 amb 223 latlong_t latitude; /*+ The node latitude. +*/
43     latlong_t longitude; /*+ The node longitude. +*/
44 amb 110 };
45    
46     /*+ A structure containing a set of nodes (memory format). +*/
47     struct _NodesX
48     {
49 amb 252 char *filename; /*+ The name of the temporary file. +*/
50     int fd; /*+ The file descriptor of the temporary file. +*/
51 amb 216
52 amb 252 uint32_t xnumber; /*+ The number of unsorted extended nodes. +*/
53 amb 249
54 amb 252 NodeX *xdata; /*+ The extended node data (sorted). +*/
55 amb 216
56 amb 219 uint32_t number; /*+ How many entries are still useful? +*/
57 amb 110
58 amb 252 node_t *gdata; /*+ The extended node data (sorted geographically). +*/
59     node_t *idata; /*+ The extended node data (sorted by ID). +*/
60 amb 216
61 amb 249 uint8_t *super; /*+ A marker for super nodes (same order as idata). +*/
62    
63 amb 219 Node *ndata; /*+ The actual nodes (same order as idata). +*/
64 amb 110 };
65    
66    
67     /* Functions */
68    
69 amb 249 NodesX *NewNodeList(const char *dirname);
70 amb 226 void FreeNodeList(NodesX *nodesx);
71 amb 110
72     void SaveNodeList(NodesX *nodesx,const char *filename);
73    
74 amb 249 index_t IndexNodeX(NodesX* nodesx,node_t id);
75 amb 252 NodeX *FindNodeX(NodesX* nodesx,node_t id);
76 amb 110
77 amb 219 void AppendNode(NodesX* nodesx,node_t id,double latitude,double longitude);
78 amb 110
79 amb 252 void InitialSortNodeList(NodesX *nodesx);
80     void ReSortNodeList(NodesX *nodesx);
81     void FinalSortNodeList(NodesX* nodesx);
82 amb 110
83 amb 212 void SortNodeListGeographically(NodesX* nodesx);
84    
85 amb 110 void RemoveNonHighwayNodes(NodesX *nodesx,SegmentsX *segmentsx);
86    
87 amb 212 void CreateRealNodes(NodesX *nodesx,int iteration);
88 amb 110
89 amb 209 void IndexNodes(NodesX *nodesx,SegmentsX *segmentsx);
90 amb 110
91    
92     #endif /* NODESX_H */

Properties

Name Value
cvs:description Extended nodes header.