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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 542 - (hide annotations) (download) (as text)
Sat Dec 18 15:19:33 2010 UTC (14 years, 3 months ago) by amb
File MIME type: text/x-chdr
File size: 3853 byte(s)
Add a Relations data type and write out the turn relations that have been read
in.  Still doesn't perform the required processing after reading the data or use
the information for routing.

1 amb 496 /***************************************
2 amb 542 $Header: /home/amb/CVS/routino/src/relationsx.h,v 1.5 2010-12-18 15:19:33 amb Exp $
3 amb 496
4     A header file for the extended Relations structure.
5    
6     Part of the Routino routing software.
7     ******************/ /******************
8     This file Copyright 2010 Andrew M. Bishop
9    
10     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     ***************************************/
23    
24    
25     #ifndef RELATIONSX_H
26     #define RELATIONSX_H /*+ To stop multiple inclusions. +*/
27    
28     #include <stdint.h>
29    
30     #include "types.h"
31    
32     #include "typesx.h"
33    
34    
35     /* Data structures */
36    
37    
38     /*+ An extended structure containing a single route relation. +*/
39     struct _RouteRelX
40     {
41 amb 529 relation_t id; /*+ The relation identifier. +*/
42 amb 496
43 amb 529 transports_t routes; /*+ The types of transports that that this relation is for. +*/
44 amb 496 };
45    
46    
47 amb 540 /*+ An extended structure containing a single turn restriction relation. +*/
48     struct _TurnRestrictRelX
49     {
50     relation_t id; /*+ The relation identifier. +*/
51    
52     way_t from; /*+ The id of the starting way; initially the OSM value, later the WayX index. +*/
53     way_t to; /*+ The id of the ending way; initially the OSM value, later the WayX index. +*/
54     node_t via; /*+ The id of the via node; initially the OSM value, later the NodeX index. +*/
55    
56     TurnRestriction restrict; /*+ The type of restriction. +*/
57     transports_t except; /*+ The types of transports that that this relation does not apply to. +*/
58     };
59    
60    
61 amb 496 /*+ A structure containing a set of relations. +*/
62     struct _RelationsX
63     {
64     /* Route relations */
65    
66     char *rfilename; /*+ The name of the temporary file (for the RouteRelX). +*/
67     int rfd; /*+ The file descriptor of the temporary file (for the RouteRelX). +*/
68    
69     index_t rxnumber; /*+ The number of unsorted extended route relations. +*/
70 amb 540
71     /* Turn restriction relations */
72    
73     char *trfilename; /*+ The name of the temporary file (for the TurnRestrictRelX). +*/
74     int trfd; /*+ The file descriptor of the temporary file (for the TurnRestrictRelX). +*/
75    
76     index_t trxnumber; /*+ The number of unsorted extended turn restriction relations. +*/
77     index_t trnumber; /*+ The number of sorted extended turn restriction relations. +*/
78 amb 496 };
79    
80    
81     /* Functions */
82    
83    
84     RelationsX *NewRelationList(int append);
85     void FreeRelationList(RelationsX *relationsx,int keep);
86    
87 amb 540 void AppendRouteRelation(RelationsX* relationsx,relation_t id,
88     transports_t routes,
89 amb 496 way_t *ways,int nways,
90     relation_t *relations,int nrelations);
91    
92 amb 540 void AppendTurnRestrictRelation(RelationsX* relationsx,relation_t id,
93     way_t from,way_t to,node_t via,
94     TurnRestriction restriction,transports_t except);
95    
96 amb 496 void SortRelationList(RelationsX *relationsx);
97    
98     void ProcessRouteRelations(RelationsX *relationsx,WaysX *waysx);
99    
100 amb 542 void ProcessTurnRelations1(RelationsX *relationsx,NodesX *nodesx,SegmentsX *segmentsx,WaysX *waysx);
101 amb 496
102 amb 542 void ProcessTurnRelations2(RelationsX *relationsx,NodesX *nodesx);
103    
104     void SaveRelationList(RelationsX* relationsx,const char *filename);
105    
106    
107 amb 496 #endif /* RELATIONSX_H */