navit 0.5.3-trunk
Loading...
Searching...
No Matches
transform.h
Go to the documentation of this file.
1
20#ifndef NAVIT_TRANSFORM_H
21#define NAVIT_TRANSFORM_H
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26#include "coord.h"
27
28#define TRANSFORM_ERR_BUF_SPACE -1
29
30/* prototypes */
31enum attr_type;
32enum item_type;
33enum map_datum;
34enum projection;
35struct attr;
36struct attr_iter;
37struct coord;
38struct coord_geo;
39struct coord_geo_cart;
40struct map_selection;
41struct pcoord;
42struct point;
43struct transformation;
44struct transformation *transform_new(struct pcoord *center, int scale, int yaw);
45int transform_get_hog(struct transformation *this_);
46void transform_set_hog(struct transformation *this_, int hog);
47int transform_get_attr(struct transformation *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter);
48int transform_set_attr(struct transformation *this_, struct attr *attr);
52void transform_to_geo(enum projection pro, const struct coord *c, struct coord_geo *g);
53void transform_from_geo(enum projection pro, const struct coord_geo *g, struct coord *c);
54void transform_from_to_count(struct coord *cfrom, enum projection from, struct coord *cto, enum projection to,
55 int count);
56void transform_from_to(struct coord *cfrom, enum projection from, struct coord *cto, enum projection to);
57void transform_geo_to_cart(struct coord_geo *geo, navit_float a, navit_float b, struct coord_geo_cart *cart);
58void transform_cart_to_geo(struct coord_geo_cart *cart, navit_float a, navit_float b, struct coord_geo *geo);
59void transform_utm_to_geo(const double UTMEasting, const double UTMNorthing, int ZoneNumber, int NorthernHemisphere,
60 struct coord_geo *geo);
61void transform_datum(struct coord_geo *from, enum map_datum from_datum, struct coord_geo *to, enum map_datum to_datum);
62int transform_point(struct transformation *t, enum projection pro, struct coord *c, struct point *p);
63int transform_point_buf(struct transformation *t, enum projection pro, struct coord *c, struct point *p,
64 long result_size, int count, int mindist, int width, int *width_return);
65int transform_reverse(struct transformation *t, struct point *p, struct coord *c);
69struct map_selection *transform_get_selection(struct transformation *this_, enum projection pro, int order);
70struct coord *transform_center(struct transformation *this_);
71struct coord *transform_get_center(struct transformation *this_);
72void transform_set_center(struct transformation *this_, struct coord *c);
73void transform_set_yaw(struct transformation *t, int yaw);
74int transform_get_yaw(struct transformation *this_);
75void transform_set_pitch(struct transformation *this_, int pitch);
76int transform_get_pitch(struct transformation *this_);
77void transform_set_roll(struct transformation *this_, int roll);
78int transform_get_roll(struct transformation *this_);
79void transform_set_distance(struct transformation *this_, int distance);
80int transform_get_distance(struct transformation *this_);
81void transform_set_scales(struct transformation *this_, int xscale, int yscale, int wscale);
83void transform_set_screen_center(struct transformation *t, struct point *p);
84void transform_get_size(struct transformation *t, int *width, int *height);
85void transform_setup(struct transformation *t, struct pcoord *c, int scale, int yaw);
88void transform_set_scale(struct transformation *t, long scale);
90double transform_scale(int y);
91double transform_distance(enum projection pro, struct coord *c1, struct coord *c2);
92void transform_project(enum projection pro, struct coord *c, int distance, int angle, struct coord *res);
93double transform_polyline_length(enum projection pro, struct coord *c, int count);
94int transform_distance_sq(struct coord *c1, struct coord *c2);
96int transform_distance_sq_pc(struct pcoord *c1, struct pcoord *c2);
97int transform_distance_line_sq(struct coord *l0, struct coord *l1, struct coord *ref, struct coord *lpnt);
98navit_float transform_distance_line_sq_float(struct coord *l0, struct coord *l1, struct coord *ref, struct coord *lpnt);
99int transform_distance_polyline_sq(struct coord *c, int count, struct coord *ref, struct coord *lpnt, int *pos);
100int transform_douglas_peucker(struct coord *in, int count, int dist_sq, struct coord *out);
101int transform_douglas_peucker_float(struct coord *in, int count, navit_float dist_sq, struct coord *out);
102void transform_print_deg(double deg);
103int transform_get_angle_delta(struct coord *c1, struct coord *c2, int dir);
104int transform_within_border(struct transformation *this_, struct point *p, int border);
105int transform_within_dist_point(struct coord *ref, struct coord *c, int dist);
106int transform_within_dist_line(struct coord *ref, struct coord *c0, struct coord *c1, int dist);
107int transform_within_dist_polyline(struct coord *ref, struct coord *c, int count, int close, int dist);
108int transform_within_dist_polygon(struct coord *ref, struct coord *c, int count, int dist);
109int transform_within_dist_item(struct coord *ref, enum item_type type, struct coord *c, int count, int dist);
110void transform_copy(struct transformation *src, struct transformation *dst);
111void transform_destroy(struct transformation *t);
112/* end of prototypes */
113#ifdef __cplusplus
114}
115#endif
116
117#endif
attr_type
Definition attr_type_def.h:11
double navit_float
Definition coord.h:77
struct tcoord center
Definition garmin_img.c:2
unsigned short width
Definition garmin_img.c:3
char type[3]
Definition garmin_img.c:2
unsigned short height
Definition garmin_img.c:4
static double c2
Definition geod_for.c:27
static double c1
Definition geod_for.c:27
item_type
Definition item_type_def.h:8
unsigned char p[5]
Definition mg.h:2
static struct pcoord c
Definition popup.c:375
map_datum
Definition projection.h:31
projection
Definition projection.h:23
static double dist_sq(double x1, double y1, double x2, double y2)
Definition quadtree.c:61
Definition config_.c:47
Definition attr.h:138
A cartesian coordinate.
Definition coord.h:100
A WGS84 coordinate.
Definition coord.h:94
Definition coord.h:33
int y
Definition coord.h:35
Used to select data from a map.
Definition map.h:63
int order
Definition map.h:69
Definition coord.h:51
Definition point.h:23
The parameters needed to transform a map for display.
Definition transform.c:64
int order_base
Definition transform.c:91
int yaw
Definition transform.c:65
enum projection pro
Definition transform.c:87
navit_float scale
Definition transform.c:88
int transform_get_pitch(struct transformation *this_)
Definition transform.c:798
void transform_set_screen_center(struct transformation *t, struct point *p)
Definition transform.c:844
void transform_get_size(struct transformation *t, int *width, int *height)
Definition transform.c:848
enum projection transform_get_projection(struct transformation *this_)
Definition transform.c:706
navit_float transform_distance_sq_float(struct coord *c1, struct coord *c2)
Definition transform.c:1139
int transform_point(struct transformation *t, enum projection pro, struct coord *c, struct point *p)
Definition transform.c:548
void transform_setup(struct transformation *t, struct pcoord *c, int scale, int yaw)
int transform_within_dist_line(struct coord *ref, struct coord *c0, struct coord *c1, int dist)
Definition transform.c:1417
int transform_within_dist_point(struct coord *ref, struct coord *c, int dist)
Definition transform.c:1403
void transform_to_geo(enum projection pro, const struct coord *c, struct coord_geo *g)
Transform the coordinates of a geographical point from a coord representation to a geographical (lat,...
Definition transform.c:273
int transform_distance_line_sq(struct coord *l0, struct coord *l1, struct coord *ref, struct coord *lpnt)
Determines the point on a line segment that is closest to a reference point, and its distance from th...
Definition transform.c:1165
double transform_polyline_length(enum projection pro, struct coord *c, int count)
Definition transform.c:1097
int transform_douglas_peucker_float(struct coord *in, int count, navit_float dist_sq, struct coord *out)
Definition transform.c:1288
void transform_print_deg(double deg)
Definition transform.c:1312
int transform_get_distance(struct transformation *this_)
Definition transform.c:824
int transform_get_order(struct transformation *t)
Definition transform.c:953
void transform_copy(struct transformation *src, struct transformation *dst)
Definition transform.c:1498
int transform_within_dist_polyline(struct coord *ref, struct coord *c, int count, int close, int dist)
Definition transform.c:1461
void transform_from_geo(enum projection pro, const struct coord_geo *g, struct coord *c)
Transform the coordinates of a geographical point from a geographical (lat, long) representation to a...
Definition transform.c:309
void transform_set_hog(struct transformation *this_, int hog)
Definition transform.c:208
int transformation_get_order_base(struct transformation *this_)
Definition transform.c:243
int transform_point_buf(struct transformation *t, enum projection pro, struct coord *c, struct point *p, long result_size, int count, int mindist, int width, int *width_return)
Definition transform.c:553
void transform_set_pitch(struct transformation *this_, int pitch)
Definition transform.c:794
int transform_reverse(struct transformation *t, struct point *p, struct coord *c)
Definition transform.c:686
int transform_get_roll(struct transformation *this_)
Definition transform.c:811
struct transformation * transform_new(struct pcoord *center, int scale, int yaw)
Definition transform.c:190
void transform_set_order_base(struct transformation *this_, int order_base)
Definition transform.c:247
void transform_geo_to_cart(struct coord_geo *geo, navit_float a, navit_float b, struct coord_geo_cart *cart)
Transforms geodetic to Cartesian coordinates.
Definition transform.c:355
int transform_get_attr(struct transformation *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter)
Definition transform.c:217
void transform_set_yaw(struct transformation *t, int yaw)
Definition transform.c:785
void transform_set_roll(struct transformation *this_, int roll)
Definition transform.c:802
int transform_get_hog(struct transformation *this_)
Definition transform.c:204
void transform_set_scale(struct transformation *t, long scale)
Definition transform.c:947
void transform_set_distance(struct transformation *this_, int distance)
Definition transform.c:819
double transform_pixels_to_map_distance(struct transformation *transformation, int pixels)
Definition transform.c:690
int transform_douglas_peucker(struct coord *in, int count, int dist_sq, struct coord *out)
Definition transform.c:1266
int transform_get_yaw(struct transformation *this_)
Definition transform.c:790
int transform_within_border(struct transformation *this_, struct point *p, int border)
Definition transform.c:1391
int transform_get_angle_delta(struct coord *c1, struct coord *c2, int dir)
Gets the bearing from one point to another.
Definition transform.c:1373
int transform_distance_sq(struct coord *c1, struct coord *c2)
Determines the squared Mercator distance between two points.
Definition transform.c:1129
int transform_distance_polyline_sq(struct coord *c, int count, struct coord *ref, struct coord *lpnt, int *pos)
Determines the point on a polyline that is closest to a reference point, and its distance from the re...
Definition transform.c:1245
void transform_destroy(struct transformation *t)
Definition transform.c:1502
void transform_cart_to_geo(struct coord_geo_cart *cart, navit_float a, navit_float b, struct coord_geo *geo)
Transforms Cartesian to geodetic coordinates.
Definition transform.c:375
void transform_set_scales(struct transformation *this_, int xscale, int yscale, int wscale)
Definition transform.c:828
void transform_project(enum projection pro, struct coord *c, int distance, int angle, struct coord *res)
Definition transform.c:1081
void transform_set_projection(struct transformation *this_, enum projection pro)
Definition transform.c:710
void transform_setup_source_rect(struct transformation *t)
Definition transform.c:857
void transform_set_center(struct transformation *this_, struct coord *c)
Definition transform.c:780
double transform_distance(enum projection pro, struct coord *c1, struct coord *c2)
Calculates the distance between two points.
Definition transform.c:1037
void transform_from_to_count(struct coord *cfrom, enum projection from, struct coord *cto, enum projection to, int count)
Definition transform.c:324
void transform_utm_to_geo(const double UTMEasting, const double UTMNorthing, int ZoneNumber, int NorthernHemisphere, struct coord_geo *geo)
Converts UTM coords to lat/long.
Definition transform.c:398
void transform_set_screen_selection(struct transformation *t, struct map_selection *sel)
Definition transform.c:834
long transform_get_scale(struct transformation *t)
Definition transform.c:943
struct map_selection * transform_get_selection(struct transformation *this_, enum projection pro, int order)
Definition transform.c:737
struct transformation * transform_dup(struct transformation *t)
Definition transform.c:253
int transform_distance_sq_pc(struct pcoord *c1, struct pcoord *c2)
Definition transform.c:1145
navit_float transform_distance_line_sq_float(struct coord *l0, struct coord *l1, struct coord *ref, struct coord *lpnt)
Definition transform.c:1203
void transform_from_to(struct coord *cfrom, enum projection from, struct coord *cto, enum projection to)
Definition transform.c:337
int transform_within_dist_polygon(struct coord *ref, struct coord *c, int count, int dist)
Definition transform.c:1473
int transform_within_dist_item(struct coord *ref, enum item_type type, struct coord *c, int count, int dist)
Definition transform.c:1490
struct coord * transform_get_center(struct transformation *this_)
Definition transform.c:776
int transform_set_attr(struct transformation *this_, struct attr *attr)
Definition transform.c:231
struct coord * transform_center(struct transformation *this_)
Definition transform.c:771
double transform_scale(int y)
Definition transform.c:1001
void transform_datum(struct coord_geo *from, enum map_datum from_datum, struct coord_geo *to, enum map_datum to_datum)