QGIS API Documentation 4.0.0-Norrköping (1ddcee3d0e4)
Loading...
Searching...
No Matches
qgsbabelformatregistry.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgsbabelformatregistry.cpp
3 -------------------
4 begin : July 2021
5 copyright : (C) 2021 by Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7***************************************************************************/
8
9/***************************************************************************
10 * *
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. *
15 * *
16 ***************************************************************************/
17
19
20#include "qgsbabelformat.h"
21#include "qgsbabelgpsdevice.h"
22#include "qgsexception.h"
23#include "qgslogger.h"
24
25#include <QRegularExpression>
26#include <QString>
27
28using namespace Qt::StringLiterals;
29
31
33
35
37
39
41
43{
44 //
45 // this list is automatically generated by scripts/dump_babel_formats.py
46 //
47 mImporters[u"alantrl"_s] = new QgsBabelSimpleImportFormat( u"alantrl"_s, u"Alan Map500 tracklogs (.trl)"_s, Qgis::BabelFormatCapability::Tracks, { u"trl"_s } );
48 mImporters[u"alanwpr"_s]
49 = new QgsBabelSimpleImportFormat( u"alanwpr"_s, u"Alan Map500 waypoints and routes (.wpr)"_s, Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Routes, { u"wpr"_s } );
50 mImporters[u"an1"_s] = new QgsBabelSimpleImportFormat( u"an1"_s, u"DeLorme .an1 (drawing) file"_s, Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Routes, { u"an1"_s } );
51 mImporters[u"arc"_s] = new QgsBabelSimpleImportFormat( u"arc"_s, u"GPSBabel arc filter file"_s, Qgis::BabelFormatCapability::Waypoints, { u"txt"_s } );
52 mImporters[u"bcr"_s] = new QgsBabelSimpleImportFormat( u"bcr"_s, u"Motorrad Routenplaner (Map&Guide) .bcr files"_s, Qgis::BabelFormatCapability::Routes, { u"bcr"_s } );
53 mImporters[u"bushnell"_s] = new QgsBabelSimpleImportFormat( u"bushnell"_s, u"Bushnell GPS Waypoint file"_s, Qgis::BabelFormatCapability::Waypoints, { u"wpt"_s } );
54 mImporters[u"bushnell_trl"_s] = new QgsBabelSimpleImportFormat( u"bushnell_trl"_s, u"Bushnell GPS Trail file"_s, Qgis::BabelFormatCapability::Tracks, { u"trl"_s } );
55 mImporters[u"cambridge"_s] = new QgsBabelSimpleImportFormat( u"cambridge"_s, u"Cambridge/Winpilot glider software"_s, Qgis::BabelFormatCapability::Waypoints, { u"dat"_s } );
56 mImporters[u"compegps"_s]
58 mImporters[u"cst"_s]
60 mImporters[u"csv"_s] = new QgsBabelSimpleImportFormat( u"csv"_s, u"Comma separated values"_s, Qgis::BabelFormatCapability::Waypoints, {} );
61 mImporters[u"cup"_s] = new QgsBabelSimpleImportFormat( u"cup"_s, u"See You flight analysis data"_s, Qgis::BabelFormatCapability::Waypoints, { u"cup"_s } );
62 mImporters[u"destinator_itn"_s] = new QgsBabelSimpleImportFormat( u"destinator_itn"_s, u"Destinator Itineraries (.dat)"_s, Qgis::BabelFormatCapability::Routes, { u"dat"_s } );
63 mImporters[u"destinator_poi"_s] = new QgsBabelSimpleImportFormat( u"destinator_poi"_s, u"Destinator Points of Interest (.dat)"_s, Qgis::BabelFormatCapability::Waypoints, { u"dat"_s } );
64 mImporters[u"destinator_trl"_s] = new QgsBabelSimpleImportFormat( u"destinator_trl"_s, u"Destinator TrackLogs (.dat)"_s, Qgis::BabelFormatCapability::Tracks, { u"dat"_s } );
65 mImporters[u"dmtlog"_s] = new QgsBabelSimpleImportFormat( u"dmtlog"_s, u"TrackLogs digital mapping (.trl)"_s, Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Tracks, { u"trl"_s } );
66 mImporters[u"dna"_s] = new QgsBabelSimpleImportFormat( u"dna"_s, u"Navitrak DNA marker format"_s, Qgis::BabelFormatCapability::Waypoints, { u"dna"_s } );
67 mImporters[u"easygps"_s] = new QgsBabelSimpleImportFormat( u"easygps"_s, u"EasyGPS binary format"_s, Qgis::BabelFormatCapability::Waypoints, { u"loc"_s } );
68 mImporters[u"energympro"_s] = new QgsBabelSimpleImportFormat( u"energympro"_s, u"Energympro GPS training watch"_s, Qgis::BabelFormatCapability::Tracks, { u"cpo"_s } );
69 mImporters[u"enigma"_s] = new QgsBabelSimpleImportFormat( u"enigma"_s, u"Enigma binary waypoint file (.ert)"_s, Qgis::BabelFormatCapability::Routes, { u"ert"_s } );
70 mImporters[u"exif"_s] = new QgsBabelSimpleImportFormat( u"exif"_s, u"Embedded Exif-GPS data (.jpg)"_s, Qgis::BabelFormatCapability::Waypoints, { u"jpg"_s } );
71 mImporters[u"f90g"_s] = new QgsBabelSimpleImportFormat( u"f90g"_s, u"F90G Automobile DVR GPS log file"_s, Qgis::BabelFormatCapability::Tracks, { u"map"_s } );
72 mImporters[u"flysight"_s] = new QgsBabelSimpleImportFormat( u"flysight"_s, u"FlySight GPS File"_s, Qgis::BabelFormatCapability::Waypoints, { u"csv"_s } );
73 mImporters[u"fugawi"_s] = new QgsBabelSimpleImportFormat( u"fugawi"_s, u"Fugawi"_s, Qgis::BabelFormatCapability::Waypoints, { u"txt"_s } );
74 mImporters[u"g7towin"_s]
76 mImporters[u"garmin301"_s] = new QgsBabelSimpleImportFormat( u"garmin301"_s, u"Garmin 301 Custom position and heartrate"_s, Qgis::BabelFormatCapability::Waypoints, {} );
77 mImporters[u"garmin_fit"_s] = new QgsBabelSimpleImportFormat( u"garmin_fit"_s, u"Flexible and Interoperable Data Transfer (FIT) Activity file"_s, Qgis::BabelFormatCapability::Tracks, { u"fit"_s } );
78 mImporters[u"garmin_g1000"_s] = new QgsBabelSimpleImportFormat( u"garmin_g1000"_s, u"Garmin G1000 datalog input filter file"_s, Qgis::BabelFormatCapability::Tracks, { u"csv"_s } );
79 mImporters[u"garmin_gpi"_s] = new QgsBabelSimpleImportFormat( u"garmin_gpi"_s, u"Garmin Points of Interest (.gpi)"_s, Qgis::BabelFormatCapability::Waypoints, { u"gpi"_s } );
80 mImporters[u"garmin_poi"_s] = new QgsBabelSimpleImportFormat( u"garmin_poi"_s, u"Garmin POI database"_s, Qgis::BabelFormatCapability::Waypoints, {} );
81 mImporters[u"garmin_txt"_s]
82 = new QgsBabelSimpleImportFormat( u"garmin_txt"_s, u"Garmin MapSource - txt (tab delimited)"_s, Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Routes | Qgis::BabelFormatCapability::Tracks, { u"txt"_s } );
83 mImporters[u"garmin_xt"_s] = new QgsBabelSimpleImportFormat( u"garmin_xt"_s, u"Mobile Garmin XT Track files"_s, Qgis::BabelFormatCapability::Tracks, {} );
84 mImporters[u"gdb"_s]
86 mImporters[u"geo"_s] = new QgsBabelSimpleImportFormat( u"geo"_s, u"Geocaching.com .loc"_s, Qgis::BabelFormatCapability::Waypoints, { u"loc"_s } );
87 mImporters[u"geojson"_s]
89 mImporters[u"geonet"_s] = new QgsBabelSimpleImportFormat( u"geonet"_s, u"GEOnet Names Server (GNS)"_s, Qgis::BabelFormatCapability::Waypoints, { u"txt"_s } );
90 mImporters[u"ggv_bin"_s] = new QgsBabelSimpleImportFormat( u"ggv_bin"_s, u"Geogrid-Viewer binary overlay file (.ovl)"_s, Qgis::BabelFormatCapability::Tracks, { u"ovl"_s } );
91 mImporters[u"ggv_log"_s] = new QgsBabelSimpleImportFormat( u"ggv_log"_s, u"Geogrid-Viewer tracklogs (.log)"_s, Qgis::BabelFormatCapability::Tracks, { u"log"_s } );
92 mImporters[u"ggv_ovl"_s]
93 = new QgsBabelSimpleImportFormat( u"ggv_ovl"_s, u"Geogrid-Viewer ascii overlay file (.ovl)"_s, Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Routes | Qgis::BabelFormatCapability::Tracks, { u"ovl"_s } );
94 mImporters[u"glogbook"_s] = new QgsBabelSimpleImportFormat( u"glogbook"_s, u"Garmin Logbook XML"_s, Qgis::BabelFormatCapability::Tracks, { u"xml"_s } );
95 mImporters[u"gnav_trl"_s] = new QgsBabelSimpleImportFormat( u"gnav_trl"_s, u"Google Navigator Tracklines (.trl)"_s, Qgis::BabelFormatCapability::Tracks, { u"trl"_s } );
96 mImporters[u"googledir"_s] = new QgsBabelSimpleImportFormat( u"googledir"_s, u"Google Directions XML"_s, Qgis::BabelFormatCapability::Tracks, { u"xml"_s } );
97 mImporters[u"gopal"_s] = new QgsBabelSimpleImportFormat( u"gopal"_s, u"GoPal GPS track log (.trk)"_s, Qgis::BabelFormatCapability::Tracks, { u"trk"_s } );
98 mImporters[u"gpl"_s] = new QgsBabelSimpleImportFormat( u"gpl"_s, u"DeLorme GPL"_s, Qgis::BabelFormatCapability::Tracks, { u"gpl"_s } );
99 mImporters[u"gpsdrive"_s] = new QgsBabelSimpleImportFormat( u"gpsdrive"_s, u"GpsDrive Format"_s, Qgis::BabelFormatCapability::Waypoints, {} );
100 mImporters[u"gpsdrivetrack"_s] = new QgsBabelSimpleImportFormat( u"gpsdrivetrack"_s, u"GpsDrive Format for Tracks"_s, Qgis::BabelFormatCapability::Waypoints, {} );
101 mImporters[u"gpsman"_s] = new QgsBabelSimpleImportFormat( u"gpsman"_s, u"GPSman"_s, Qgis::BabelFormatCapability::Waypoints, {} );
102 mImporters[u"gpsutil"_s] = new QgsBabelSimpleImportFormat( u"gpsutil"_s, u"gpsutil"_s, Qgis::BabelFormatCapability::Waypoints, {} );
103 mImporters[u"gpx"_s]
105 mImporters[u"gtm"_s]
107 mImporters[u"gtrnctr"_s]
108 = new QgsBabelSimpleImportFormat( u"gtrnctr"_s, u"Garmin Training Center (.tcx/.crs/.hst/.xml)"_s, Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Tracks, { u"tcx"_s, u"crs"_s, u"hst"_s, u"xml"_s } );
109 mImporters[u"hiketech"_s] = new QgsBabelSimpleImportFormat( u"hiketech"_s, u"HikeTech"_s, Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Tracks, { u"gps"_s } );
110 mImporters[u"holux"_s] = new QgsBabelSimpleImportFormat( u"holux"_s, u"Holux (gm-100) .wpo Format"_s, Qgis::BabelFormatCapability::Waypoints, { u"wpo"_s } );
111 mImporters[u"humminbird"_s]
112 = new QgsBabelSimpleImportFormat( u"humminbird"_s, u"Humminbird waypoints and routes (.hwr)"_s, Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Routes | Qgis::BabelFormatCapability::Tracks, { u"hwr"_s } );
113 mImporters[u"humminbird_ht"_s]
115 mImporters[u"iblue747"_s] = new QgsBabelSimpleImportFormat( u"iblue747"_s, u"Data Logger iBlue747 csv"_s, Qgis::BabelFormatCapability::Tracks, { u"csv"_s } );
116 mImporters[u"iblue757"_s] = new QgsBabelSimpleImportFormat( u"iblue757"_s, u"Data Logger iBlue757 csv"_s, Qgis::BabelFormatCapability::Tracks, { u"csv"_s } );
117 mImporters[u"igc"_s] = new QgsBabelSimpleImportFormat( u"igc"_s, u"FAI/IGC Flight Recorder Data Format"_s, Qgis::BabelFormatCapability::Routes | Qgis::BabelFormatCapability::Tracks, {} );
118 mImporters[u"ignrando"_s] = new QgsBabelSimpleImportFormat( u"ignrando"_s, u"IGN Rando track files"_s, Qgis::BabelFormatCapability::Tracks, { u"rdn"_s } );
119 mImporters[u"igo2008_poi"_s] = new QgsBabelSimpleImportFormat( u"igo2008_poi"_s, u"iGO2008 points of interest (.upoi)"_s, Qgis::BabelFormatCapability::Waypoints, { u"upoi"_s } );
120 mImporters[u"igo8"_s] = new QgsBabelSimpleImportFormat( u"igo8"_s, u"IGO8 .trk"_s, Qgis::BabelFormatCapability::Tracks, { u"trk"_s } );
121 mImporters[u"igoprimo_poi"_s] = new QgsBabelSimpleImportFormat( u"igoprimo_poi"_s, u"iGo Primo points of interest (.upoi)"_s, Qgis::BabelFormatCapability::Waypoints, { u"upoi"_s } );
122 mImporters[u"ik3d"_s] = new QgsBabelSimpleImportFormat( u"ik3d"_s, u"MagicMaps IK3D project file (.ikt)"_s, Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Tracks, { u"ikt"_s } );
123 mImporters[u"itracku-bin"_s]
124 = new QgsBabelSimpleImportFormat( u"itracku-bin"_s, u"XAiOX iTrackU Logger Binary File Format"_s, Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Tracks, { u"bin"_s } );
125 mImporters[u"jogmap"_s] = new QgsBabelSimpleImportFormat( u"jogmap"_s, u"Jogmap.de XML format"_s, Qgis::BabelFormatCapability::Tracks, { u"xml"_s } );
126 mImporters[u"jtr"_s] = new QgsBabelSimpleImportFormat( u"jtr"_s, u"Jelbert GeoTagger data file"_s, Qgis::BabelFormatCapability::Tracks, { u"jtr"_s } );
127 mImporters[u"kml"_s]
128 = new QgsBabelSimpleImportFormat( u"kml"_s, u"Google Earth (Keyhole) Markup Language"_s, Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Routes | Qgis::BabelFormatCapability::Tracks, { u"kml"_s } );
129 mImporters[u"kompass_tk"_s] = new QgsBabelSimpleImportFormat( u"kompass_tk"_s, u"Kompass (DAV) Track (.tk)"_s, Qgis::BabelFormatCapability::Tracks, { u"wp"_s } );
130 mImporters[u"kompass_wp"_s] = new QgsBabelSimpleImportFormat( u"kompass_wp"_s, u"Kompass (DAV) Waypoints (.wp)"_s, Qgis::BabelFormatCapability::Waypoints, { u"wp"_s } );
131 mImporters[u"land_air_sea"_s] = new QgsBabelSimpleImportFormat( u"land_air_sea"_s, u"GPS Tracking Key Pro text"_s, Qgis::BabelFormatCapability::Tracks, { u"txt"_s } );
132 mImporters[u"lmx"_s] = new QgsBabelSimpleImportFormat( u"lmx"_s, u"Nokia Landmark Exchange"_s, Qgis::BabelFormatCapability::Waypoints, {} );
133 mImporters[u"lowranceusr"_s]
135 mImporters[u"m241-bin"_s]
136 = new QgsBabelSimpleImportFormat( u"m241-bin"_s, u"Holux M-241 (MTK based) Binary File Format"_s, Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Tracks, { u"bin"_s } );
137 mImporters[u"magellan"_s]
139 mImporters[u"magellanx"_s]
140 = new QgsBabelSimpleImportFormat( u"magellanx"_s, u"Magellan SD files (as for eXplorist)"_s, Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Routes | Qgis::BabelFormatCapability::Tracks, { u"upt"_s } );
141 mImporters[u"maggeo"_s] = new QgsBabelSimpleImportFormat( u"maggeo"_s, u"Magellan Explorist Geocaching"_s, Qgis::BabelFormatCapability::Waypoints, { u"gs"_s } );
142 mImporters[u"mainnav"_s] = new QgsBabelSimpleImportFormat( u"mainnav"_s, u"Mainnav"_s, Qgis::BabelFormatCapability::Tracks, { u"nav"_s } );
143 mImporters[u"mapasia_tr7"_s] = new QgsBabelSimpleImportFormat( u"mapasia_tr7"_s, u"MapAsia track file (.tr7)"_s, Qgis::BabelFormatCapability::Tracks, { u"tr7"_s } );
144 mImporters[u"mapbar"_s] = new QgsBabelSimpleImportFormat( u"mapbar"_s, u"Mapbar (China) navigation track for Sonim Xp3300"_s, Qgis::BabelFormatCapability::Tracks, { u"trk"_s } );
145 mImporters[u"mapconverter"_s] = new QgsBabelSimpleImportFormat( u"mapconverter"_s, u"Mapopolis.com Mapconverter CSV"_s, Qgis::BabelFormatCapability::Waypoints, { u"txt"_s } );
146 mImporters[u"mapfactor"_s] = new QgsBabelSimpleImportFormat( u"mapfactor"_s, u"Mapfactor Navigator"_s, Qgis::BabelFormatCapability::Waypoints, { u"xml"_s } );
147 mImporters[u"mapsend"_s]
149 mImporters[u"mmo"_s]
150 = new QgsBabelSimpleImportFormat( u"mmo"_s, u"Memory-Map Navigator overlay files (.mmo)"_s, Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Routes | Qgis::BabelFormatCapability::Tracks, { u"mmo"_s } );
151 mImporters[u"motoactv"_s] = new QgsBabelSimpleImportFormat( u"motoactv"_s, u"Motoactiv CSV"_s, Qgis::BabelFormatCapability::Waypoints, { u"csv"_s } );
152 mImporters[u"mtk-bin"_s]
153 = new QgsBabelSimpleImportFormat( u"mtk-bin"_s, u"MTK Logger (iBlue 747,...) Binary File Format"_s, Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Tracks, { u"bin"_s } );
154 mImporters[u"mtk_locus"_s] = new QgsBabelSimpleImportFormat( u"mtk_locus"_s, u"MediaTek Locus"_s, Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Tracks, {} );
155 mImporters[u"mxf"_s] = new QgsBabelSimpleImportFormat( u"mxf"_s, u"MapTech Exchange Format"_s, Qgis::BabelFormatCapability::Waypoints, { u"mxf"_s } );
156 mImporters[u"mynav"_s] = new QgsBabelSimpleImportFormat( u"mynav"_s, u"MyNav TRC format"_s, Qgis::BabelFormatCapability::Tracks, { u"trc"_s } );
157 mImporters[u"navicache"_s] = new QgsBabelSimpleImportFormat( u"navicache"_s, u"Navicache.com XML"_s, Qgis::BabelFormatCapability::Waypoints, {} );
158 mImporters[u"navigonwpt"_s] = new QgsBabelSimpleImportFormat( u"navigonwpt"_s, u"Navigon Waypoints"_s, Qgis::BabelFormatCapability::Waypoints, {} );
159 mImporters[u"naviguide"_s] = new QgsBabelSimpleImportFormat( u"naviguide"_s, u"Naviguide binary route file (.twl)"_s, Qgis::BabelFormatCapability::Waypoints, { u"twl"_s } );
160 mImporters[u"navitel_trk"_s] = new QgsBabelSimpleImportFormat( u"navitel_trk"_s, u"Navitel binary track (.bin)"_s, Qgis::BabelFormatCapability::Tracks, { u"bin"_s } );
161 mImporters[u"netstumbler"_s] = new QgsBabelSimpleImportFormat( u"netstumbler"_s, u"NetStumbler Summary File (text)"_s, Qgis::BabelFormatCapability::Waypoints, {} );
162 mImporters[u"nima"_s] = new QgsBabelSimpleImportFormat( u"nima"_s, u"NIMA/GNIS Geographic Names File"_s, Qgis::BabelFormatCapability::Waypoints, {} );
163 mImporters[u"nmea"_s] = new QgsBabelSimpleImportFormat( u"nmea"_s, u"NMEA 0183 sentences"_s, Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Tracks, {} );
164 mImporters[u"nmn4"_s] = new QgsBabelSimpleImportFormat( u"nmn4"_s, u"Navigon Mobile Navigator .rte files"_s, Qgis::BabelFormatCapability::Routes, { u"rte"_s } );
165 mImporters[u"openoffice"_s] = new QgsBabelSimpleImportFormat( u"openoffice"_s, u"Tab delimited fields useful for OpenOffice"_s, Qgis::BabelFormatCapability::Waypoints, {} );
166 mImporters[u"osm"_s] = new QgsBabelSimpleImportFormat( u"osm"_s, u"OpenStreetMap data files"_s, Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Routes, { u"osm"_s } );
168 mImporters[u"pcx"_s]
170 mImporters[u"pocketfms_bc"_s] = new QgsBabelSimpleImportFormat( u"pocketfms_bc"_s, u"PocketFMS breadcrumbs"_s, Qgis::BabelFormatCapability::Tracks, {} );
171 mImporters[u"pocketfms_fp"_s]
172 = new QgsBabelSimpleImportFormat( u"pocketfms_fp"_s, u"PocketFMS flightplan (.xml)"_s, Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Routes, { u"xml"_s } );
173 mImporters[u"pocketfms_wp"_s] = new QgsBabelSimpleImportFormat( u"pocketfms_wp"_s, u"PocketFMS waypoints (.txt)"_s, Qgis::BabelFormatCapability::Waypoints, { u"txt"_s } );
174 mImporters[u"qstarz_bl-1000"_s] = new QgsBabelSimpleImportFormat( u"qstarz_bl-1000"_s, u"Qstarz BL-1000"_s, Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Tracks, {} );
175 mImporters[u"raymarine"_s]
176 = new QgsBabelSimpleImportFormat( u"raymarine"_s, u"Raymarine Waypoint File (.rwf)"_s, Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Routes, { u"rwf"_s } );
177 mImporters[u"ricoh"_s] = new QgsBabelSimpleImportFormat( u"ricoh"_s, u"Ricoh GPS Log File"_s, Qgis::BabelFormatCapability::Tracks, { u"log"_s } );
178 mImporters[u"s_and_t"_s] = new QgsBabelSimpleImportFormat( u"s_and_t"_s, u"Microsoft Streets and Trips 2002-2007"_s, Qgis::BabelFormatCapability::Waypoints, { u"txt"_s } );
179 mImporters[u"saplus"_s] = new QgsBabelSimpleImportFormat( u"saplus"_s, u"DeLorme Street Atlas Plus"_s, Qgis::BabelFormatCapability::Waypoints, {} );
180 mImporters[u"saroute"_s] = new QgsBabelSimpleImportFormat( u"saroute"_s, u"DeLorme Street Atlas Route"_s, Qgis::BabelFormatCapability::Tracks, { u"anr"_s } );
181 mImporters[u"sbn"_s] = new QgsBabelSimpleImportFormat( u"sbn"_s, u"NaviGPS GT-31/BGT-31 SiRF binary logfile (.sbn)"_s, Qgis::BabelFormatCapability::Tracks, { u"sbn"_s } );
182 mImporters[u"sbp"_s] = new QgsBabelSimpleImportFormat( u"sbp"_s, u"NaviGPS GT-31/BGT-31 datalogger (.sbp)"_s, Qgis::BabelFormatCapability::Tracks, { u"sbp"_s } );
183 mImporters[u"shape"_s]
185 mImporters[u"skyforce"_s]
187 mImporters[u"skytraq-bin"_s]
188 = new QgsBabelSimpleImportFormat( u"skytraq-bin"_s, u"SkyTraq Venus based loggers Binary File Format"_s, Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Tracks, { u"bin"_s } );
189 mImporters[u"stmsdf"_s] = new QgsBabelSimpleImportFormat( u"stmsdf"_s, u"Suunto Trek Manager (STM) .sdf files"_s, Qgis::BabelFormatCapability::Routes | Qgis::BabelFormatCapability::Tracks, { u"sdf"_s } );
190 mImporters[u"stmwpp"_s]
191 = new QgsBabelSimpleImportFormat( u"stmwpp"_s, u"Suunto Trek Manager (STM) WaypointPlus files"_s, Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Routes | Qgis::BabelFormatCapability::Tracks, { u"txt"_s } );
192 mImporters[u"tef"_s] = new QgsBabelSimpleImportFormat( u"tef"_s, u"Map&Guide 'TourExchangeFormat' XML"_s, Qgis::BabelFormatCapability::Routes, { u"xml"_s } );
193 mImporters[u"teletype"_s] = new QgsBabelSimpleImportFormat( u"teletype"_s, u"Teletype"_s, Qgis::BabelFormatCapability::Waypoints, {} );
194 mImporters[u"tiger"_s] = new QgsBabelSimpleImportFormat( u"tiger"_s, u"U.S. Census Bureau Tiger Mapping Service"_s, Qgis::BabelFormatCapability::Waypoints, {} );
195 mImporters[u"tmpro"_s] = new QgsBabelSimpleImportFormat( u"tmpro"_s, u"TopoMapPro Places File"_s, Qgis::BabelFormatCapability::Waypoints, { u"tmpro"_s } );
196 mImporters[u"tomtom"_s] = new QgsBabelSimpleImportFormat( u"tomtom"_s, u"TomTom POI file (.ov2)"_s, Qgis::BabelFormatCapability::Waypoints, { u"ov2"_s } );
197 mImporters[u"tomtom_asc"_s] = new QgsBabelSimpleImportFormat( u"tomtom_asc"_s, u"TomTom POI file (.asc)"_s, Qgis::BabelFormatCapability::Waypoints, { u"asc"_s } );
198 mImporters[u"tomtom_itn"_s] = new QgsBabelSimpleImportFormat( u"tomtom_itn"_s, u"TomTom Itineraries (.itn)"_s, Qgis::BabelFormatCapability::Routes, { u"itn"_s } );
199 mImporters[u"tomtom_itn_places"_s] = new QgsBabelSimpleImportFormat( u"tomtom_itn_places"_s, u"TomTom Places Itineraries (.itn)"_s, Qgis::BabelFormatCapability::Routes, { u"itn"_s } );
200 mImporters[u"tpg"_s] = new QgsBabelSimpleImportFormat( u"tpg"_s, u"National Geographic Topo .tpg (waypoints)"_s, Qgis::BabelFormatCapability::Waypoints, { u"tpg"_s } );
201 mImporters[u"tpo2"_s] = new QgsBabelSimpleImportFormat( u"tpo2"_s, u"National Geographic Topo 2.x .tpo"_s, Qgis::BabelFormatCapability::Tracks, { u"tpo"_s } );
202 mImporters[u"tpo3"_s]
203 = new QgsBabelSimpleImportFormat( u"tpo3"_s, u"National Geographic Topo 3.x/4.x .tpo"_s, Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Routes | Qgis::BabelFormatCapability::Tracks, { u"tpo"_s } );
204 mImporters[u"unicsv"_s]
205 = new QgsBabelSimpleImportFormat( u"unicsv"_s, u"Universal csv with field structure in first line"_s, Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Routes | Qgis::BabelFormatCapability::Tracks, {} );
206 mImporters[u"v900"_s] = new QgsBabelSimpleImportFormat( u"v900"_s, u"Columbus/Visiontac V900 files (.csv)"_s, Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Tracks, {} );
207 mImporters[u"vidaone"_s] = new QgsBabelSimpleImportFormat( u"vidaone"_s, u"VidaOne GPS for Pocket PC (.gpb)"_s, Qgis::BabelFormatCapability::Tracks, { u"gpb"_s } );
208 mImporters[u"vitosmt"_s]
210 mImporters[u"vitovtt"_s] = new QgsBabelSimpleImportFormat( u"vitovtt"_s, u"Vito SmartMap tracks (.vtt)"_s, Qgis::BabelFormatCapability::Tracks, { u"vtt"_s } );
211 mImporters[u"vpl"_s] = new QgsBabelSimpleImportFormat( u"vpl"_s, u"Honda/Acura Navigation System VP Log File Format"_s, Qgis::BabelFormatCapability::Tracks, {} );
212 mImporters[u"wbt-bin"_s] = new QgsBabelSimpleImportFormat( u"wbt-bin"_s, u"Wintec WBT-100/200 Binary File Format"_s, Qgis::BabelFormatCapability::Tracks, { u"bin"_s } );
213 mImporters[u"wbt-tk1"_s] = new QgsBabelSimpleImportFormat( u"wbt-tk1"_s, u"Wintec WBT-201/G-Rays 2 Binary File Format"_s, Qgis::BabelFormatCapability::Tracks, { u"tk1"_s } );
214 mImporters[u"wfff"_s] = new QgsBabelSimpleImportFormat( u"wfff"_s, u"WiFiFoFum 2.0 for PocketPC XML"_s, Qgis::BabelFormatCapability::Waypoints, { u"xml"_s } );
215 mImporters[u"wintec_tes"_s] = new QgsBabelSimpleImportFormat( u"wintec_tes"_s, u"Wintec TES file"_s, Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Tracks, { u"tes"_s } );
216 mImporters[u"xmap"_s] = new QgsBabelSimpleImportFormat( u"xmap"_s, u"DeLorme XMap HH Native .WPT"_s, Qgis::BabelFormatCapability::Waypoints, { u"wpt"_s } );
217 mImporters[u"xmap2006"_s] = new QgsBabelSimpleImportFormat( u"xmap2006"_s, u"DeLorme XMap/SAHH 2006 Native .TXT"_s, Qgis::BabelFormatCapability::Waypoints, { u"txt"_s } );
218 mImporters[u"xmapwpt"_s] = new QgsBabelSimpleImportFormat( u"xmapwpt"_s, u"DeLorme XMat HH Street Atlas USA .WPT (PPC)"_s, Qgis::BabelFormatCapability::Waypoints, {} );
219 mImporters[u"xol"_s] = new QgsBabelSimpleImportFormat( u"xol"_s, u"Swiss Map 25/50/100 (.xol)"_s, Qgis::BabelFormatCapability::Waypoints | Qgis::BabelFormatCapability::Tracks, { u"xol"_s } );
220 mImporters[u"yahoo"_s] = new QgsBabelSimpleImportFormat( u"yahoo"_s, u"Yahoo Geocode API data"_s, Qgis::BabelFormatCapability::Waypoints, {} );
221
223}
224
226{
227 qDeleteAll( mImporters );
228 qDeleteAll( mDevices );
229}
230
232{
233 return mImporters.keys();
234}
235
237{
238 return mImporters.value( name );
239}
240
242{
243 for ( auto it = mImporters.constBegin(); it != mImporters.constEnd(); ++it )
244 {
245 if ( it.value()->description().compare( description, Qt::CaseInsensitive ) == 0 )
246 return it.value();
247
248 // also need to test square bracket variant, see logic in importFileFilter()
249 const QString descriptionSquareBrackets = it.value()->description().replace( '(', '[' ).replace( ')', ']' );
250 if ( descriptionSquareBrackets.compare( description, Qt::CaseInsensitive ) == 0 )
251 return it.value();
252 }
253 return nullptr;
254}
255
257{
258 QStringList res;
259 QMap< QString, QString > descriptionToString;
260 for ( auto it = mImporters.constBegin(); it != mImporters.constEnd(); ++it )
261 {
262 const QStringList extensions = it.value()->extensions();
263 QString fileFilter;
264 if ( !extensions.empty() )
265 {
266 fileFilter = '(';
267 for ( const QString &extension : extensions )
268 fileFilter.append( u"*.%1"_s.arg( extension ) );
269 fileFilter.append( ')' );
270 }
271 else
272 {
273 fileFilter = u"(*.*)"_s;
274 }
275
276 // we have to replace round brackets from the format description, or they are treated as the filter component!
277 const QString description = it.value()->description().replace( '(', '[' ).replace( ')', ']' );
278
279 descriptionToString.insert( description.toLower(), u"%1 %2"_s.arg( description, fileFilter ) );
280 }
281
282 // build the list in a sorted order of lowercase description
283 for ( auto it = descriptionToString.constBegin(); it != descriptionToString.constEnd(); ++it )
284 res << it.value();
285
286 return res.join( ";;"_L1 );
287}
288
290{
291 return mDevices.keys();
292}
293
295{
296 return mDevices.value( name );
297}
298
299QMap<QString, QgsBabelGpsDeviceFormat *> QgsBabelFormatRegistry::devices() const
300{
301 return mDevices;
302}
303
305{
306 qDeleteAll( mDevices );
307 mDevices.clear();
308
309 mDevices[u"Garmin serial"_s]
310 = new QgsBabelGpsDeviceFormat( u"%babel -w -i garmin -o gpx %in %out"_s, u"%babel -w -i gpx -o garmin %in %out"_s, u"%babel -r -i garmin -o gpx %in %out"_s, u"%babel -r -i gpx -o garmin %in %out"_s, u"%babel -t -i garmin -o gpx %in %out"_s, u"%babel -t -i gpx -o garmin %in %out"_s );
311
312 try
313 {
314 for ( const QString &device : sTreeBabelDevices->items() )
315 {
316 // don't leak memory if there's already a device with this name...
317 delete mDevices.value( device );
318
319 mDevices[device] = new QgsBabelGpsDeviceFormat(
320 settingsBabelWptDownload->value( device ),
321 settingsBabelWptUpload->value( device ),
322 settingsBabelRteDownload->value( device ),
323 settingsBabelRteUpload->value( device ),
324 settingsBabelTrkDownload->value( device ),
325 settingsBabelTrkUpload->value( device )
326 );
327 }
328 }
329 catch ( QgsSettingsException &e )
330 {
331 QgsDebugError( e.what() );
332 }
333}
@ Tracks
Format supports tracks.
Definition qgis.h:2078
@ Waypoints
Format supports waypoints.
Definition qgis.h:2076
@ Routes
Format supports routes.
Definition qgis.h:2077
void reloadFromSettings()
Reloads the registry's members from the currently stored configuration.
QgsBabelSimpleImportFormat * importFormatByDescription(const QString &description)
Returns a registered import format by description.
static const QgsSettingsEntryString * settingsBabelWptDownload
static const QgsSettingsEntryString * settingsBabelRteUpload
static const QgsSettingsEntryString * settingsBabelTrkDownload
QMap< QString, QgsBabelGpsDeviceFormat * > devices() const
Returns a map of device name to device format.
static const QgsSettingsEntryString * settingsBabelWptUpload
QStringList importFormatNames() const
Returns a list of the names of all registered import formats.
static const QgsSettingsEntryString * settingsBabelTrkUpload
QStringList deviceNames() const
Returns a list of the names of all registered devices.
static QgsSettingsTreeNamedListNode * sTreeBabelDevices
QgsBabelFormatRegistry()
Constructor for QgsBabelFormatRegistry.
QString importFileFilter() const
Returns a file filter string representing all registered import formats.
static const QgsSettingsEntryString * settingsBabelRteDownload
QgsBabelSimpleImportFormat * importFormat(const QString &name)
Returns a registered import format by name.
QgsBabelGpsDeviceFormat * deviceFormat(const QString &name)
Returns a registered device format by name.
A babel format capable of interacting directly with a GPS device.
A babel format capable of converting input files to GPX files.
QString what() const
A string settings entry.
Custom exception class for settings related exceptions.
#define QgsDebugError(str)
Definition qgslogger.h:59