View | Details | Raw Unified | Return to bug 248944
Collapse All | Expand All

(-)Makefile (-4 / +3 lines)
Lines 2-9 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	foxtrotgps
4
PORTNAME=	foxtrotgps
5
PORTVERSION=	1.2.0
5
PORTVERSION=	1.2.2
6
PORTREVISION=	6
7
CATEGORIES=	astro geography
6
CATEGORIES=	astro geography
8
MASTER_SITES=	http://www.foxtrotgps.org/releases/
7
MASTER_SITES=	http://www.foxtrotgps.org/releases/
9
8
Lines 33-41 Link Here
33
		contrib/poi2osm \
32
		contrib/poi2osm \
34
		contrib/osb2foxtrot \
33
		contrib/osb2foxtrot \
35
34
36
USE_GNOME=	gtk20 gconf2 libxml2 intltool libglade2
35
USE_GNOME=	gtk20 gconf2 libxml2 intltool libglade2 cairo
37
INSTALLS_ICONS=	yes
36
INSTALLS_ICONS=	yes
38
37
39
GCONF_SCHEMAS=	apps_foxtrotgps.schemas
38
GLIB_SCHEMAS=	org.foxtrotgps.gschema.xml
40
39
41
.include <bsd.port.mk>
40
.include <bsd.port.mk>
(-)distinfo (-2 / +3 lines)
Lines 1-2 Link Here
1
SHA256 (foxtrotgps-1.2.0.tar.gz) = aa1ffbbf299b7b0f305a0bdbe395266e18305bb9449d621fb88bf8760b55505a
1
TIMESTAMP = 1598361882
2
SIZE (foxtrotgps-1.2.0.tar.gz) = 2115329
2
SHA256 (foxtrotgps-1.2.2.tar.gz) = 1773d591ec5cc57a0695b9f9d909aa0b37f6fa577b1eb1753b3eb8a275e1290a
3
SIZE (foxtrotgps-1.2.2.tar.gz) = 2165187
(-)files/patch-src_gps__functions.c (-9 lines)
Lines 12-26 Link Here
12
 
12
 
13
 static gboolean
13
 static gboolean
14
 cb_gpsd_data(GIOChannel *src, GIOCondition condition, gpointer data)
14
 cb_gpsd_data(GIOChannel *src, GIOCondition condition, gpointer data)
15
@@ -744,7 +749,7 @@ cb_gpsd_data(GIOChannel *src, GIOCondition condition, 
16
         if (!libgps_initialized)
17
             return FALSE;
18
 
19
-	ret = gps_read(&libgps_gpsdata);
20
+	ret = gps_read(&libgps_gpsdata, NULL, 0);
21
         /* Note that gps_read() will never actually return 0
22
            (zero-length reads are converted internally to a -1 return,
23
             since they mean that the connection to the daemon has closed),
24
@@ -755,7 +760,7 @@ cb_gpsd_data(GIOChannel *src, GIOCondition condition, 
15
@@ -755,7 +760,7 @@ cb_gpsd_data(GIOChannel *src, GIOCondition condition, 
25
 	{
16
 	{
26
 		gpsdata->satellites_used = libgps_gpsdata.satellites_used;
17
 		gpsdata->satellites_used = libgps_gpsdata.satellites_used;
(-)files/patch-src_tracks.c (-123 lines)
Lines 1-123 Link Here
1
--- src/tracks.c.orig	2014-10-24 04:57:10 UTC
2
+++ src/tracks.c
3
@@ -41,8 +41,10 @@ bbox_t		get_track_bbox(GSList *track);
4
 GSList *	load_log_file_into_list(char *file);
5
 GSList *	load_gpx_file_into_list(char *file);
6
 GSList * load_ols_XML_file_into_list(char *file);
7
+GSList * load_kml_XML_file_into_list(char *file);
8
 GSList * parse_gpx_nodes(xmlNode *node);
9
 GSList * parse_ols_XML_nodes(xmlNode *node);
10
+GSList * parse_kml_XML_nodes(xmlNode *node);
11
 
12
 void * fetch_track_thread(void *ptr);
13
 void * fetch_openrouteservice_track_thread(void *ptr);
14
@@ -662,6 +664,30 @@ load_ols_XML_string_into_list(char *ols_
15
 }
16
 
17
 GSList *
18
+load_kml_XML_string_into_list(char *kml_string)
19
+{
20
+	GSList *list = NULL;
21
+	xmlDoc *doc = NULL;
22
+	xmlNode *root_element = NULL;
23
+
24
+	if(!kml_string) return NULL;
25
+
26
+	LIBXML_TEST_VERSION
27
+
28
+	doc = xmlReadMemory(kml_string, strlen(kml_string), "noname.xml", NULL, 0);
29
+
30
+	if (doc == NULL) {
31
+		fprintf (stderr, _("Failed to parse document\n"));
32
+	} else {
33
+		root_element = xmlDocGetRootElement(doc);
34
+		list = parse_kml_XML_nodes(root_element);
35
+		xmlFreeDoc(doc);
36
+	}
37
+
38
+	return list;
39
+}
40
+
41
+GSList *
42
 parse_gpx_nodes(xmlNode *node)
43
 {
44
 	xmlNode *cur_node = NULL;
45
@@ -754,6 +780,60 @@ parse_ols_XML_nodes(xmlNode *node)
46
 	return list;
47
 }
48
 
49
+GSList *
50
+parse_kml_XML_nodes(xmlNode *node)
51
+{
52
+	xmlNode *cur_node = NULL;
53
+	GSList *list = NULL;
54
+
55
+	for (cur_node = node; cur_node; cur_node = cur_node->next)
56
+	{
57
+		if (xmlStrEqual(cur_node->name, BAD_CAST "Placemark"))
58
+		{
59
+			xmlNode *geometry_node = cur_node->children;
60
+			while (geometry_node != NULL)
61
+			{
62
+				if (xmlStrEqual(geometry_node->name, BAD_CAST "LineString"))
63
+				{
64
+					xmlNode *inner_cur_node = geometry_node->children;
65
+					while (inner_cur_node != NULL)
66
+					{
67
+						if (xmlStrEqual(inner_cur_node->name, BAD_CAST "coordinates")) {
68
+							char** lonlatlist;
69
+							lonlatlist = g_strsplit(xmlNodeGetContent(inner_cur_node), "\n", -1);
70
+							for(unsigned int i = 0; lonlatlist[i]; i++){
71
+								g_strchug(lonlatlist[i]);
72
+								g_strchomp(lonlatlist[i]);
73
+								char** lonlat = g_strsplit(lonlatlist[i], ",", 2);
74
+								if (lonlat[0])
75
+								{
76
+									double lat, lon;
77
+									lon = atof(lonlat[0]);
78
+									if (lonlat[1])
79
+									{
80
+										trackpoint_t *tp = g_new0(trackpoint_t,1);
81
+										lat = atof(lonlat[1]);
82
+										tp->lat = deg2rad(lat);
83
+										tp->lon = deg2rad(lon);
84
+										list = g_slist_append(list, tp);
85
+									}
86
+								}
87
+								g_strfreev (lonlat);
88
+							}
89
+							g_strfreev (lonlatlist);
90
+						}
91
+						inner_cur_node = inner_cur_node->next;
92
+					}
93
+				}
94
+				geometry_node = geometry_node->next;
95
+			}
96
+		}
97
+		list = g_slist_concat(list, parse_kml_XML_nodes(cur_node->children));
98
+	}
99
+
100
+	return list;
101
+}
102
+
103
 
104
 void
105
 fetch_track(GtkWidget *widget, char *service, char *start, char *end)
106
@@ -796,7 +876,7 @@ void fetch_yournavigation_track(GtkWidge
107
 	dialog10 = widget;
108
 	printf("%s(): %s, %s\n",__PRETTY_FUNCTION__, start, end);
109
 	
110
-	url = g_strdup_printf("http://www.yournavigation.org/api/dev/gosmore.php?format=gpx&flat=%s&flon=%s&tlat=%s&tlon=%s&v=motorcar&fast=1&layer=mapnik",startlatstr, startlonstr, endlatstr, endlonstr);
111
+	url = g_strdup_printf("http://www.yournavigation.org/api/1.0/gosmore.php?format=kml&flat=%s&flon=%s&tlat=%s&tlon=%s&v=motorcar&fast=1&layer=mapnik",startlatstr, startlonstr, endlatstr, endlonstr);
112
 	if (!g_thread_create(&fetch_track_thread, (void *)url, FALSE, NULL) != 0)
113
 		g_warning("### can't create route thread\n");
114
 }
115
@@ -1002,7 +1082,7 @@ fetch_track_thread(void *ptr)
116
 
117
 	printf("HTTP-GET: size: %d, statuscode %d \n", (int)reply->size, (int)reply->status_code);
118
 
119
-	loaded_track = load_gpx_string_into_list(reply->data);
120
+	loaded_track = load_kml_XML_string_into_list(reply->data);
121
 	process_fetched_track(reply, true);
122
 		
123
 	return NULL;
(-)pkg-plist (+2 lines)
Lines 50-52 Link Here
50
share/pixmaps/foxtrotgps-poi.png
50
share/pixmaps/foxtrotgps-poi.png
51
share/pixmaps/foxtrotgps-wp.png
51
share/pixmaps/foxtrotgps-wp.png
52
share/pixmaps/foxtrotgps.png
52
share/pixmaps/foxtrotgps.png
53
share/GConf/gsettings/org.foxtrotgps.convert
54

Return to bug 248944