source: subversion/applications/utils/export/osm2pgsql-intarray/osmtypes.h @ 28719

Last change on this file since 28719 was 24138, checked in by hholzgra, 9 years ago

fixed some warnings, code compiles clean with

-Wall -Wextra -pedantic

File size: 1.4 KB
Line 
1/* Data types to hold OSM node, segment, way data */
2
3#ifndef OSMTYPES_H
4#define OSMTYPES_H
5
6#include "keyvals.h"
7
8enum OsmType { OSMTYPE_WAY, OSMTYPE_NODE, OSMTYPE_RELATION };
9
10struct osmNode {
11    double lon;
12    double lat;
13};
14
15struct member {
16    enum OsmType type;
17    int id;
18    char *role;
19};
20
21typedef enum { FILETYPE_NONE, FILETYPE_OSM, FILETYPE_OSMCHANGE, FILETYPE_PLANETDIFF } filetypes_t;
22typedef enum { ACTION_NONE, ACTION_CREATE, ACTION_MODIFY, ACTION_DELETE } actions_t;
23
24struct osmdata_t {
25  int count_node,    max_node;
26  int count_way,     max_way;
27  int count_rel,     max_rel;
28
29  struct output_t *out;
30
31/* Since {node,way} elements are not nested we can guarantee the
32   values in an end tag must match those of the corresponding
33   start tag and can therefore be cached.
34*/
35  double node_lon, node_lat;
36  struct keyval tags;
37  int *nds;
38  int nd_count, nd_max;
39  struct member *members;
40  unsigned member_count, member_max;
41  int osm_id;
42  filetypes_t filetype;
43  actions_t action;
44  int extra_attributes;
45
46  // Bounding box to filter imported data
47  const char *bbox;
48
49  double minlon, minlat, maxlon, maxlat;
50};
51
52void realloc_nodes(struct osmdata_t *osmdata);
53void realloc_members(struct osmdata_t *osmdata);
54void resetMembers(struct osmdata_t *osmdata);
55void printStatus(struct osmdata_t *osmdata);
56int node_wanted(struct osmdata_t *osmdata, double lat, double lon);
57
58/* exit_nicely - called to cleanup after fatal error */
59void exit_nicely(void);
60
61#endif
Note: See TracBrowser for help on using the repository browser.