forked from maximuska/Freemap-waze
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroadmap_db_square.h
90 lines (72 loc) · 2.28 KB
/
roadmap_db_square.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/* roadmap_db_square.h - the format of the square table used by RoadMap.
*
* LICENSE:
*
* Copyright 2002 Pascal F. Martin
* Copyright 2008 Ehud Shabtai
*
* This file is part of RoadMap.
*
* RoadMap is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* RoadMap is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with RoadMap; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* SYNOPSYS:
*
* The RoadMap square divide the complete territory into a grid of smaller
* rectangular areas. The goal is 91) to speed up RoadMap by localizing
* the data to be accessed (most tables are sorted by squares) and (2) to
* make the database more compact by using point locations relative to
* the center of the square.
*
* The squares are described by the following tables:
*
* square.global Some global information regarding the territory.
* square.data The position of each square.
*
* The square are built so that a relative location fits into a signed
* 16 bits value.
*/
#ifndef _ROADMAP_DB_SQUARE__H_
#define _ROADMAP_DB_SQUARE__H_
#include "roadmap_types.h"
typedef struct {
int square_id;
int scale;
unsigned int timestamp;
} RoadMapSquare;
typedef struct {
RoadMapArea edges;
int num_scales;
int count_squares; /* Necessary because empty squares have been removed. */
int step_longitude;
int step_latitude;
} RoadMapGrid;
typedef struct {
unsigned int timestamp;
} RoadMapGlobal;
typedef struct {
int first_longitude;
int first_latitude;
int count_longitude;
int count_latitude;
int scale_factor;
} RoadMapScale;
#define GZM_ENTRY_LEN 8
typedef struct {
char name[GZM_ENTRY_LEN];
int offset;
int compressed_size;
int raw_size;
} RoadMapSquareIndex;
#endif // _ROADMAP_DB_SQUARE__H_