double lat; /*!< Latitude */
};
+//! A cartesian coordinate
+struct coord_geo_cart {
+ double x; /*!< X-Value */
+ double y; /*!< Y-Value */
+ double z; /*!< Z-Value */
+};
+
enum projection;
struct coord * coord_get(unsigned char **p);
projection_none, projection_mg, projection_garmin
};
+enum map_datum {
+ map_datum_none, map_datum_wgs84, map_datum_dhdn
+};
+
enum projection projection_from_name(const char *name);
char * projection_to_name(enum projection proj);
transform_from_geo(to, &g, cto);
}
+void
+transform_geo_to_cart(struct coord_geo *geo, double a, double b, struct coord_geo_cart *cart)
+{
+ double n,ee=1-b*b/(a*a);
+ n = a/sqrt(1-ee*sin(geo->lat)*sin(geo->lat));
+ cart->x=n*cos(geo->lat)*cos(geo->lng);
+ cart->y=n*cos(geo->lat)*sin(geo->lng);
+ cart->z=n*(1-ee)*sin(geo->lat);
+}
+
+void
+transform_cart_to_geo(struct coord_geo_cart *cart, double a, double b, struct coord_geo *geo)
+{
+ double lat,lati,n,ee=1-b*b/(a*a), lng = atan(cart->y/cart->x);
+
+ lat = atan(cart->z / sqrt((cart->x * cart->x) + (cart->y * cart->y)));
+ do
+ {
+ lati = lat;
+
+ n = a / sqrt(1-ee*sin(lat)*sin(lat));
+ lat = atan((cart->z + ee * n * sin(lat)) / sqrt(cart->x * cart->x + cart->y * cart->y));
+ }
+ while (fabs(lat - lati) >= 0.000000000000001);
+
+ geo->lng=lng/M_PI*180;
+ geo->lat=lat/M_PI*180;
+}
+
+
+void
+transform_datum(struct coord_geo *from, enum map_datum from_datum, struct coord_geo *to, enum map_datum to_datum)
+{
+}
+
int
transform(struct transformation *t, enum projection pro, struct coord *c, struct point *p, int count, int unique)
{