+/**
+ * a_babel_convert_from_url_or_shell:
+ * @vt: The #VikTrwLayer where to insert the collected data
+ * @url: the URL to fetch
+ * @cb: Optional callback function. Same usage as in a_babel_convert().
+ * @user_data: passed along to cb
+ * @options: download options. Maybe NULL.
+ *
+ * Download the file pointed by the URL and optionally uses GPSBabel to convert from input_file_type.
+ * If input_file_type is %NULL, doesn't use GPSBabel. Input must be GPX.
+ *
+ * Returns: %TRUE on successful invocation of GPSBabel or read of the GPX
+ *
+ */
+gboolean a_babel_convert_from_url_or_shell ( VikTrwLayer *vt, const char *input, const char *input_type, BabelStatusFunc cb, gpointer user_data, DownloadMapOptions *options )
+{
+
+ /* Check nature of input */
+ gboolean isUrl = FALSE;
+ int i = 0;
+ for (i = 0 ; PROTOS[i] != NULL ; i++)
+ {
+ const gchar *proto = PROTOS[i];
+ if (strncmp (input, proto, strlen(proto)) == 0)
+ {
+ /* Procotol matches: save result */
+ isUrl = TRUE;
+ }
+ }
+
+ /* Do the job */
+ if (isUrl)
+ return a_babel_convert_from_url (vt, input, input_type, cb, user_data, options);
+ else
+ return a_babel_convert_from_shellcommand (vt, input, input_type, cb, user_data, options);
+}
+