2 * This file is part of mapper
4 * Copyright (C) 2007 Kaj-Michael Lang
5 * Copyright (C) 2006-2007 John Costigan.
7 * POI and GPS-Info code originally written by Cezary Jackiewicz.
9 * Default map data provided by http://www.openstreetmap.org/
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License along
22 * with this program; if not, write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
35 gps=g_slice_new0(GpsData);
37 gps_integerize_data(gps);
42 * Convert the float lat/lon/speed/heading data into integer units.
45 gps_integerize_data(GpsData *gps)
49 tmp=(gps->heading*(1.f/180.f))*G_PI;
50 latlon2unit(gps->lat, gps->lon, gps->unitx, gps->unity);
51 gps->vel_offsetx=(gint)(floor(gps->speed*sin(tmp)+0.5f));
52 gps->vel_offsety=-(gint)(floor(gps->speed*cos(tmp)+0.5f));