navit  0.5.3-trunk
coord.h File Reference
#include <stdio.h>
#include "config.h"
#include "projection.h"

Go to the source code of this file.

Data Structures

struct  coord
 
struct  lcoord
 An integer mercator coordinate packed with a text label. More...
 
struct  pcoord
 
struct  coord_rect
 
struct  coord_d
 A double mercator coordinate. More...
 
struct  coord_geo
 A WGS84 coordinate. More...
 
struct  coord_geo_cart
 A cartesian coordinate. More...
 

Macros

#define coord_is_equal(a, b)   ((a).x==(b).x && (a).y==(b).y)
 
#define navit_sin(x)   sin(x)
 
#define navit_cos(x)   cos(x)
 
#define navit_tan(x)   tan(x)
 
#define navit_atan(x)   atan(x)
 
#define navit_acos(x)   acos(x)
 
#define navit_asin(x)   asin(x)
 
#define navit_sqrt(x)   sqrt(x)
 

Typedefs

typedef double navit_float
 

Enumerations

enum  coord_format {
  DEGREES_DECIMAL_ABSOLUTE , DEGREES_DECIMAL , DEGREES_MINUTES , DEGREES_MINUTES_SECONDS ,
  DEGREES_MINUTES_SECONDS_BRIEF
}
 

Functions

struct coordcoord_get (unsigned char **p)
 
struct coordcoord_new (int x, int y)
 
struct coordcoord_new_from_attrs (struct attr *parent, struct attr **attrs)
 
void coord_destroy (struct coord *c)
 
int coord_parse (const char *c_str, enum projection pro, struct coord *c_ret)
 
int pcoord_parse (const char *c_str, enum projection pro, struct pcoord *c_ret)
 
void coord_print (enum projection pro, struct coord *c, FILE *out)
 
struct coord_rectcoord_rect_new (struct coord *lu, struct coord *rl)
 
void coord_rect_destroy (struct coord_rect *r)
 
int coord_rect_overlap (struct coord_rect *r1, struct coord_rect *r2)
 
int coord_rect_contains (struct coord_rect *r, struct coord *c)
 
void coord_rect_extend (struct coord_rect *r, struct coord *c)
 
void coord_format_with_sep (float lat, float lng, enum coord_format fmt, char *buffer, int size, const char *sep)
 Converts a lat/lon into a text formatted text string. More...
 
void coord_format (float lat, float lng, enum coord_format fmt, char *buffer, int size)
 Converts a lat/lon into a text formatted text string. More...
 
void coord_geo_format_short (const struct coord_geo *gc, char *buffer, int size, char *sep)
 Converts a WGS84 coordinate pair to its string representation. More...
 
void pcoord_format_degree_short (const struct pcoord *pc, char *buffer, int size, char *sep)
 Converts an integer mercator coordinate pair to its string representation. More...
 
void pcoord_format_absolute (const struct pcoord *pc, char *buffer, int size, char *sep)
 Converts an integer mercator coordinate pair to its string representation. More...
 
char * coordinates_geo (const struct coord_geo *gc, char sep)
 
unsigned int coord_hash (const void *key)
 Generate a hash from a struct coord pointed by key. More...
 
int coord_equal (const void *a, const void *b)
 Test if two struct coord structures are equal. More...
 

Macro Definition Documentation

◆ coord_is_equal

#define coord_is_equal (   a,
 
)    ((a).x==(b).x && (a).y==(b).y)

Navit, a modular navigation system. Copyright (C) 2005-2008 Navit Team

This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License version 2 as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.

You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

◆ navit_acos

#define navit_acos (   x)    acos(x)

◆ navit_asin

#define navit_asin (   x)    asin(x)

◆ navit_atan

#define navit_atan (   x)    atan(x)

◆ navit_cos

#define navit_cos (   x)    cos(x)

◆ navit_sin

#define navit_sin (   x)    sin(x)

◆ navit_sqrt

#define navit_sqrt (   x)    sqrt(x)

◆ navit_tan

#define navit_tan (   x)    tan(x)

Typedef Documentation

◆ navit_float

typedef double navit_float

Enumeration Type Documentation

◆ coord_format

An enumeration of formats for printing geographic coordinates in.

Enumerator
DEGREES_DECIMAL_ABSOLUTE 

Degrees with absolute decimal places (positive or negative) ie -20.500000 -110.500000

DEGREES_DECIMAL 

Degrees with decimal places (positive with heading) ie 20.500000°N 110.500000°E

DEGREES_MINUTES 

Degrees and minutes. ie 20°30.0000' N 110°30.0000' E

DEGREES_MINUTES_SECONDS 

Degrees, minutes and seconds. ie 20°30'30.00" N 110°30'30.00" E

DEGREES_MINUTES_SECONDS_BRIEF 

Degrees, minutes and seconds, brief ie 20°30'30"N 110°30'30"E

Function Documentation

◆ coordinates_geo()

char* coordinates_geo ( const struct coord_geo gc,
char  sep 
)