Merge with modular_map
[navit-package] / src / coord.h
1 #ifndef COORD_H
2 #define COORD_H
3
4 /*! A integer mercator coordinate */
5 struct coord {
6         int x; /*!< X-Value */
7         int y; /*!< Y-Value */
8 };
9
10 struct coord_rect {
11         struct coord lu;
12         struct coord rl;
13 };
14
15 //! A double mercator coordinate
16 struct coord_d {
17         double x; /*!< X-Value */
18         double y; /*!< Y-Value */
19 };
20
21 //! A WGS84 coordinate
22 struct coord_geo {
23         double lng; /*!< Longitude */
24         double lat; /*!< Latitude */
25 };
26
27 enum projection;
28
29 struct coord * coord_get(unsigned char **p);
30 struct coord * coord_new(int x, int y);
31 void coord_destroy(struct coord *c);
32 int coord_parse(const char *c_str, enum projection pro, struct coord *c_ret);
33 struct coord_rect * coord_rect_new(struct coord *lu, struct coord *rl);
34 void coord_rect_destroy(struct coord_rect *r);
35 int coord_rect_overlap(struct coord_rect *r1, struct coord_rect *r2);
36 int coord_rect_contains(struct coord_rect *r, struct coord *c);
37 void coord_rect_extend(struct coord_rect *r, struct coord *c);
38
39
40 #endif