summaryrefslogtreecommitdiff
path: root/tools/gpx2navit_txt/src/setwpt.c
diff options
context:
space:
mode:
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2009-07-30 20:34:23 +0000
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2009-07-30 20:34:23 +0000
commitd72782347c2ba802cd030feeb23f7eacc4ae8a23 (patch)
treea729476323d0d551c2031b3a666193923ceb08a4 /tools/gpx2navit_txt/src/setwpt.c
parentc297ef7f5928b0407ab67b9a76ccf166d0a1d3e0 (diff)
parent3b8435d744c504a88493f272068453023585837e (diff)
downloadnavit-svn-wince.tar.gz
Updated wince branch to current versionwince
git-svn-id: http://svn.code.sf.net/p/navit/code/branches/wince/navit@2430 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'tools/gpx2navit_txt/src/setwpt.c')
-rw-r--r--tools/gpx2navit_txt/src/setwpt.c71
1 files changed, 71 insertions, 0 deletions
diff --git a/tools/gpx2navit_txt/src/setwpt.c b/tools/gpx2navit_txt/src/setwpt.c
new file mode 100644
index 00000000..3fc04f71
--- /dev/null
+++ b/tools/gpx2navit_txt/src/setwpt.c
@@ -0,0 +1,71 @@
+/**
+ * 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 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU 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.
+ */
+
+#include "gpx2navit_txt.h"
+
+void setWpt(parsedata * pdata);
+
+/**
+ * save point objects in *_wpt or *_pnt file
+ */
+void setWpt( parsedata * pdata)
+{
+ double x[1], y[1], z[1];
+ x[0] = pdata->attr->lon;
+ y[0] = pdata->attr->lat;
+ z[0] = pdata->attr->ele;
+ if (pdata->prop->is3d) {
+ //nothing at the moment
+ } else {
+ //do not know if i will change something here
+ }
+ // Write attributes to file first line waypoint-info, second line coords
+ char poi_type[20]="poi_attraction";
+ if (!strcmp(pdata->attr->type,"Geocache|Traditional Cache"))
+ strcpy(poi_type,"poi_gc_tradi");
+ if (!strcmp(pdata->attr->type,"Geocache|Multi-cache"))
+ strcpy(poi_type,"poi_gc_multi");
+ if (!strcmp(pdata->attr->type,"Geocache|Unknown Cache"))
+ strcpy(poi_type,"poi_gc_mystery");
+ if (!strcmp(pdata->attr->type,"Geocache|Event Cache"))
+ strcpy(poi_type,"poi_gc_event");
+ if (!strcmp(pdata->attr->type,"Geocache")) //for OC
+ strcpy(poi_type,"poi_gc_tradi");
+ if (!strcmp(pdata->attr->type,"Waypoint|Parking Area"))
+ strcpy(poi_type,"poi_car_parking");
+ if (!strcmp(pdata->attr->type,"Waypoint|Question to Answer"))
+ strcpy(poi_type,"poi_gc_question");
+ if (!strcmp(pdata->attr->type,"Waypoint|Reference Point"))
+ strcpy(poi_type,"poi_gc_reference");
+ if (!strcmp(pdata->attr->type,"Waypoint|Stages of a Multicache"))
+ strcpy(poi_type,"poi_gc_stages");
+
+ //generate the file
+ fprintf(pdata->fp,"type=%s label=\"%s\" description=\"%s\" gc_type=\"%s\"\n",
+ poi_type,pdata->attr->name,pdata->attr->desc,pdata->attr->type);
+ fprintf(pdata->fp,"%3.6f %4.6f\n",x[0],y[0]);
+
+ //writeWptAttribute(hDBF, pdata, iShape);
+ if (!strcmp(pdata->current->name, "wpt")) {
+ pdata->prop->stats->wptpoints++;
+ }
+ return;
+}
+
+