4 http://acme.com/software/coords/
5 I (Evan Battaglia <viking@greentorch.org> have only made some small changes such as
6 renaming functions and defining LatLon and UTM structs.
8 /* coords.h - include file for coords routines
10 ** Copyright © 2001 by Jef Poskanzer <jef@acme.com>.
11 ** All rights reserved.
13 ** Redistribution and use in source and binary forms, with or without
14 ** modification, are permitted provided that the following conditions
16 ** 1. Redistributions of source code must retain the above copyright
17 ** notice, this list of conditions and the following disclaimer.
18 ** 2. Redistributions in binary form must reproduce the above copyright
19 ** notice, this list of conditions and the following disclaimer in the
20 ** documentation and/or other materials provided with the distribution.
22 ** THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
23 ** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 ** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 ** ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
26 ** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 ** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 ** OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 ** HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 ** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 ** OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 #ifndef _VIKING_COORDS_H
36 #define _VIKING_COORDS_H
54 int a_coords_utm_equal( const struct UTM *utm1, const struct UTM *utm2 );
55 void a_coords_latlon_to_utm ( const struct LatLon *latlon, struct UTM *utm );
56 void a_coords_utm_to_latlon ( const struct UTM *utm, struct LatLon *latlon );
57 double a_coords_utm_diff( const struct UTM *utm1, const struct UTM *utm2 );
58 double a_coords_latlon_diff ( const struct LatLon *ll1, const struct LatLon *ll2 );
61 * Convert a double to a string WITHOUT LOCALE.
63 * Following GPX specifications, decimal values are xsd:decimal
64 * So, they must use the period separator, not the localized one.
66 * The returned value must be freed by g_free.
68 char *a_coords_dtostr ( double d );
71 * Convert a LatLon to strings.
73 * Use the prefered representation.
75 void a_coords_latlon_to_string ( const struct LatLon *latlon, gchar **lat, gchar **lon );