source: subversion/applications/utils/import/and2osm/osm.h @ 4349

Last change on this file since 4349 was 4179, checked in by marc, 13 years ago

add binary tree to nodes, segments and ways

File size: 1.4 KB
Line 
1#include "shapefil.h"
2
3#ifndef _OSM_H_INCLUDED
4#define _OSM_H_INCLUDED
5
6
7
8#define ROAD 1
9#define NODE 2
10#define AREA 3
11
12
13
14/*struct texts{
15       
16        unsigned char * text;
17        struct texts * btree_l;
18        struct texts * btree_h;
19       
20};*/
21
22struct tags{
23        char * key;  /*stored in text b-tree to save memory*/
24        char * value;  /*stored in text b-tree to save memory*/
25        struct tags* nextTag;
26};
27
28
29
30struct nodes{
31        long ID;
32        long ANDID;
33        double lat;
34        double lon;
35        struct tags * tag; /*contains attached tags */
36        struct attachedSegments *segments;
37};
38
39
40struct attachedSegments{
41        struct attachedSegments *nextSegment;
42        struct segments *segment;
43};
44
45struct ways{
46        int type; /*0=way, 1=area*/
47        long wayID;
48        double max_lat;
49        double max_lon;
50        double min_lat;
51        double min_lon;
52        struct tags * tag;
53        struct attachedSegments *segments;
54        struct ways * next;
55};
56
57
58struct attachedWays{
59        struct attachedWays *nextWay;
60        struct ways *way;
61};
62
63struct segments{
64        long ID;
65        struct nodes * from;
66        struct nodes * to;
67        struct segments * next;
68        struct attachedWays *ways;
69};
70
71
72
73int openOutput();
74int closeOutput();
75void save();
76long incr (long i);
77
78
79
80long Err_ND_attached_to_way;
81long Err_more_NDIDs_per_node;
82long Err_oneway_way_reversed;
83long Err_toID_without_ANDID;
84long Err_fromID_without_ANDID;
85
86
87struct tags * mkTagList(DBFHandle hDBF,long recordnr,int fileType,struct tags *p,struct nodes * from, struct nodes * to);
88
89#endif  // _OSM_H_INCLUDED
Note: See TracBrowser for help on using the repository browser.