mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-07-04 14:49:30 +02:00
Compare commits
43 Commits
Author | SHA1 | Date | |
---|---|---|---|
1d719fdcc8 | |||
1746e1cf08 | |||
5d5a5365cd | |||
7dfdeac1da | |||
1ff13ee9f8 | |||
34b1fb6b5d | |||
02bf85780a | |||
47199348d8 | |||
3b55bc0efc | |||
4de3ddf71b | |||
e26fa92ce6 | |||
dfb69b2755 | |||
c2a30738cb | |||
fd53e89ea5 | |||
ccf91bb29f | |||
75bd388be0 | |||
aef0357204 | |||
d073d606d0 | |||
8822bf7e5f | |||
051a3ed303 | |||
96437ae6ab | |||
89c25bbc3a | |||
322792ea04 | |||
ce1c76a315 | |||
804e9594ad | |||
651973c524 | |||
533af66080 | |||
bab5750cf7 | |||
0d6f3ea162 | |||
b915302e2f | |||
03ef7a9147 | |||
33cb944e36 | |||
8bc575aef2 | |||
f0b7abdb72 | |||
6ce14734cd | |||
925a0e2951 | |||
e46bba18f2 | |||
a56aa4e706 | |||
c4b3a81b0b | |||
957cc6f4f3 | |||
ebad0832ee | |||
186c135ad5 | |||
72b5b1ea97 |
15
README.md
15
README.md
@ -3,7 +3,8 @@ GPXSee is a Qt-based GPS log file viewer and analyzer that supports GPX, TCX,
|
||||
KML, FIT, IGC and NMEA files.
|
||||
|
||||
## Features
|
||||
* User-definable map sources.
|
||||
* User-definable online maps.
|
||||
* Offline maps (OziExplorer maps and TrekBuddy maps/atlases).
|
||||
* Elevation, speed, heart rate, cadence, power and temperature graphs.
|
||||
* Support for multiple tracks in one view.
|
||||
* Support for POI files.
|
||||
@ -15,22 +16,18 @@ KML, FIT, IGC and NMEA files.
|
||||

|
||||
|
||||
## Build
|
||||
### Linux/OS X
|
||||
```shell
|
||||
lrelease gpxsee.pro
|
||||
qmake gpxsee.pro
|
||||
make
|
||||
```
|
||||
### Windows
|
||||
```shell
|
||||
lrelease gpxsee.pro
|
||||
qmake gpxsee.pro
|
||||
nmake release
|
||||
```
|
||||
|
||||
## Binaries
|
||||
## Download
|
||||
* [Windows & OS X builds](http://sourceforge.net/projects/gpxsee)
|
||||
* [Linux packages](http://software.opensuse.org/download.html?project=home%3Atumic%3AGPXSee&package=gpxsee)
|
||||
|
||||
## Changelog
|
||||
[Changelog](https://build.opensuse.org/package/view_file/home:tumic:GPXSee/gpxsee/gpxsee.changes)
|
||||
|
||||
## Homepage
|
||||
GPXSee homepage: http://tumic.wz.cz/gpxsee
|
||||
|
21
gpxsee.pro
21
gpxsee.pro
@ -1,5 +1,5 @@
|
||||
TARGET = GPXSee
|
||||
VERSION = 4.0
|
||||
VERSION = 4.4
|
||||
QT += core \
|
||||
gui \
|
||||
network
|
||||
@ -89,7 +89,11 @@ HEADERS += src/config.h \
|
||||
src/mercator.h \
|
||||
src/transversemercator.h \
|
||||
src/latlon.h \
|
||||
src/utm.h
|
||||
src/utm.h \
|
||||
src/lambertconic.h \
|
||||
src/ellipsoid.h \
|
||||
src/ozf.h \
|
||||
src/datum.h
|
||||
SOURCES += src/main.cpp \
|
||||
src/gui.cpp \
|
||||
src/poi.cpp \
|
||||
@ -152,10 +156,15 @@ SOURCES += src/main.cpp \
|
||||
src/atlas.cpp \
|
||||
src/mercator.cpp \
|
||||
src/transversemercator.cpp \
|
||||
src/utm.cpp
|
||||
src/utm.cpp \
|
||||
src/lambertconic.cpp \
|
||||
src/ellipsoid.cpp \
|
||||
src/ozf.cpp \
|
||||
src/datum.cpp
|
||||
RESOURCES += gpxsee.qrc
|
||||
TRANSLATIONS = lang/gpxsee_cs.ts \
|
||||
lang/gpxsee_sv.ts
|
||||
lang/gpxsee_sv.ts \
|
||||
lang/gpxsee_de.ts
|
||||
macx {
|
||||
ICON = icons/gpxsee.icns
|
||||
QMAKE_INFO_PLIST = Info.plist
|
||||
@ -165,7 +174,9 @@ macx {
|
||||
icons/fit.icns \
|
||||
icons/igc.icns \
|
||||
icons/nmea.icns \
|
||||
pkg/maps.txt
|
||||
pkg/maps.txt \
|
||||
pkg/ellipsoids.csv \
|
||||
pkg/datums.csv
|
||||
APP_RESOURCES.path = Contents/Resources
|
||||
QMAKE_BUNDLE_DATA += APP_RESOURCES
|
||||
}
|
||||
|
@ -21,5 +21,6 @@
|
||||
<file>icons/document-print-preview.png</file>
|
||||
<file>lang/gpxsee_cs.qm</file>
|
||||
<file>lang/gpxsee_sv.qm</file>
|
||||
<file>lang/gpxsee_de.qm</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
@ -190,326 +190,351 @@
|
||||
<context>
|
||||
<name>GUI</name>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="578"/>
|
||||
<location filename="../src/gui.cpp" line="625"/>
|
||||
<source>GPXSee is distributed under the terms of the GNU General Public License version 3. For more info about GPXSee visit the project homepage at </source>
|
||||
<translation>Program GPXSee je distribuován pod podmínkami licence GNU General Public License verze 3. Pro více informací navštivte stránky programu na adrese </translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="650"/>
|
||||
<location filename="../src/gui.cpp" line="703"/>
|
||||
<source>Open file</source>
|
||||
<translation>Otevřít soubor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="740"/>
|
||||
<location filename="../src/gui.cpp" line="793"/>
|
||||
<source>Open POI file</source>
|
||||
<translation>Otevřít POI soubor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="237"/>
|
||||
<location filename="../src/gui.cpp" line="284"/>
|
||||
<source>Open</source>
|
||||
<translation>Otevřít</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="221"/>
|
||||
<location filename="../src/gui.cpp" line="268"/>
|
||||
<source>Quit</source>
|
||||
<translation>Ukončit</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="229"/>
|
||||
<location filename="../src/gui.cpp" line="594"/>
|
||||
<location filename="../src/gui.cpp" line="595"/>
|
||||
<location filename="../src/gui.cpp" line="276"/>
|
||||
<location filename="../src/gui.cpp" line="641"/>
|
||||
<location filename="../src/gui.cpp" line="642"/>
|
||||
<source>Keyboard controls</source>
|
||||
<translation>Ovládací klávesy</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="253"/>
|
||||
<location filename="../src/gui.cpp" line="300"/>
|
||||
<source>Close</source>
|
||||
<translation>Zavřít</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="259"/>
|
||||
<location filename="../src/gui.cpp" line="306"/>
|
||||
<source>Reload</source>
|
||||
<translation>Znovu načíst</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="508"/>
|
||||
<location filename="../src/gui.cpp" line="555"/>
|
||||
<source>Show</source>
|
||||
<translation>Zobrazit</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="426"/>
|
||||
<location filename="../src/gui.cpp" line="502"/>
|
||||
<location filename="../src/gui.cpp" line="473"/>
|
||||
<location filename="../src/gui.cpp" line="549"/>
|
||||
<source>File</source>
|
||||
<translation>Soubor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="105"/>
|
||||
<location filename="../src/gui.cpp" line="108"/>
|
||||
<source>FIT files (*.fit)</source>
|
||||
<translation>Soubory FIT (*.fit)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="106"/>
|
||||
<location filename="../src/gui.cpp" line="109"/>
|
||||
<source>IGC files (*.igc)</source>
|
||||
<translation>Soubory IGC (*.igc)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="107"/>
|
||||
<location filename="../src/gui.cpp" line="110"/>
|
||||
<source>NMEA files (*.nmea)</source>
|
||||
<translation>Soubory NMEA (*.nmea)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="227"/>
|
||||
<location filename="../src/gui.cpp" line="617"/>
|
||||
<location filename="../src/gui.cpp" line="618"/>
|
||||
<location filename="../src/gui.cpp" line="274"/>
|
||||
<location filename="../src/gui.cpp" line="670"/>
|
||||
<location filename="../src/gui.cpp" line="671"/>
|
||||
<source>Data sources</source>
|
||||
<translation>Zdroje dat</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="267"/>
|
||||
<location filename="../src/gui.cpp" line="314"/>
|
||||
<source>Load POI file</source>
|
||||
<translation>Nahrát POI soubor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="270"/>
|
||||
<location filename="../src/gui.cpp" line="317"/>
|
||||
<source>Close POI files</source>
|
||||
<translation>Zavřit POI soubory</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="272"/>
|
||||
<location filename="../src/gui.cpp" line="319"/>
|
||||
<source>Overlap POIs</source>
|
||||
<translation>Překrývat POI</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="276"/>
|
||||
<location filename="../src/gui.cpp" line="323"/>
|
||||
<source>Show POI labels</source>
|
||||
<translation>Zobrazit názvy POI</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="281"/>
|
||||
<location filename="../src/gui.cpp" line="328"/>
|
||||
<source>Show POIs</source>
|
||||
<translation>Zobrazit POI</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="290"/>
|
||||
<location filename="../src/gui.cpp" line="337"/>
|
||||
<source>Show map</source>
|
||||
<translation>Zobrazit mapu</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="297"/>
|
||||
<location filename="../src/gui.cpp" line="344"/>
|
||||
<source>Clear tile cache</source>
|
||||
<translation>Vymazat mezipaměť dlaždic</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="306"/>
|
||||
<location filename="../src/gui.cpp" line="310"/>
|
||||
<location filename="../src/gui.cpp" line="606"/>
|
||||
<location filename="../src/gui.cpp" line="353"/>
|
||||
<location filename="../src/gui.cpp" line="357"/>
|
||||
<location filename="../src/gui.cpp" line="653"/>
|
||||
<source>Next map</source>
|
||||
<translation>Následující mapa</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="317"/>
|
||||
<location filename="../src/gui.cpp" line="364"/>
|
||||
<source>Show tracks</source>
|
||||
<translation>Zobrazit cesty</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="321"/>
|
||||
<location filename="../src/gui.cpp" line="368"/>
|
||||
<source>Show routes</source>
|
||||
<translation>Zobrazit trasy</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="325"/>
|
||||
<location filename="../src/gui.cpp" line="372"/>
|
||||
<source>Show waypoints</source>
|
||||
<translation>Zobrazit navigační body</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="329"/>
|
||||
<location filename="../src/gui.cpp" line="376"/>
|
||||
<source>Waypoint labels</source>
|
||||
<translation>Názvy navigačních bodů</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="340"/>
|
||||
<location filename="../src/gui.cpp" line="387"/>
|
||||
<source>Show graphs</source>
|
||||
<translation>Zobrazit grafy</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="362"/>
|
||||
<location filename="../src/gui.cpp" line="409"/>
|
||||
<source>Show grid</source>
|
||||
<translation>Zobrazit mřížku</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="368"/>
|
||||
<location filename="../src/gui.cpp" line="415"/>
|
||||
<source>Show toolbars</source>
|
||||
<translation>Zobrazovat nástrojové lišty</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="374"/>
|
||||
<location filename="../src/gui.cpp" line="421"/>
|
||||
<source>Total time</source>
|
||||
<translation>Celkový čas</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="379"/>
|
||||
<location filename="../src/gui.cpp" line="893"/>
|
||||
<location filename="../src/gui.cpp" line="426"/>
|
||||
<location filename="../src/gui.cpp" line="946"/>
|
||||
<source>Moving time</source>
|
||||
<translation>Čistý čas</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="386"/>
|
||||
<location filename="../src/gui.cpp" line="433"/>
|
||||
<source>Metric</source>
|
||||
<translation>Metrické</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="391"/>
|
||||
<location filename="../src/gui.cpp" line="438"/>
|
||||
<source>Imperial</source>
|
||||
<translation>Imperiální</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="397"/>
|
||||
<location filename="../src/gui.cpp" line="444"/>
|
||||
<source>Fullscreen mode</source>
|
||||
<translation>Celoobrazovkový režim</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="403"/>
|
||||
<location filename="../src/gui.cpp" line="450"/>
|
||||
<source>Options...</source>
|
||||
<translation>Nastavení...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="408"/>
|
||||
<location filename="../src/gui.cpp" line="455"/>
|
||||
<source>Next</source>
|
||||
<translation>Následující</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="411"/>
|
||||
<location filename="../src/gui.cpp" line="458"/>
|
||||
<source>Previous</source>
|
||||
<translation>Předchozí</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="415"/>
|
||||
<location filename="../src/gui.cpp" line="462"/>
|
||||
<source>Last</source>
|
||||
<translation>Poslední</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="418"/>
|
||||
<location filename="../src/gui.cpp" line="465"/>
|
||||
<source>First</source>
|
||||
<translation>První</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="440"/>
|
||||
<location filename="../src/gui.cpp" line="487"/>
|
||||
<source>Map</source>
|
||||
<translation>Mapa</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="447"/>
|
||||
<location filename="../src/gui.cpp" line="494"/>
|
||||
<source>Graph</source>
|
||||
<translation>Graf</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="455"/>
|
||||
<location filename="../src/gui.cpp" line="502"/>
|
||||
<source>POI</source>
|
||||
<translation>POI</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="456"/>
|
||||
<location filename="../src/gui.cpp" line="503"/>
|
||||
<source>POI files</source>
|
||||
<translation>POI soubory</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="467"/>
|
||||
<location filename="../src/gui.cpp" line="514"/>
|
||||
<source>Data</source>
|
||||
<translation>Data</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="468"/>
|
||||
<location filename="../src/gui.cpp" line="515"/>
|
||||
<source>Display</source>
|
||||
<translation>Zobrazit</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="476"/>
|
||||
<location filename="../src/gui.cpp" line="523"/>
|
||||
<source>Settings</source>
|
||||
<translation>Nastavení</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="480"/>
|
||||
<location filename="../src/gui.cpp" line="527"/>
|
||||
<source>Units</source>
|
||||
<translation>Jednotky</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="489"/>
|
||||
<location filename="../src/gui.cpp" line="536"/>
|
||||
<source>Help</source>
|
||||
<translation>Nápověda</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="607"/>
|
||||
<location filename="../src/gui.cpp" line="651"/>
|
||||
<source>Append file</source>
|
||||
<translation>Přidat soubor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="652"/>
|
||||
<source>Next/Previous</source>
|
||||
<translation>Následující/Předchozí</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="655"/>
|
||||
<source>Previous map</source>
|
||||
<translation>Předchozí mapa</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="620"/>
|
||||
<location filename="../src/gui.cpp" line="656"/>
|
||||
<source>Zoom in</source>
|
||||
<translation>Přiblížit</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="658"/>
|
||||
<source>Zoom out</source>
|
||||
<translation>Oddálit</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="660"/>
|
||||
<source>Digital zoom</source>
|
||||
<translation>Digitální zoom</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="661"/>
|
||||
<source>Zoom</source>
|
||||
<translation>Zoom</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="673"/>
|
||||
<source>Online maps</source>
|
||||
<translation>Online mapy</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="621"/>
|
||||
<location filename="../src/gui.cpp" line="674"/>
|
||||
<source>Online map URLs are read on program startup from the following file:</source>
|
||||
<translation>URL online map jsou načteny při startu programu z následujícího souboru:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="631"/>
|
||||
<source>Ofline maps</source>
|
||||
<translation>Offline mapy</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="632"/>
|
||||
<location filename="../src/gui.cpp" line="685"/>
|
||||
<source>Offline maps are loaded on program startup from the following directory:</source>
|
||||
<translation>Offline mapy jsou načítány při startu aplikace z následujícího adresáře:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="635"/>
|
||||
<source>The expected structure is one map/atlas in a separate subdirectory. Supported map formats are OziMap image-based maps and tiled TrekBuddy maps/atlases (tared and non-tared).</source>
|
||||
<translation>Očekávaná struktura je jedna mapa/atlas v samostatném podadresáři. Podporované mapové formáty jsou OziMap mapy a TrekBuddy mapy/atlasy (včetně tar varianty).</translation>
|
||||
<location filename="../src/gui.cpp" line="688"/>
|
||||
<source>The expected structure is one map/atlas in a separate subdirectory. Supported map formats are OziExplorer image-based maps and tiled TrekBuddy maps/atlases (tared and non-tared).</source>
|
||||
<translation>Očekávaná struktura je jedna mapa/atlas v samostatném podadresáři. Podporované mapové formáty jsou OziExplorer mapy a TrekBuddy mapy/atlasy (včetně tar varianty).</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="1091"/>
|
||||
<location filename="../src/gui.cpp" line="1144"/>
|
||||
<source>No files loaded</source>
|
||||
<translation>Nejsou načteny žádné soubory</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="106"/>
|
||||
<location filename="../src/gui.cpp" line="109"/>
|
||||
<source>GPX files (*.gpx)</source>
|
||||
<translation>Soubory GPX (*.gpx)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="108"/>
|
||||
<location filename="../src/gui.cpp" line="111"/>
|
||||
<source>TCX files (*.tcx)</source>
|
||||
<translation>Soubory TCX (*.tcx)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="107"/>
|
||||
<location filename="../src/gui.cpp" line="110"/>
|
||||
<source>KML files (*.kml)</source>
|
||||
<translation>Soubory KML (*.kml)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="105"/>
|
||||
<location filename="../src/gui.cpp" line="108"/>
|
||||
<source>CSV files (*.csv)</source>
|
||||
<translation>Soubory CSV (*.csv)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="108"/>
|
||||
<location filename="../src/gui.cpp" line="111"/>
|
||||
<source>All files (*)</source>
|
||||
<translation>Všechny soubory (*)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="879"/>
|
||||
<location filename="../src/gui.cpp" line="882"/>
|
||||
<location filename="../src/gui.cpp" line="932"/>
|
||||
<location filename="../src/gui.cpp" line="935"/>
|
||||
<source>Date</source>
|
||||
<translation>Datum</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="871"/>
|
||||
<location filename="../src/gui.cpp" line="924"/>
|
||||
<source>Routes</source>
|
||||
<translation>Trasy</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<location filename="../src/gui.cpp" line="1095"/>
|
||||
<location filename="../src/gui.cpp" line="1148"/>
|
||||
<source>%n files</source>
|
||||
<translation>
|
||||
<numerusform>%n soubor</numerusform>
|
||||
@ -518,122 +543,122 @@
|
||||
</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="597"/>
|
||||
<location filename="../src/gui.cpp" line="645"/>
|
||||
<source>Next file</source>
|
||||
<translation>Následující soubor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="575"/>
|
||||
<location filename="../src/gui.cpp" line="622"/>
|
||||
<source>Version </source>
|
||||
<translation>Verze </translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="242"/>
|
||||
<location filename="../src/gui.cpp" line="289"/>
|
||||
<source>Print...</source>
|
||||
<translation>Tisknout...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="247"/>
|
||||
<location filename="../src/gui.cpp" line="294"/>
|
||||
<source>Export to PDF...</source>
|
||||
<translation>Exportovat do PDF...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="873"/>
|
||||
<location filename="../src/gui.cpp" line="926"/>
|
||||
<source>Waypoints</source>
|
||||
<translation>Navigační body</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="599"/>
|
||||
<location filename="../src/gui.cpp" line="646"/>
|
||||
<source>Previous file</source>
|
||||
<translation>Předchozí soubor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="104"/>
|
||||
<location filename="../src/gui.cpp" line="107"/>
|
||||
<source>Supported files (*.csv *.fit *.gpx *.igc *.kml *.nmea *.tcx)</source>
|
||||
<translation>Podporované soubory (*.csv *.fit *.gpx *.igc *.kml *.nmea *.tcx)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="333"/>
|
||||
<location filename="../src/gui.cpp" line="380"/>
|
||||
<source>Route waypoints</source>
|
||||
<translation>Body tras</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="601"/>
|
||||
<location filename="../src/gui.cpp" line="648"/>
|
||||
<source>First file</source>
|
||||
<translation>První soubor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="603"/>
|
||||
<location filename="../src/gui.cpp" line="650"/>
|
||||
<source>Last file</source>
|
||||
<translation>Poslední soubor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="604"/>
|
||||
<source>Append modifier</source>
|
||||
<translation>Modifikátor nahradit/přidat</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="624"/>
|
||||
<location filename="../src/gui.cpp" line="677"/>
|
||||
<source>The file format is one map entry per line, consisting of the map name and tiles URL delimited by a TAB character. The tile X and Y coordinates are replaced with $x and $y in the URL and the zoom level is replaced with $z. An example map file could look like:</source>
|
||||
<translation>Formát souboru je jeden mapový záznam na řádku, kde mapový záznam sestává ze jména mapy a URL dlaždic navzájem oddělených tabulátorem. Souřadnice dlaždice jsou v URL nahrazeny řetězci $x a $y, úroven přiblížení (zoom) pak řetězcem $z. Příklad:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="640"/>
|
||||
<location filename="../src/gui.cpp" line="684"/>
|
||||
<source>Offline maps</source>
|
||||
<translation>Offline mapy</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="693"/>
|
||||
<source>To make GPXSee load a POI file automatically on startup, add the file to the following directory:</source>
|
||||
<translation>POI soubory, které se mají automaticky nahrát při startu programu jsou načítány z následujícího adresáře:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="729"/>
|
||||
<location filename="../src/gui.cpp" line="782"/>
|
||||
<source>Error loading data file:</source>
|
||||
<translation>Datový soubor nelze načíst:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="732"/>
|
||||
<location filename="../src/gui.cpp" line="757"/>
|
||||
<location filename="../src/gui.cpp" line="785"/>
|
||||
<location filename="../src/gui.cpp" line="810"/>
|
||||
<source>Line: %1</source>
|
||||
<translation>Řádka: %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="754"/>
|
||||
<location filename="../src/gui.cpp" line="807"/>
|
||||
<source>Error loading POI file:</source>
|
||||
<translation>Soubor POI nelze načíst:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="865"/>
|
||||
<location filename="../src/gui.cpp" line="918"/>
|
||||
<source>Name</source>
|
||||
<translation>Název</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="869"/>
|
||||
<location filename="../src/gui.cpp" line="922"/>
|
||||
<source>Tracks</source>
|
||||
<translation>Cesty</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="232"/>
|
||||
<location filename="../src/gui.cpp" line="574"/>
|
||||
<location filename="../src/gui.cpp" line="279"/>
|
||||
<location filename="../src/gui.cpp" line="621"/>
|
||||
<source>About GPXSee</source>
|
||||
<translation>O aplikaci GPXSee</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="513"/>
|
||||
<location filename="../src/gui.cpp" line="560"/>
|
||||
<source>Navigation</source>
|
||||
<translation>Navigace</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="639"/>
|
||||
<location filename="../src/gui.cpp" line="692"/>
|
||||
<source>POIs</source>
|
||||
<translation>POI body</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="348"/>
|
||||
<location filename="../src/gui.cpp" line="889"/>
|
||||
<location filename="../src/gui.cpp" line="395"/>
|
||||
<location filename="../src/gui.cpp" line="942"/>
|
||||
<source>Distance</source>
|
||||
<translation>Vzdálenost</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="355"/>
|
||||
<location filename="../src/gui.cpp" line="477"/>
|
||||
<location filename="../src/gui.cpp" line="891"/>
|
||||
<location filename="../src/gui.cpp" line="402"/>
|
||||
<location filename="../src/gui.cpp" line="524"/>
|
||||
<location filename="../src/gui.cpp" line="944"/>
|
||||
<source>Time</source>
|
||||
<translation>Čas</translation>
|
||||
</message>
|
||||
|
1084
lang/gpxsee_de.ts
Normal file
1084
lang/gpxsee_de.ts
Normal file
File diff suppressed because it is too large
Load Diff
@ -190,290 +190,320 @@
|
||||
<context>
|
||||
<name>GUI</name>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="578"/>
|
||||
<location filename="../src/gui.cpp" line="625"/>
|
||||
<source>GPXSee is distributed under the terms of the GNU General Public License version 3. For more info about GPXSee visit the project homepage at </source>
|
||||
<translation>GPXSee distribueras under vilkoren för GNU General Public License version 3. För mer info om GPXSee, besök hemsidan på </translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="650"/>
|
||||
<location filename="../src/gui.cpp" line="703"/>
|
||||
<source>Open file</source>
|
||||
<translation>Öppna fil</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="740"/>
|
||||
<location filename="../src/gui.cpp" line="793"/>
|
||||
<source>Open POI file</source>
|
||||
<translation>Öppna POI-fil</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="237"/>
|
||||
<location filename="../src/gui.cpp" line="284"/>
|
||||
<source>Open</source>
|
||||
<translation>Öppna</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="221"/>
|
||||
<location filename="../src/gui.cpp" line="268"/>
|
||||
<source>Quit</source>
|
||||
<translation>Avsluta</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="229"/>
|
||||
<location filename="../src/gui.cpp" line="594"/>
|
||||
<location filename="../src/gui.cpp" line="595"/>
|
||||
<location filename="../src/gui.cpp" line="276"/>
|
||||
<location filename="../src/gui.cpp" line="641"/>
|
||||
<location filename="../src/gui.cpp" line="642"/>
|
||||
<source>Keyboard controls</source>
|
||||
<translation>Snabbtangenter</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="253"/>
|
||||
<location filename="../src/gui.cpp" line="300"/>
|
||||
<source>Close</source>
|
||||
<translation>Stäng</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="259"/>
|
||||
<location filename="../src/gui.cpp" line="306"/>
|
||||
<source>Reload</source>
|
||||
<translation>Uppdatera</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="508"/>
|
||||
<location filename="../src/gui.cpp" line="555"/>
|
||||
<source>Show</source>
|
||||
<translation>Visa</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="426"/>
|
||||
<location filename="../src/gui.cpp" line="502"/>
|
||||
<location filename="../src/gui.cpp" line="473"/>
|
||||
<location filename="../src/gui.cpp" line="549"/>
|
||||
<source>File</source>
|
||||
<translation>Arkiv</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="105"/>
|
||||
<location filename="../src/gui.cpp" line="108"/>
|
||||
<source>FIT files (*.fit)</source>
|
||||
<translation>FIT-filer (*.fit)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="106"/>
|
||||
<location filename="../src/gui.cpp" line="109"/>
|
||||
<source>IGC files (*.igc)</source>
|
||||
<translation>IGC-filer (*.igc)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="107"/>
|
||||
<location filename="../src/gui.cpp" line="110"/>
|
||||
<source>NMEA files (*.nmea)</source>
|
||||
<translation>NMEA-filer (*.nmea)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="227"/>
|
||||
<location filename="../src/gui.cpp" line="617"/>
|
||||
<location filename="../src/gui.cpp" line="618"/>
|
||||
<location filename="../src/gui.cpp" line="274"/>
|
||||
<location filename="../src/gui.cpp" line="670"/>
|
||||
<location filename="../src/gui.cpp" line="671"/>
|
||||
<source>Data sources</source>
|
||||
<translation>Datakällor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="267"/>
|
||||
<location filename="../src/gui.cpp" line="314"/>
|
||||
<source>Load POI file</source>
|
||||
<translation>Läs in POI-fil</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="270"/>
|
||||
<location filename="../src/gui.cpp" line="317"/>
|
||||
<source>Close POI files</source>
|
||||
<translation>Stäng POI-filer</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="272"/>
|
||||
<location filename="../src/gui.cpp" line="319"/>
|
||||
<source>Overlap POIs</source>
|
||||
<translation>Överlappa POI:er</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="276"/>
|
||||
<location filename="../src/gui.cpp" line="323"/>
|
||||
<source>Show POI labels</source>
|
||||
<translation>Visa POI-namn</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="281"/>
|
||||
<location filename="../src/gui.cpp" line="328"/>
|
||||
<source>Show POIs</source>
|
||||
<translation>Visa POI:er</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="290"/>
|
||||
<location filename="../src/gui.cpp" line="337"/>
|
||||
<source>Show map</source>
|
||||
<translation>Visa karta</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="297"/>
|
||||
<location filename="../src/gui.cpp" line="344"/>
|
||||
<source>Clear tile cache</source>
|
||||
<translation>Rensa kart-cache</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="306"/>
|
||||
<location filename="../src/gui.cpp" line="310"/>
|
||||
<location filename="../src/gui.cpp" line="606"/>
|
||||
<location filename="../src/gui.cpp" line="353"/>
|
||||
<location filename="../src/gui.cpp" line="357"/>
|
||||
<location filename="../src/gui.cpp" line="653"/>
|
||||
<source>Next map</source>
|
||||
<translation>Nästa karta</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="317"/>
|
||||
<location filename="../src/gui.cpp" line="364"/>
|
||||
<source>Show tracks</source>
|
||||
<translation>Visa spår</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="321"/>
|
||||
<location filename="../src/gui.cpp" line="368"/>
|
||||
<source>Show routes</source>
|
||||
<translation>Visa rutter</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="325"/>
|
||||
<location filename="../src/gui.cpp" line="372"/>
|
||||
<source>Show waypoints</source>
|
||||
<translation>Visa vägpunkter</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="329"/>
|
||||
<location filename="../src/gui.cpp" line="376"/>
|
||||
<source>Waypoint labels</source>
|
||||
<translation>Vägpunktsnamn</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="340"/>
|
||||
<location filename="../src/gui.cpp" line="387"/>
|
||||
<source>Show graphs</source>
|
||||
<translation>Visa diagram</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="362"/>
|
||||
<location filename="../src/gui.cpp" line="409"/>
|
||||
<source>Show grid</source>
|
||||
<translation>Visa stödlinjer</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="368"/>
|
||||
<location filename="../src/gui.cpp" line="415"/>
|
||||
<source>Show toolbars</source>
|
||||
<translation>Visa verktygsfält</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="374"/>
|
||||
<location filename="../src/gui.cpp" line="421"/>
|
||||
<source>Total time</source>
|
||||
<translation>Total tid</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="379"/>
|
||||
<location filename="../src/gui.cpp" line="893"/>
|
||||
<location filename="../src/gui.cpp" line="426"/>
|
||||
<location filename="../src/gui.cpp" line="946"/>
|
||||
<source>Moving time</source>
|
||||
<translation>Förflyttningstid</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="386"/>
|
||||
<location filename="../src/gui.cpp" line="433"/>
|
||||
<source>Metric</source>
|
||||
<translation>Meter</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="391"/>
|
||||
<location filename="../src/gui.cpp" line="438"/>
|
||||
<source>Imperial</source>
|
||||
<translation>Imperial</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="397"/>
|
||||
<location filename="../src/gui.cpp" line="444"/>
|
||||
<source>Fullscreen mode</source>
|
||||
<translation>Helskärmsläge</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="403"/>
|
||||
<location filename="../src/gui.cpp" line="450"/>
|
||||
<source>Options...</source>
|
||||
<translation>Alternativ...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="408"/>
|
||||
<location filename="../src/gui.cpp" line="455"/>
|
||||
<source>Next</source>
|
||||
<translation>Nästa</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="411"/>
|
||||
<location filename="../src/gui.cpp" line="458"/>
|
||||
<source>Previous</source>
|
||||
<translation>Föregående</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="415"/>
|
||||
<location filename="../src/gui.cpp" line="462"/>
|
||||
<source>Last</source>
|
||||
<translation>Sista</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="418"/>
|
||||
<location filename="../src/gui.cpp" line="465"/>
|
||||
<source>First</source>
|
||||
<translation>Första</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="440"/>
|
||||
<location filename="../src/gui.cpp" line="487"/>
|
||||
<source>Map</source>
|
||||
<translation>Karta</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="447"/>
|
||||
<location filename="../src/gui.cpp" line="494"/>
|
||||
<source>Graph</source>
|
||||
<translation>Diagram</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="455"/>
|
||||
<location filename="../src/gui.cpp" line="502"/>
|
||||
<source>POI</source>
|
||||
<translation>POI</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="456"/>
|
||||
<location filename="../src/gui.cpp" line="503"/>
|
||||
<source>POI files</source>
|
||||
<translation>POI-filer</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="467"/>
|
||||
<location filename="../src/gui.cpp" line="514"/>
|
||||
<source>Data</source>
|
||||
<translation>Data</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="468"/>
|
||||
<location filename="../src/gui.cpp" line="515"/>
|
||||
<source>Display</source>
|
||||
<translation>Visa</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="476"/>
|
||||
<location filename="../src/gui.cpp" line="523"/>
|
||||
<source>Settings</source>
|
||||
<translation>Inställningar</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="480"/>
|
||||
<location filename="../src/gui.cpp" line="527"/>
|
||||
<source>Units</source>
|
||||
<translation>Enhet</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="489"/>
|
||||
<location filename="../src/gui.cpp" line="536"/>
|
||||
<source>Help</source>
|
||||
<translation>Hjälp</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="607"/>
|
||||
<location filename="../src/gui.cpp" line="651"/>
|
||||
<source>Append file</source>
|
||||
<translation>Lägg till fil</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="652"/>
|
||||
<source>Next/Previous</source>
|
||||
<translation>Nästa/Föregående</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="655"/>
|
||||
<source>Previous map</source>
|
||||
<translation>Föregående karta</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="620"/>
|
||||
<location filename="../src/gui.cpp" line="656"/>
|
||||
<source>Zoom in</source>
|
||||
<translation>Zooma in</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="658"/>
|
||||
<source>Zoom out</source>
|
||||
<translation>Zooma ut</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="660"/>
|
||||
<source>Digital zoom</source>
|
||||
<translation>Digital zoom</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="661"/>
|
||||
<source>Zoom</source>
|
||||
<translation>Zoom</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="673"/>
|
||||
<source>Online maps</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Online-kartor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="621"/>
|
||||
<location filename="../src/gui.cpp" line="674"/>
|
||||
<source>Online map URLs are read on program startup from the following file:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Online-kartors URL:er, läses från följande fil vid programstart:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="631"/>
|
||||
<source>Ofline maps</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<location filename="../src/gui.cpp" line="684"/>
|
||||
<source>Offline maps</source>
|
||||
<translation>Offline-kartor</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="632"/>
|
||||
<location filename="../src/gui.cpp" line="685"/>
|
||||
<source>Offline maps are loaded on program startup from the following directory:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Offline-kartor läses in från följande mapp vid programstart:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="635"/>
|
||||
<source>The expected structure is one map/atlas in a separate subdirectory. Supported map formats are OziMap image-based maps and tiled TrekBuddy maps/atlases (tared and non-tared).</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<location filename="../src/gui.cpp" line="688"/>
|
||||
<source>The expected structure is one map/atlas in a separate subdirectory. Supported map formats are OziExplorer image-based maps and tiled TrekBuddy maps/atlases (tared and non-tared).</source>
|
||||
<translation>Den förväntade strukturen är en karta/atlas i en separat undermapp. Kartformat som stöds är OziExplorer bildbaserade kartor och rutindelade TrekBuddy-kartor/-kartsamlingar (tarerade och icke tarerade).</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="1091"/>
|
||||
<location filename="../src/gui.cpp" line="1144"/>
|
||||
<source>No files loaded</source>
|
||||
<translation>Inga filer inlästa</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<location filename="../src/gui.cpp" line="1095"/>
|
||||
<location filename="../src/gui.cpp" line="1148"/>
|
||||
<source>%n files</source>
|
||||
<translation>
|
||||
<numerusform>%n filer</numerusform>
|
||||
@ -481,158 +511,153 @@
|
||||
</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="106"/>
|
||||
<location filename="../src/gui.cpp" line="109"/>
|
||||
<source>GPX files (*.gpx)</source>
|
||||
<translation>GPX-filer (*.gpx)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="108"/>
|
||||
<location filename="../src/gui.cpp" line="111"/>
|
||||
<source>TCX files (*.tcx)</source>
|
||||
<translation>TCX-filer (*.tcx)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="107"/>
|
||||
<location filename="../src/gui.cpp" line="110"/>
|
||||
<source>KML files (*.kml)</source>
|
||||
<translation>KML-filer (*.kml)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="105"/>
|
||||
<location filename="../src/gui.cpp" line="108"/>
|
||||
<source>CSV files (*.csv)</source>
|
||||
<translation>CSV-filer (*.csv)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="108"/>
|
||||
<location filename="../src/gui.cpp" line="111"/>
|
||||
<source>All files (*)</source>
|
||||
<translation>Alla filer (*)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="879"/>
|
||||
<location filename="../src/gui.cpp" line="882"/>
|
||||
<location filename="../src/gui.cpp" line="932"/>
|
||||
<location filename="../src/gui.cpp" line="935"/>
|
||||
<source>Date</source>
|
||||
<translation>Datum</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="871"/>
|
||||
<location filename="../src/gui.cpp" line="924"/>
|
||||
<source>Routes</source>
|
||||
<translation>Rutter</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="597"/>
|
||||
<location filename="../src/gui.cpp" line="645"/>
|
||||
<source>Next file</source>
|
||||
<translation>Nästa fil</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="575"/>
|
||||
<location filename="../src/gui.cpp" line="622"/>
|
||||
<source>Version </source>
|
||||
<translation>Version </translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="242"/>
|
||||
<location filename="../src/gui.cpp" line="289"/>
|
||||
<source>Print...</source>
|
||||
<translation>Skriv ut...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="247"/>
|
||||
<location filename="../src/gui.cpp" line="294"/>
|
||||
<source>Export to PDF...</source>
|
||||
<translation>Exportera till PDF...</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="873"/>
|
||||
<location filename="../src/gui.cpp" line="926"/>
|
||||
<source>Waypoints</source>
|
||||
<translation>Vägpunkter</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="599"/>
|
||||
<location filename="../src/gui.cpp" line="646"/>
|
||||
<source>Previous file</source>
|
||||
<translation>Föregående fil</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="104"/>
|
||||
<location filename="../src/gui.cpp" line="107"/>
|
||||
<source>Supported files (*.csv *.fit *.gpx *.igc *.kml *.nmea *.tcx)</source>
|
||||
<translation>Filer som stöds (*.csv *.fit *.gpx *.igc *.kml *.nmea *.tcx)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="333"/>
|
||||
<location filename="../src/gui.cpp" line="380"/>
|
||||
<source>Route waypoints</source>
|
||||
<translation>Ruttvägpunkter</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="601"/>
|
||||
<location filename="../src/gui.cpp" line="648"/>
|
||||
<source>First file</source>
|
||||
<translation>Första filen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="603"/>
|
||||
<location filename="../src/gui.cpp" line="650"/>
|
||||
<source>Last file</source>
|
||||
<translation>Sista filen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="604"/>
|
||||
<source>Append modifier</source>
|
||||
<translation>Tillämpa modifierare</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="624"/>
|
||||
<location filename="../src/gui.cpp" line="677"/>
|
||||
<source>The file format is one map entry per line, consisting of the map name and tiles URL delimited by a TAB character. The tile X and Y coordinates are replaced with $x and $y in the URL and the zoom level is replaced with $z. An example map file could look like:</source>
|
||||
<translation>Filformatet är en kartpost per rad, bestående av kartnamn och kartrutans URL, avgränsade med ett TAB-tecken. Kartrutans X- och Y-koordinater ersätts med $x och $y i URL:en och zoomnivån ersätts med $z. Exempel på en kartfil kan se ut så här:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="640"/>
|
||||
<location filename="../src/gui.cpp" line="693"/>
|
||||
<source>To make GPXSee load a POI file automatically on startup, add the file to the following directory:</source>
|
||||
<translation>För att GPXSee skall läsa in en POI-fil automatiskt vid programstart, läggs filen i följande mapp:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="729"/>
|
||||
<location filename="../src/gui.cpp" line="782"/>
|
||||
<source>Error loading data file:</source>
|
||||
<translation>Fel vid inläsning av datafil:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="732"/>
|
||||
<location filename="../src/gui.cpp" line="757"/>
|
||||
<location filename="../src/gui.cpp" line="785"/>
|
||||
<location filename="../src/gui.cpp" line="810"/>
|
||||
<source>Line: %1</source>
|
||||
<translation>Rad: %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="754"/>
|
||||
<location filename="../src/gui.cpp" line="807"/>
|
||||
<source>Error loading POI file:</source>
|
||||
<translation>Fel vid inläsning av POI-fil:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="865"/>
|
||||
<location filename="../src/gui.cpp" line="918"/>
|
||||
<source>Name</source>
|
||||
<translation>Namn</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="869"/>
|
||||
<location filename="../src/gui.cpp" line="922"/>
|
||||
<source>Tracks</source>
|
||||
<translation>Spår</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="232"/>
|
||||
<location filename="../src/gui.cpp" line="574"/>
|
||||
<location filename="../src/gui.cpp" line="279"/>
|
||||
<location filename="../src/gui.cpp" line="621"/>
|
||||
<source>About GPXSee</source>
|
||||
<translation>Om GPXSee</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="513"/>
|
||||
<location filename="../src/gui.cpp" line="560"/>
|
||||
<source>Navigation</source>
|
||||
<translation>Navigation</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="639"/>
|
||||
<location filename="../src/gui.cpp" line="692"/>
|
||||
<source>POIs</source>
|
||||
<translation>POI:er</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="348"/>
|
||||
<location filename="../src/gui.cpp" line="889"/>
|
||||
<location filename="../src/gui.cpp" line="395"/>
|
||||
<location filename="../src/gui.cpp" line="942"/>
|
||||
<source>Distance</source>
|
||||
<translation>Avstånd</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui.cpp" line="355"/>
|
||||
<location filename="../src/gui.cpp" line="477"/>
|
||||
<location filename="../src/gui.cpp" line="891"/>
|
||||
<location filename="../src/gui.cpp" line="402"/>
|
||||
<location filename="../src/gui.cpp" line="524"/>
|
||||
<location filename="../src/gui.cpp" line="944"/>
|
||||
<source>Time</source>
|
||||
<translation>Tid</translation>
|
||||
</message>
|
||||
|
123
pkg/datums.csv
Normal file
123
pkg/datums.csv
Normal file
@ -0,0 +1,123 @@
|
||||
Adindan,4201,5,-162,-12,206
|
||||
Afgooye,4205,15,-43,-163,45
|
||||
Ain el Abd 1970,4204,14,-150,-251,-2
|
||||
Anna 1 Astro 1965,4708,2,-491,-22,435
|
||||
Arc 1950,4209,5,-143,-90,-294
|
||||
Arc 1960,4210,5,-160,-8,-300
|
||||
Ascension Island 1958,4712,14,-207,107,52
|
||||
Astro B4 Sorol Atoll,4707,14,114,-116,-333
|
||||
Astro Beacon 1945,4709,14,145,75,-272
|
||||
Astro DOS 71/4,4710,14,-320,550,-494
|
||||
Astronomic Stn 1952,4711,14,124,-234,-25
|
||||
Australian Geodetic 1966,4202,2,-133,-48,148
|
||||
Australian Geodetic 1984,4203,2,-134,-48,149
|
||||
Australian Geocentric 1994 (GDA94),4283,11,0,0,0
|
||||
Austrian,4312,3,594,84,471
|
||||
Bellevue (IGN),4714,14,-127,-769,472
|
||||
Bermuda 1957,4216,4,-73,213,296
|
||||
Bogota Observatory,4218,14,307,304,-318
|
||||
Campo Inchauspe,4221,14,-148,136,90
|
||||
Canton Astro 1966,4716,14,298,-304,-375
|
||||
Cape,4222,5,-136,-108,-292
|
||||
Cape Canaveral,4717,4,-2,150,181
|
||||
Carthage,4223,5,-263,6,431
|
||||
CH-1903,4149,3,674,15,405
|
||||
Chatham 1971,4672,14,175,-38,113
|
||||
Chua Astro,4224,14,-134,229,-29
|
||||
Corrego Alegre,4225,14,-206,172,-6
|
||||
Djakarta (Batavia),4211,3,-377,681,-50
|
||||
DOS 1968,,14,230,-199,-752
|
||||
Easter Island 1967,4719,14,211,147,111
|
||||
Egypt,,14,-130,-117,-151
|
||||
European 1950,4230,14,-87,-98,-121
|
||||
European 1950 (Mean France),,14,-87,-96,-120
|
||||
European 1950 (Spain and Portugal),,14,-84,-107,-120
|
||||
European 1979,4668,14,-86,-98,-119
|
||||
Finland Hayford,4123,14,-78,-231,-97
|
||||
Gandajika Base,4233,14,-133,-321,50
|
||||
Geodetic Datum 1949,4272,14,84,-22,209
|
||||
GGRS 87,4121,11,-199.87,74.79,246.62
|
||||
Guam 1963,4675,4,-100,-248,259
|
||||
GUX 1 Astro,4718,14,252,-209,-751
|
||||
Hartebeeshoek94,4148,20,0,0,0
|
||||
Hermannskogel,3906,3,653,-212,449
|
||||
Hjorsey 1955,4658,14,-73,46,-86
|
||||
Hong Kong 1963,4739,14,-156,-271,-189
|
||||
Hu-Tzu-Shan,4236,14,-634,-549,-201
|
||||
Indian Bangladesh,4682,6,289,734,257
|
||||
Indian Thailand,4240,6,214,836,303
|
||||
Israeli,4281,23,-235,-85,264
|
||||
Ireland 1965,4299,1,506,-122,611
|
||||
ISTS 073 Astro 1969,4724,14,208,-435,-229
|
||||
Johnston Island,4725,14,191,-77,-204
|
||||
Kandawala,4244,6,-97,787,86
|
||||
Kerguelen Island,4698,14,145,-187,103
|
||||
Kertau 1948,4245,7,-11,851,5
|
||||
L.C. 5 Astro,4726,4,42,124,147
|
||||
Liberia 1964,4251,5,-90,40,88
|
||||
Luzon Mindanao,,4,-133,-79,-72
|
||||
Luzon Philippines,4253,4,-133,-77,-51
|
||||
Mahe 1971,4256,5,41,-220,-134
|
||||
Marco Astro,4616,14,-289,-124,60
|
||||
Massawa,4262,3,639,405,60
|
||||
Merchich,4261,5,31,146,47
|
||||
Midway Astro 1961,4727,14,912,-58,1227
|
||||
Minna,4263,5,-92,-93,122
|
||||
NAD27 Alaska,,4,-5,135,172
|
||||
NAD27 Bahamas,,4,-4,154,178
|
||||
NAD27 Canada,,4,-10,158,187
|
||||
NAD27 Canal Zone,,4,0,125,201
|
||||
NAD27 Caribbean,,4,-7,152,178
|
||||
NAD27 Central,,4,0,125,194
|
||||
NAD27 CONUS,,4,-8,160,176
|
||||
NAD27 Cuba,,4,-9,152,178
|
||||
NAD27 Greenland,,4,11,114,195
|
||||
NAD27 Mexico,,4,-12,130,190
|
||||
NAD27 San Salvador,,4,1,140,165
|
||||
NAD83,4269,11,0,0,0
|
||||
Nahrwn Masirah Ilnd,,5,-247,-148,369
|
||||
Nahrwn Saudi Arbia,,5,-231,-196,482
|
||||
Nahrwn United Arab,,5,-249,-156,381
|
||||
Naparima BWI,4271,14,-2,374,172
|
||||
NGO1948,4273,27,315,-217,528
|
||||
NTF France,4275,24,-168,-60,320
|
||||
Norsk,4817,27,278,93,474
|
||||
NZGD1949,4272,14,84,-22,209
|
||||
NZGD2000,4167,20,0,0,0
|
||||
Observatorio 1966,4182,14,-425,-169,81
|
||||
Old Egyptian,4229,12,-130,110,-13
|
||||
Old Hawaiian,4135,4,61,-285,-181
|
||||
Oman,4232,5,-346,-1,224
|
||||
Ord Srvy Grt Britn,4277,0,375,-111,431
|
||||
Pico De Las Nieves,4728,14,-307,-92,127
|
||||
Pitcairn Astro 1967,4729,14,185,165,42
|
||||
Potsdam Rauenberg DHDN,4314,3,606,23,413
|
||||
Prov So Amrican 1956,4248,14,-288,175,-376
|
||||
Prov So Chilean 1963,4254,14,16,196,93
|
||||
Puerto Rico,4139,4,11,72,-101
|
||||
Pulkovo 1942 (1),4284,15,28,-130,-95
|
||||
Pulkovo 1942 (2),4284,15,28,-130,-95
|
||||
Qatar National,4285,14,-128,-283,22
|
||||
Qornoq,4287,14,164,138,-189
|
||||
Reunion,4626,14,94,-948,-1262
|
||||
Rijksdriehoeksmeting,4289,3,593,26,478
|
||||
Rome 1940,4806,14,-225,-65,9
|
||||
RT 90,4124,3,498,-36,568
|
||||
S42,4179,15,28,-121,-77
|
||||
Santo (DOS),4730,14,170,42,84
|
||||
Sao Braz,4184,14,-203,141,53
|
||||
Sapper Hill 1943,4292,14,-355,16,74
|
||||
Schwarzeck,4293,21,616,97,-251
|
||||
South American 1969,4291,16,-57,1,-41
|
||||
South Asia,,8,7,-10,-26
|
||||
Southeast Base,4615,14,-499,-249,314
|
||||
Southwest Base,4183,14,-104,167,-38
|
||||
Timbalai 1948,4298,6,-689,691,-46
|
||||
Tokyo,4301,3,-128,481,664
|
||||
Tristan Astro 1968,4734,14,-632,438,-609
|
||||
Viti Levu 1916,4731,5,51,391,-36
|
||||
Wake-Eniwetok 1960,4732,13,101,52,-39
|
||||
WGS 72,4322,19,0,0,5
|
||||
WGS 84,4326,20,0,0,0
|
||||
Yacare,4309,14,-155,171,37
|
||||
Zanderij,4311,14,-265,120,-358
|
|
30
pkg/ellipsoids.csv
Normal file
30
pkg/ellipsoids.csv
Normal file
@ -0,0 +1,30 @@
|
||||
0,Airy 1830,6377563.396,299.3249646
|
||||
1,Modified Airy,6377340.189,299.3249646
|
||||
2,Australian National,6378160.0,298.25
|
||||
3,Bessel 1841,6377397.155,299.1528128
|
||||
4,Clarke 1866,6378206.4,294.9786982
|
||||
5,Clarke 1880,6378249.145,293.465
|
||||
6,Everest (India 1830),6377276.345,300.8017
|
||||
7,Everest (1948),6377304.063,300.8017
|
||||
8,Modified Fischer 1960,6378155.0,298.3
|
||||
9,Everest (Pakistan),6377309.613,300.8017
|
||||
10,Indonesian 1974,6378160.0,298.247
|
||||
11,GRS 80,6378137.0,298.257222101
|
||||
12,Helmert 1906,6378200.0,298.3
|
||||
13,Hough 1960,6378270.0,297.0
|
||||
14,International 1924,6378388.0,297.0
|
||||
15,Krassovsky 1940,6378245.0,298.3
|
||||
16,South American 1969,6378160.0,298.25
|
||||
17,Everest (Malaysia 1969),6377295.664,300.8017
|
||||
18,Everest (Sabah Sarawak),6377298.556,300.8017
|
||||
19,WGS 72,6378135.0,298.26
|
||||
20,WGS 84,6378137.0,298.257223563
|
||||
21,Bessel 1841 (Namibia),6377483.865,299.1528128
|
||||
22,Everest (India 1956),6377301.243,300.8017
|
||||
23,Clarke 1880 Palestine,6378300.789,293.466
|
||||
24,Clarke 1880 IGN,6378249.2,293.466021
|
||||
25,Hayford 1909,6378388.0,296.959263
|
||||
26,Clarke 1858,6378350.87,294.26
|
||||
27,Bessel 1841 (Norway),6377492.0176,299.1528
|
||||
28,Plessis 1817 (France),6376523.0,308.6409971
|
||||
29,Hayford 1924,6378388.0,297.0
|
|
@ -5,7 +5,7 @@
|
||||
; The name of the installer
|
||||
Name "GPXSee"
|
||||
; Program version
|
||||
!define VERSION "4.0"
|
||||
!define VERSION "4.4"
|
||||
|
||||
; The file to write
|
||||
OutFile "GPXSee-${VERSION}.exe"
|
||||
@ -82,6 +82,8 @@ Section "GPXSee" SEC_APP
|
||||
; Put the files there
|
||||
File "gpxsee.exe"
|
||||
File "maps.txt"
|
||||
File "ellipsoids.csv"
|
||||
File "datums.csv"
|
||||
|
||||
; Create start menu entry and add links
|
||||
SetShellVarContext all
|
||||
@ -250,4 +252,4 @@ LangString DESC_APP ${LANG_ENGLISH} \
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_ANGLE} $(DESC_ANGLE)
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_MSVC} $(DESC_MSVC)
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_APP} $(DESC_APP)
|
||||
!insertmacro MUI_FUNCTION_DESCRIPTION_END
|
||||
!insertmacro MUI_FUNCTION_DESCRIPTION_END
|
||||
|
@ -5,7 +5,7 @@
|
||||
; The name of the installer
|
||||
Name "GPXSee"
|
||||
; Program version
|
||||
!define VERSION "4.0"
|
||||
!define VERSION "4.4"
|
||||
|
||||
; The file to write
|
||||
OutFile "GPXSee-${VERSION}_x64.exe"
|
||||
@ -89,6 +89,8 @@ Section "GPXSee" SEC_APP
|
||||
; Put the files there
|
||||
File "gpxsee.exe"
|
||||
File "maps.txt"
|
||||
File "ellipsoids.csv"
|
||||
File "datums.csv"
|
||||
|
||||
; Create start menu entry and add links
|
||||
SetShellVarContext all
|
||||
@ -253,4 +255,4 @@ LangString DESC_APP ${LANG_ENGLISH} \
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_ANGLE} $(DESC_ANGLE)
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_MSVC} $(DESC_MSVC)
|
||||
!insertmacro MUI_DESCRIPTION_TEXT ${SEC_APP} $(DESC_APP)
|
||||
!insertmacro MUI_FUNCTION_DESCRIPTION_END
|
||||
!insertmacro MUI_FUNCTION_DESCRIPTION_END
|
||||
|
@ -30,17 +30,17 @@ static bool yCmp(const OfflineMap *m1, const OfflineMap *m2)
|
||||
return TL(m1).y() > TL(m2).y();
|
||||
}
|
||||
|
||||
bool Atlas::isAtlas(const QFileInfoList &files)
|
||||
bool Atlas::isAtlas(Tar &tar, const QFileInfoList &files)
|
||||
{
|
||||
for (int i = 0; i < files.count(); i++) {
|
||||
const QString &fileName = files.at(i).fileName();
|
||||
if (fileName.endsWith(".tar")) {
|
||||
if (!_tar.load(files.at(i).absoluteFilePath())) {
|
||||
if (!tar.load(files.at(i).absoluteFilePath())) {
|
||||
qWarning("%s: %s: error loading tar file", qPrintable(_name),
|
||||
qPrintable(fileName));
|
||||
return false;
|
||||
}
|
||||
QStringList tarFiles = _tar.files();
|
||||
QStringList tarFiles = tar.files();
|
||||
for (int j = 0; j < tarFiles.size(); j++)
|
||||
if (tarFiles.at(j).endsWith(".tba"))
|
||||
return true;
|
||||
@ -83,19 +83,15 @@ void Atlas::computeBounds()
|
||||
qSort(m.begin(), m.end(), xCmp);
|
||||
offsets[_maps.indexOf(m.first())].setX(w);
|
||||
for (int i = 1; i < m.size(); i++) {
|
||||
if (TL(m.at(i)).x() > TL(m.at(i-1)).x()) {
|
||||
w += round(m.at(i-1)->pp2xy(TL(m.at(i))).x());
|
||||
offsets[_maps.indexOf(m.at(i))].setX(w);
|
||||
}
|
||||
w += round(m.at(i-1)->pp2xy(TL(m.at(i))).x());
|
||||
offsets[_maps.indexOf(m.at(i))].setX(w);
|
||||
}
|
||||
|
||||
qSort(m.begin(), m.end(), yCmp);
|
||||
offsets[_maps.indexOf(m.first())].setY(h);
|
||||
for (int i = 1; i < m.size(); i++) {
|
||||
if (TL(m.at(i)).y() < TL(m.at(i-1)).y()) {
|
||||
h += round(m.at(i-1)->pp2xy(TL(m.at(i))).y());
|
||||
offsets[_maps.indexOf(m.at(i))].setY(h);
|
||||
}
|
||||
h += round(m.at(i-1)->pp2xy(TL(m.at(i))).y());
|
||||
offsets[_maps.indexOf(m.at(i))].setY(h);
|
||||
}
|
||||
}
|
||||
|
||||
@ -106,14 +102,17 @@ void Atlas::computeBounds()
|
||||
|
||||
Atlas::Atlas(const QString &path, QObject *parent) : Map(parent)
|
||||
{
|
||||
Tar tar;
|
||||
|
||||
_valid = false;
|
||||
_zoom = 0;
|
||||
|
||||
QFileInfo fi(path);
|
||||
_name = fi.fileName();
|
||||
|
||||
QDir dir(path);
|
||||
QFileInfoList files = dir.entryInfoList(QDir::Files);
|
||||
if (!isAtlas(files))
|
||||
if (!isAtlas(tar, files))
|
||||
return;
|
||||
|
||||
QFileInfoList layers = dir.entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot);
|
||||
@ -123,8 +122,8 @@ Atlas::Atlas(const QString &path, QObject *parent) : Map(parent)
|
||||
| QDir::NoDotAndDotDot);
|
||||
for (int i = 0; i < maps.count(); i++) {
|
||||
OfflineMap *map;
|
||||
if (_tar.isOpen())
|
||||
map = new OfflineMap(_tar, maps.at(i).absoluteFilePath(), this);
|
||||
if (tar.isOpen())
|
||||
map = new OfflineMap(tar, maps.at(i).absoluteFilePath(), this);
|
||||
else
|
||||
map = new OfflineMap(maps.at(i).absoluteFilePath(), this);
|
||||
if (map->isValid())
|
||||
@ -139,7 +138,6 @@ Atlas::Atlas(const QString &path, QObject *parent) : Map(parent)
|
||||
computeZooms();
|
||||
computeBounds();
|
||||
|
||||
_zoom = 0;
|
||||
_valid = true;
|
||||
}
|
||||
|
||||
|
@ -33,14 +33,13 @@ public:
|
||||
|
||||
private:
|
||||
void draw(QPainter *painter, const QRectF &rect, int mapIndex);
|
||||
bool isAtlas(const QFileInfoList &files);
|
||||
bool isAtlas(Tar &tar, const QFileInfoList &files);
|
||||
void computeZooms();
|
||||
void computeBounds();
|
||||
|
||||
QString _name;
|
||||
bool _valid;
|
||||
|
||||
Tar _tar;
|
||||
QList<OfflineMap*> _maps;
|
||||
QVector<QPair<int, int> > _zooms;
|
||||
QVector<QPair<QRectF, QRectF> > _bounds;
|
||||
|
20
src/config.h
20
src/config.h
@ -13,6 +13,8 @@
|
||||
#define FONT_SIZE 12
|
||||
#define SCREEN_DPI 96.0
|
||||
|
||||
#define ELLIPSOID_FILE QString("ellipsoids.csv")
|
||||
#define DATUM_FILE QString("datums.csv")
|
||||
#define MAP_FILE QString("maps.txt")
|
||||
#define MAP_DIR QString("maps")
|
||||
#define POI_DIR QString("POI")
|
||||
@ -29,12 +31,16 @@
|
||||
#define GLOBAL_DIR QString("/usr/share/gpxsee")
|
||||
#endif
|
||||
|
||||
#define USER_MAP_DIR USER_DIR + QString("/") + MAP_DIR
|
||||
#define USER_MAP_FILE USER_DIR + QString("/") + MAP_FILE
|
||||
#define USER_POI_DIR USER_DIR + QString("/") + POI_DIR
|
||||
#define GLOBAL_MAP_DIR GLOBAL_DIR + QString("/") + MAP_DIR
|
||||
#define GLOBAL_MAP_FILE GLOBAL_DIR + QString("/") + MAP_FILE
|
||||
#define GLOBAL_POI_DIR GLOBAL_DIR + QString("/") + POI_DIR
|
||||
#define TILES_DIR USER_DIR + QString("/tiles")
|
||||
#define USER_ELLIPSOID_FILE USER_DIR + QString("/") + ELLIPSOID_FILE
|
||||
#define USER_DATUM_FILE USER_DIR + QString("/") + DATUM_FILE
|
||||
#define USER_MAP_DIR USER_DIR + QString("/") + MAP_DIR
|
||||
#define USER_MAP_FILE USER_DIR + QString("/") + MAP_FILE
|
||||
#define USER_POI_DIR USER_DIR + QString("/") + POI_DIR
|
||||
#define GLOBAL_ELLIPSOID_FILE GLOBAL_DIR + QString("/") + ELLIPSOID_FILE
|
||||
#define GLOBAL_DATUM_FILE GLOBAL_DIR + QString("/") + DATUM_FILE
|
||||
#define GLOBAL_MAP_DIR GLOBAL_DIR + QString("/") + MAP_DIR
|
||||
#define GLOBAL_MAP_FILE GLOBAL_DIR + QString("/") + MAP_FILE
|
||||
#define GLOBAL_POI_DIR GLOBAL_DIR + QString("/") + POI_DIR
|
||||
#define TILES_DIR USER_DIR + QString("/tiles")
|
||||
|
||||
#endif /* CONFIG_H */
|
||||
|
83
src/datum.cpp
Normal file
83
src/datum.cpp
Normal file
@ -0,0 +1,83 @@
|
||||
#include <QFile>
|
||||
#include "wgs84.h"
|
||||
#include "datum.h"
|
||||
|
||||
|
||||
static QMap<QString, Datum> WGS84()
|
||||
{
|
||||
QMap<QString, Datum> map;
|
||||
map.insert("WGS 84", Datum(Ellipsoid(WGS84_RADIUS, WGS84_FLATTENING),
|
||||
0, 0, 0));
|
||||
return map;
|
||||
}
|
||||
|
||||
QMap<QString, Datum> Datum::_datums = WGS84();
|
||||
QString Datum::_errorString;
|
||||
int Datum::_errorLine = 0;
|
||||
|
||||
Datum Datum::datum(const QString &name)
|
||||
{
|
||||
QMap<QString, Datum>::const_iterator it = _datums.find(name);
|
||||
|
||||
if (it == _datums.end())
|
||||
return Datum();
|
||||
|
||||
return it.value();
|
||||
}
|
||||
|
||||
bool Datum::loadList(const QString &path)
|
||||
{
|
||||
QFile file(path);
|
||||
bool res;
|
||||
|
||||
if (!file.open(QFile::ReadOnly)) {
|
||||
_errorString = qPrintable(file.errorString());
|
||||
return false;
|
||||
}
|
||||
|
||||
_errorLine = 1;
|
||||
_errorString.clear();
|
||||
|
||||
while (!file.atEnd()) {
|
||||
QByteArray line = file.readLine();
|
||||
QList<QByteArray> list = line.split(',');
|
||||
if (list.size() != 6) {
|
||||
_errorString = "Format error";
|
||||
return false;
|
||||
}
|
||||
|
||||
int eid = list[2].trimmed().toInt(&res);
|
||||
if (!res) {
|
||||
_errorString = "Invalid ellipsoid id";
|
||||
return false;
|
||||
}
|
||||
double dx = list[3].trimmed().toDouble(&res);
|
||||
if (!res) {
|
||||
_errorString = "Invalid dx";
|
||||
return false;
|
||||
}
|
||||
double dy = list[4].trimmed().toDouble(&res);
|
||||
if (!res) {
|
||||
_errorString = "Invalid dy";
|
||||
return false;
|
||||
}
|
||||
double dz = list[5].trimmed().toDouble(&res);
|
||||
if (!res) {
|
||||
_errorString = "Invalid dz";
|
||||
return false;
|
||||
}
|
||||
|
||||
Ellipsoid e = Ellipsoid::ellipsoid(eid);
|
||||
if (e.isNull()) {
|
||||
_errorString = "Unknown ellipsoid ID";
|
||||
return false;
|
||||
}
|
||||
|
||||
Datum d(e, dx, dy, dz);
|
||||
_datums.insert(list[0].trimmed(), d);
|
||||
|
||||
_errorLine++;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
38
src/datum.h
Normal file
38
src/datum.h
Normal file
@ -0,0 +1,38 @@
|
||||
#ifndef DATUM_H
|
||||
#define DATUM_H
|
||||
|
||||
#include <QMap>
|
||||
#include "ellipsoid.h"
|
||||
|
||||
class Datum
|
||||
{
|
||||
public:
|
||||
Datum() : _ellipsoid(Ellipsoid()), _dx(0), _dy(0), _dz(0) {}
|
||||
Datum(const Ellipsoid &ellipsoid, double dx, double dy, double dz)
|
||||
: _ellipsoid(ellipsoid), _dx(dx), _dy(dy), _dz(dz) {}
|
||||
|
||||
const Ellipsoid &ellipsoid() const {return _ellipsoid;}
|
||||
double dx() const {return _dx;}
|
||||
double dy() const {return _dy;}
|
||||
double dz() const {return _dz;}
|
||||
|
||||
bool isNull() const {return _ellipsoid.isNull();}
|
||||
bool isWGS84() const
|
||||
{return _ellipsoid.isWGS84() && _dx == 0 && _dy == 0 && _dz == 0;}
|
||||
|
||||
static bool loadList(const QString &path);
|
||||
static const QString &errorString() {return _errorString;}
|
||||
static int errorLine() {return _errorLine;}
|
||||
|
||||
static Datum datum(const QString &name);
|
||||
|
||||
private:
|
||||
Ellipsoid _ellipsoid;
|
||||
double _dx, _dy, _dz;
|
||||
|
||||
static QMap<QString, Datum> _datums;
|
||||
static QString _errorString;
|
||||
static int _errorLine;
|
||||
};
|
||||
|
||||
#endif // DATUM_H
|
62
src/ellipsoid.cpp
Normal file
62
src/ellipsoid.cpp
Normal file
@ -0,0 +1,62 @@
|
||||
#include <QFile>
|
||||
#include "ellipsoid.h"
|
||||
|
||||
QMap<int, Ellipsoid> Ellipsoid::_ellipsoids;
|
||||
QString Ellipsoid::_errorString;
|
||||
int Ellipsoid::_errorLine = 0;
|
||||
|
||||
Ellipsoid Ellipsoid::ellipsoid(int id)
|
||||
{
|
||||
QMap<int, Ellipsoid>::const_iterator it = _ellipsoids.find(id);
|
||||
|
||||
if (it == _ellipsoids.end())
|
||||
return Ellipsoid();
|
||||
|
||||
return it.value();
|
||||
}
|
||||
|
||||
bool Ellipsoid::loadList(const QString &path)
|
||||
{
|
||||
QFile file(path);
|
||||
bool res;
|
||||
|
||||
if (!file.open(QFile::ReadOnly)) {
|
||||
_errorString = qPrintable(file.errorString());
|
||||
return false;
|
||||
}
|
||||
|
||||
_errorLine = 1;
|
||||
_errorString.clear();
|
||||
|
||||
while (!file.atEnd()) {
|
||||
QByteArray line = file.readLine();
|
||||
QList<QByteArray> list = line.split(',');
|
||||
if (list.size() != 4) {
|
||||
_errorString = "Format error";
|
||||
return false;
|
||||
}
|
||||
|
||||
int id = list[0].trimmed().toInt(&res);
|
||||
if (!res) {
|
||||
_errorString = "Invalid ellipsoid id";
|
||||
return false;
|
||||
}
|
||||
double radius = list[2].trimmed().toDouble(&res);
|
||||
if (!res) {
|
||||
_errorString = "Invalid ellipsoid radius";
|
||||
return false;
|
||||
}
|
||||
double flattening = list[3].trimmed().toDouble(&res);
|
||||
if (!res) {
|
||||
_errorString = "Invalid ellipsoid flattening";
|
||||
return false;
|
||||
}
|
||||
|
||||
Ellipsoid e(radius, 1.0/flattening);
|
||||
_ellipsoids.insert(id, e);
|
||||
|
||||
_errorLine++;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
37
src/ellipsoid.h
Normal file
37
src/ellipsoid.h
Normal file
@ -0,0 +1,37 @@
|
||||
#ifndef ELLIPSOID_H
|
||||
#define ELLIPSOID_H
|
||||
|
||||
#include <QString>
|
||||
#include <QMap>
|
||||
#include "wgs84.h"
|
||||
|
||||
class Ellipsoid
|
||||
{
|
||||
public:
|
||||
Ellipsoid() : _radius(-1.0), _flattening(-1.0) {}
|
||||
Ellipsoid(double radius, double flattening)
|
||||
: _radius(radius), _flattening(flattening) {}
|
||||
|
||||
double radius() const {return _radius;}
|
||||
double flattening() const {return _flattening;}
|
||||
|
||||
bool isNull() const {return _radius < 0 || _flattening < 0;}
|
||||
bool isWGS84() const
|
||||
{return _radius == WGS84_RADIUS && _flattening == WGS84_FLATTENING;}
|
||||
|
||||
static bool loadList(const QString &path);
|
||||
static const QString &errorString() {return _errorString;}
|
||||
static int errorLine() {return _errorLine;}
|
||||
|
||||
static Ellipsoid ellipsoid(int id);
|
||||
|
||||
private:
|
||||
double _radius;
|
||||
double _flattening;
|
||||
|
||||
static QMap<int, Ellipsoid> _ellipsoids;
|
||||
static QString _errorString;
|
||||
static int _errorLine;
|
||||
};
|
||||
|
||||
#endif // ELLIPSOID_H
|
77
src/gui.cpp
77
src/gui.cpp
@ -26,6 +26,8 @@
|
||||
#include "keys.h"
|
||||
#include "settings.h"
|
||||
#include "data.h"
|
||||
#include "ellipsoid.h"
|
||||
#include "datum.h"
|
||||
#include "map.h"
|
||||
#include "maplist.h"
|
||||
#include "mapdir.h"
|
||||
@ -47,6 +49,7 @@
|
||||
|
||||
GUI::GUI()
|
||||
{
|
||||
loadDatums();
|
||||
loadMaps();
|
||||
loadPOIs();
|
||||
|
||||
@ -117,6 +120,50 @@ void GUI::createBrowser()
|
||||
_browser->setFilter(filter);
|
||||
}
|
||||
|
||||
void GUI::loadDatums()
|
||||
{
|
||||
QString ef, df;
|
||||
bool ok = false;
|
||||
|
||||
if (QFile::exists(USER_ELLIPSOID_FILE))
|
||||
ef = USER_ELLIPSOID_FILE;
|
||||
else if (QFile::exists(GLOBAL_ELLIPSOID_FILE))
|
||||
ef = GLOBAL_ELLIPSOID_FILE;
|
||||
else
|
||||
qWarning("No ellipsoids file found.");
|
||||
|
||||
if (QFile::exists(USER_DATUM_FILE))
|
||||
df = USER_DATUM_FILE;
|
||||
else if (QFile::exists(GLOBAL_DATUM_FILE))
|
||||
df = GLOBAL_DATUM_FILE;
|
||||
else
|
||||
qWarning("No datums file found.");
|
||||
|
||||
if (!ef.isNull() && !df.isNull()) {
|
||||
if (!Ellipsoid::loadList(ef)) {
|
||||
if (Ellipsoid::errorLine())
|
||||
qWarning("%s: parse error on line %d: %s", qPrintable(ef),
|
||||
Ellipsoid::errorLine(), qPrintable(Ellipsoid::errorString()));
|
||||
else
|
||||
qWarning("%s: %s", qPrintable(ef), qPrintable(
|
||||
Ellipsoid::errorString()));
|
||||
} else {
|
||||
if (!Datum::loadList(df)) {
|
||||
if (Datum::errorLine())
|
||||
qWarning("%s: parse error on line %d: %s", qPrintable(ef),
|
||||
Datum::errorLine(), qPrintable(Datum::errorString()));
|
||||
else
|
||||
qWarning("%s: %s", qPrintable(ef), qPrintable(
|
||||
Datum::errorString()));
|
||||
} else
|
||||
ok = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!ok)
|
||||
qWarning("Maps based on a datum different from WGS84 won't work.");
|
||||
}
|
||||
|
||||
void GUI::loadMaps()
|
||||
{
|
||||
QList<Map*> online, offline;
|
||||
@ -594,18 +641,24 @@ void GUI::keys()
|
||||
msgBox.setWindowTitle(tr("Keyboard controls"));
|
||||
msgBox.setText("<h3>" + tr("Keyboard controls") + "</h3>");
|
||||
msgBox.setInformativeText(
|
||||
"<div><table width=\"300\"><tr><td>" + tr("Next file")
|
||||
+ "</td><td><i>" + QKeySequence(NEXT_KEY).toString()
|
||||
"<style>td {padding-right: 1.5em;}</style><div><table><tr><td>"
|
||||
+ tr("Next file") + "</td><td><i>" + QKeySequence(NEXT_KEY).toString()
|
||||
+ "</i></td></tr><tr><td>" + tr("Previous file")
|
||||
+ "</td><td><i>" + QKeySequence(PREV_KEY).toString()
|
||||
+ "</i></td></tr><tr><td>" + tr("First file") + "</td><td><i>"
|
||||
+ QKeySequence(FIRST_KEY).toString() + "</i></td></tr><tr><td>"
|
||||
+ tr("Last file") + "</td><td><i>" + QKeySequence(LAST_KEY).toString()
|
||||
+ "</i></td></tr><tr><td>" + tr("Append modifier")
|
||||
+ "</td><td><i>SHIFT</i></td></tr><tr><td></td><td></td></tr><tr><td>"
|
||||
+ tr("Next map") + "</td><td><i>" + NEXT_MAP_SHORTCUT.toString()
|
||||
+ "</i></td></tr><tr><td>" + tr("Previous map") + "</td><td><i>"
|
||||
+ PREV_MAP_SHORTCUT.toString() + "</i></td></tr></table></div>");
|
||||
+ "</i></td></tr><tr><td>" + tr("Append file")
|
||||
+ "</td><td><i>" + QKeySequence(MODIFIER).toString() + tr("Next/Previous")
|
||||
+ "</i></td></tr><tr><td></td><td></td></tr><tr><td>" + tr("Next map")
|
||||
+ "</td><td><i>" + NEXT_MAP_SHORTCUT.toString() + "</i></td></tr><tr><td>"
|
||||
+ tr("Previous map") + "</td><td><i>" + PREV_MAP_SHORTCUT.toString()
|
||||
+ "</i></td></tr><tr><td></td><td></td></tr><tr><td>" + tr("Zoom in")
|
||||
+ "</td><td><i>" + QKeySequence(ZOOM_IN).toString()
|
||||
+ "</i></td></tr><tr><td>" + tr("Zoom out") + "</td><td><i>"
|
||||
+ QKeySequence(ZOOM_OUT).toString() + "</i></td></tr><tr><td>"
|
||||
+ tr("Digital zoom") + "</td><td><i>" + QKeySequence(MODIFIER).toString()
|
||||
+ tr("Zoom") + "</i></td></tr></table></div>");
|
||||
|
||||
msgBox.exec();
|
||||
}
|
||||
@ -628,13 +681,13 @@ void GUI::dataSources()
|
||||
+ "</p><p><code>Map1 http://tile.server.com/map/$z/$x/$y.png"
|
||||
"<br/>Map2 http://mapserver.org/map/$z-$x-$y</code></p>"
|
||||
|
||||
+ "<h4>" + tr("Ofline maps") + "</h4><p>"
|
||||
+ "<h4>" + tr("Offline maps") + "</h4><p>"
|
||||
+ tr("Offline maps are loaded on program startup from the following "
|
||||
"directory:")
|
||||
+ "</p><p><code>" + USER_MAP_DIR + "</code></p><p>"
|
||||
+ tr("The expected structure is one map/atlas in a separate subdirectory."
|
||||
" Supported map formats are OziMap image-based maps and tiled TrekBuddy"
|
||||
" maps/atlases (tared and non-tared).") + "</p>"
|
||||
" Supported map formats are OziExplorer image-based maps and tiled"
|
||||
" TrekBuddy maps/atlases (tared and non-tared).") + "</p>"
|
||||
|
||||
+ "<h4>" + tr("POIs") + "</h4><p>"
|
||||
+ tr("To make GPXSee load a POI file automatically on startup, add "
|
||||
@ -1312,6 +1365,7 @@ void GUI::keyPressEvent(QKeyEvent *event)
|
||||
if (_fullscreenAction->isChecked()) {
|
||||
_fullscreenAction->setChecked(false);
|
||||
showFullscreen(false);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -1320,7 +1374,10 @@ void GUI::keyPressEvent(QKeyEvent *event)
|
||||
if (!(event->modifiers() & MODIFIER))
|
||||
closeFiles();
|
||||
openFile(file);
|
||||
return;
|
||||
}
|
||||
|
||||
QMainWindow::keyPressEvent(event);
|
||||
}
|
||||
|
||||
void GUI::closeEvent(QCloseEvent *event)
|
||||
|
@ -79,6 +79,7 @@ private slots:
|
||||
private:
|
||||
typedef QPair<QDate, QDate> DateRange;
|
||||
|
||||
void loadDatums();
|
||||
void loadMaps();
|
||||
void loadPOIs();
|
||||
void closeFiles();
|
||||
|
@ -10,6 +10,9 @@
|
||||
#define LAST_KEY Qt::Key_End
|
||||
#define MODIFIER Qt::ShiftModifier
|
||||
|
||||
#define ZOOM_IN QKeySequence::ZoomIn
|
||||
#define ZOOM_OUT QKeySequence::ZoomOut
|
||||
|
||||
#define QUIT_SHORTCUT QKeySequence(QKeySequence::Quit)
|
||||
#define OPEN_SHORTCUT QKeySequence(QKeySequence::Open)
|
||||
#define CLOSE_SHORTCUT QKeySequence(QKeySequence::Close)
|
||||
@ -22,6 +25,7 @@
|
||||
#define SHOW_GRAPHS_SHORTCUT QKeySequence(Qt::CTRL + Qt::Key_G)
|
||||
#define DISTANCE_GRAPH_SHORTCUT QKeySequence(Qt::CTRL + Qt::Key_D)
|
||||
#define TIME_GRAPH_SHORTCUT QKeySequence(Qt::CTRL + Qt::Key_T)
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
#define FULLSCREEN_SHORTCUT QKeySequence(Qt::META + Qt::CTRL + Qt::Key_F)
|
||||
#else // Q_OS_MAC
|
||||
|
81
src/lambertconic.cpp
Normal file
81
src/lambertconic.cpp
Normal file
@ -0,0 +1,81 @@
|
||||
#include <cmath>
|
||||
#include "rd.h"
|
||||
#include "lambertconic.h"
|
||||
|
||||
#ifndef M_PI_2
|
||||
#define M_PI_2 1.57079632679489661923
|
||||
#endif // M_PI_2
|
||||
#ifndef M_PI_4
|
||||
#define M_PI_4 0.78539816339744830962
|
||||
#endif // M_PI_4
|
||||
|
||||
static double q(const Ellipsoid &el, double b)
|
||||
{
|
||||
double e = sqrt(el.flattening() * (2. - el.flattening()));
|
||||
double esb = e * sin(b);
|
||||
return log(tan(M_PI_4 + b / 2.) * pow((1. - esb) / (1. + esb), e / 2.));
|
||||
}
|
||||
|
||||
static double iq(const Ellipsoid &el, double q)
|
||||
{
|
||||
double e = sqrt(el.flattening() * (2. - el.flattening()));
|
||||
double b0 = 0.;
|
||||
double b = 2. * atan(exp(q)) - M_PI_2;
|
||||
|
||||
do {
|
||||
b0 = b;
|
||||
double esb = e * sin(b);
|
||||
b = 2. * atan(exp(q) * pow((1. - esb) / (1. + esb), -e / 2.)) - M_PI_2;
|
||||
} while (fabs(b - b0) > 1e-10);
|
||||
|
||||
return b;
|
||||
}
|
||||
|
||||
static double nradius(const Ellipsoid &el, double phi)
|
||||
{
|
||||
double sin_phi = sin(phi);
|
||||
return (el.radius() / sqrt(1. - (el.flattening() * (2. - el.flattening()))
|
||||
* sin_phi * sin_phi));
|
||||
}
|
||||
|
||||
LambertConic::LambertConic(const Ellipsoid &ellipsoid, double standardParallel1,
|
||||
double standardParallel2, double latitudeOrigin, double longitudeOrigin,
|
||||
double scale, double falseEasting, double falseNorthing) : _e(ellipsoid)
|
||||
{
|
||||
_cm = longitudeOrigin;
|
||||
_fe = falseEasting;
|
||||
_fn = falseNorthing;
|
||||
|
||||
double sp1 = deg2rad(standardParallel1);
|
||||
double sp2 = deg2rad(standardParallel2);
|
||||
|
||||
double N1 = nradius(_e, sp1);
|
||||
double N2 = nradius(_e, sp2);
|
||||
|
||||
_q0 = q(_e, deg2rad(latitudeOrigin));
|
||||
double q1 = q(_e, sp1);
|
||||
double q2 = q(_e, sp2);
|
||||
|
||||
_n = log((N1 * cos(sp1)) / (N2 * cos(sp2))) / (q2 - q1);
|
||||
double R1 = N1 * cos(sp1) / _n;
|
||||
_R0 = scale * R1 * exp(_n * (q1 - _q0));
|
||||
}
|
||||
|
||||
QPointF LambertConic::ll2xy(const Coordinates &c) const
|
||||
{
|
||||
double dl = _n * (deg2rad(c.lon()) - deg2rad(_cm));
|
||||
double R = _R0 * exp(_n * (_q0 - q(_e, deg2rad(c.lat()))));
|
||||
|
||||
return QPointF(_fe + R * sin(dl), _fn + _R0 - R * cos(dl));
|
||||
}
|
||||
|
||||
Coordinates LambertConic::xy2ll(const QPointF &p) const
|
||||
{
|
||||
double dl = atan((p.x() - _fe) / (_fn + _R0 - p.y()));
|
||||
double dx = p.x() - _fe;
|
||||
double dy = p.y() - _fn - _R0;
|
||||
double R = sqrt(dx * dx + dy * dy);
|
||||
double q = _q0 - log(R / _R0) / _n;
|
||||
|
||||
return Coordinates(rad2deg(deg2rad(_cm) + dl / _n), rad2deg(iq(_e, q)));
|
||||
}
|
29
src/lambertconic.h
Normal file
29
src/lambertconic.h
Normal file
@ -0,0 +1,29 @@
|
||||
#ifndef LAMBERTCONIC_H
|
||||
#define LAMBERTCONIC_H
|
||||
|
||||
#include "ellipsoid.h"
|
||||
#include "projection.h"
|
||||
|
||||
class LambertConic : public Projection
|
||||
{
|
||||
public:
|
||||
LambertConic(const Ellipsoid &ellipsoid, double standardParallel1,
|
||||
double standardParallel2, double latitudeOrigin, double longitudeOrigin,
|
||||
double scale, double falseEasting, double falseNorthing);
|
||||
|
||||
virtual QPointF ll2xy(const Coordinates &c) const;
|
||||
virtual Coordinates xy2ll(const QPointF &p) const;
|
||||
|
||||
private:
|
||||
Ellipsoid _e;
|
||||
|
||||
double _cm;
|
||||
double _fe;
|
||||
double _fn;
|
||||
|
||||
double _q0;
|
||||
double _R0;
|
||||
double _n;
|
||||
};
|
||||
|
||||
#endif // LAMBERTCONIC_H
|
@ -3,6 +3,9 @@
|
||||
|
||||
#include <QRectF>
|
||||
|
||||
#define ARRAY_SIZE(array) \
|
||||
(sizeof(array) / sizeof((array)[0]))
|
||||
|
||||
double niceNum(double x, int round);
|
||||
int str2int(const char *str, int len);
|
||||
QRectF scaled(const QRectF &rect, qreal factor);
|
||||
|
@ -12,15 +12,52 @@
|
||||
#include "wgs84.h"
|
||||
#include "coordinates.h"
|
||||
#include "matrix.h"
|
||||
#include "datum.h"
|
||||
#include "latlon.h"
|
||||
#include "mercator.h"
|
||||
#include "transversemercator.h"
|
||||
#include "utm.h"
|
||||
#include "lambertconic.h"
|
||||
#include "ozf.h"
|
||||
#include "offlinemap.h"
|
||||
|
||||
|
||||
// Abridged Molodensky transformation
|
||||
static Coordinates toWGS84(Coordinates c, const Datum &datum)
|
||||
{
|
||||
Ellipsoid WGS84(WGS84_RADIUS, WGS84_FLATTENING);
|
||||
|
||||
double dX = datum.dx();
|
||||
double dY = datum.dy();
|
||||
double dZ = datum.dz();
|
||||
|
||||
double slat = sin(deg2rad(c.lat()));
|
||||
double clat = cos(deg2rad(c.lat()));
|
||||
double slon = sin(deg2rad(c.lon()));
|
||||
double clon = cos(deg2rad(c.lon()));
|
||||
double ssqlat = slat * slat;
|
||||
|
||||
double from_f = datum.ellipsoid().flattening();
|
||||
double df = WGS84.flattening() - from_f;
|
||||
double from_a = datum.ellipsoid().radius();
|
||||
double da = WGS84.radius() - from_a;
|
||||
double from_esq = datum.ellipsoid().flattening()
|
||||
* (2.0 - datum.ellipsoid().flattening());
|
||||
double adb = 1.0 / (1.0 - from_f);
|
||||
double rn = from_a / sqrt(1 - from_esq * ssqlat);
|
||||
double rm = from_a * (1 - from_esq) / pow((1 - from_esq * ssqlat), 1.5);
|
||||
double from_h = 0.0; // we're flat!
|
||||
|
||||
double dlat = (-dX * slat * clon - dY * slat * slon + dZ * clat + da * rn
|
||||
* from_esq * slat * clat / from_a + +df * (rm * adb + rn / adb) * slat
|
||||
* clat) / (rm + from_h);
|
||||
double dlon = (-dX * slon + dY * clon) / ((rn + from_h) * clat);
|
||||
|
||||
return Coordinates(c.lon() + rad2deg(dlon), c.lat() + rad2deg(dlat));
|
||||
}
|
||||
|
||||
int OfflineMap::parseMapFile(QIODevice &device, QList<ReferencePoint> &points,
|
||||
QString &projection, ProjectionSetup &setup)
|
||||
QString &projection, ProjectionSetup &setup, QString &datum)
|
||||
{
|
||||
bool res;
|
||||
int ln = 1;
|
||||
@ -37,6 +74,8 @@ int OfflineMap::parseMapFile(QIODevice &device, QList<ReferencePoint> &points,
|
||||
return ln;
|
||||
} else if (ln == 3)
|
||||
_imgPath = line.trimmed();
|
||||
else if (ln == 5)
|
||||
datum = line.split(',').at(0).trimmed();
|
||||
else {
|
||||
QList<QByteArray> list = line.split(',');
|
||||
QString key(list.at(0).trimmed());
|
||||
@ -104,18 +143,27 @@ int OfflineMap::parseMapFile(QIODevice &device, QList<ReferencePoint> &points,
|
||||
} else if (key == "Projection Setup") {
|
||||
if (list.count() < 8)
|
||||
return ln;
|
||||
setup.centralMeridian = list.at(2).trimmed().toFloat(&res);
|
||||
setup.latitudeOrigin = list.at(1).trimmed().toFloat(&res);
|
||||
if (!res)
|
||||
setup.centralMeridian = 0;
|
||||
setup.latitudeOrigin = 0;
|
||||
setup.longitudeOrigin = list.at(2).trimmed().toFloat(&res);
|
||||
if (!res)
|
||||
setup.longitudeOrigin = 0;
|
||||
setup.scale = list.at(3).trimmed().toFloat(&res);
|
||||
if (!res)
|
||||
setup.scale = 0;
|
||||
setup.scale = 1.0;
|
||||
setup.falseEasting = list.at(4).trimmed().toFloat(&res);
|
||||
if (!res)
|
||||
setup.falseEasting = 0;
|
||||
setup.falseNorthing = list.at(5).trimmed().toFloat(&res);
|
||||
if (!res)
|
||||
setup.falseNorthing = 0;
|
||||
setup.standardParallel1 = list.at(6).trimmed().toFloat(&res);
|
||||
if (!res)
|
||||
setup.standardParallel1 = 0;
|
||||
setup.standardParallel2 = list.at(7).trimmed().toFloat(&res);
|
||||
if (!res)
|
||||
setup.standardParallel2 = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -125,8 +173,9 @@ int OfflineMap::parseMapFile(QIODevice &device, QList<ReferencePoint> &points,
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool OfflineMap::createProjection(const QString &projection,
|
||||
const ProjectionSetup &setup, QList<ReferencePoint> &points)
|
||||
bool OfflineMap::createProjection(const QString &datum,
|
||||
const QString &projection, const ProjectionSetup &setup,
|
||||
QList<ReferencePoint> &points)
|
||||
{
|
||||
if (points.count() < 2) {
|
||||
qWarning("%s: insufficient number of reference points",
|
||||
@ -134,18 +183,30 @@ bool OfflineMap::createProjection(const QString &projection,
|
||||
return false;
|
||||
}
|
||||
|
||||
Datum d = Datum::datum(datum);
|
||||
if (d.isNull()) {
|
||||
qWarning("%s: %s: unknown datum", qPrintable(_name), qPrintable(datum));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (projection == "Mercator")
|
||||
_projection = new Mercator();
|
||||
else if (projection == "Transverse Mercator")
|
||||
_projection = new TransverseMercator(setup.centralMeridian, setup.scale,
|
||||
setup.falseEasting, setup.falseNorthing);
|
||||
_projection = new TransverseMercator(d.ellipsoid(),
|
||||
setup.longitudeOrigin, setup.scale, setup.falseEasting,
|
||||
setup.falseNorthing);
|
||||
else if (projection == "Latitude/Longitude")
|
||||
_projection = new LatLon();
|
||||
else if (projection == "Lambert Conformal Conic")
|
||||
_projection = new LambertConic(d.ellipsoid(),
|
||||
setup.standardParallel1, setup.standardParallel2,
|
||||
setup.latitudeOrigin, setup.longitudeOrigin, setup.scale,
|
||||
setup.falseEasting, setup.falseNorthing);
|
||||
else if (projection == "(UTM) Universal Transverse Mercator") {
|
||||
if (setup.zone)
|
||||
_projection = new UTM(setup.zone);
|
||||
_projection = new UTM(d.ellipsoid(), setup.zone);
|
||||
else if (!points.first().ll.isNull())
|
||||
_projection = new UTM(points.first().ll);
|
||||
_projection = new UTM(d.ellipsoid(), points.first().ll);
|
||||
else {
|
||||
qWarning("%s: Can not determine UTM zone", qPrintable(_name));
|
||||
return false;
|
||||
@ -156,9 +217,17 @@ bool OfflineMap::createProjection(const QString &projection,
|
||||
return false;
|
||||
}
|
||||
|
||||
for (int i = 0; i < points.size(); i++)
|
||||
if (points.at(i).ll.isNull())
|
||||
points[i].ll = _projection->xy2ll(points.at(i).pp);
|
||||
for (int i = 0; i < points.size(); i++) {
|
||||
if (points.at(i).ll.isNull()) {
|
||||
if (d.isWGS84())
|
||||
points[i].ll = _projection->xy2ll(points.at(i).pp);
|
||||
else
|
||||
points[i].ll = toWGS84(_projection->xy2ll(points.at(i).pp), d);
|
||||
} else {
|
||||
if (!d.isWGS84())
|
||||
points[i].ll = toWGS84(points[i].ll, d);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -207,6 +276,7 @@ bool OfflineMap::computeTransformation(const QList<ReferencePoint> &points)
|
||||
|
||||
_transform = QTransform(M.m(0,3), M.m(0,4), M.m(1,3), M.m(1,4), M.m(2,3),
|
||||
M.m(2,4));
|
||||
_inverted = _transform.inverted();
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -242,14 +312,41 @@ bool OfflineMap::computeResolution(QList<ReferencePoint> &points)
|
||||
bool OfflineMap::getImageInfo(const QString &path)
|
||||
{
|
||||
QFileInfo ii(_imgPath);
|
||||
if (ii.isRelative())
|
||||
_imgPath = path + "/" + _imgPath;
|
||||
|
||||
QImageReader img(_imgPath);
|
||||
_size = img.size();
|
||||
if (ii.isRelative())
|
||||
ii.setFile(path + "/" + _imgPath);
|
||||
|
||||
if (!ii.exists()) {
|
||||
int last = _imgPath.lastIndexOf('\\');
|
||||
if (last >= 0 && last < _imgPath.length() - 1) {
|
||||
QStringRef fn(&_imgPath, last + 1, _imgPath.length() - last - 1);
|
||||
ii.setFile(path + "/" + fn.toString());
|
||||
}
|
||||
}
|
||||
|
||||
if (ii.exists())
|
||||
_imgPath = ii.absoluteFilePath();
|
||||
else {
|
||||
qWarning("%s: %s: No such image file", qPrintable(_name),
|
||||
qPrintable(_imgPath));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (_imgPath.endsWith("ozf3", Qt::CaseInsensitive)
|
||||
|| _imgPath.endsWith("ozf4", Qt::CaseInsensitive)) {
|
||||
qWarning("%s: %s: obfuscated image files are not supported",
|
||||
qPrintable(_name), qPrintable(_imgPath));
|
||||
return false;
|
||||
} else if (_imgPath.endsWith("ozf2", Qt::CaseInsensitive)) {
|
||||
_ozf.load(_imgPath);
|
||||
_size = _ozf.size();
|
||||
} else {
|
||||
QImageReader img(_imgPath);
|
||||
_size = img.size();
|
||||
}
|
||||
if (!_size.isValid()) {
|
||||
qWarning("%s: %s: error reading map image", qPrintable(_name),
|
||||
qPrintable(ii.absoluteFilePath()));
|
||||
qPrintable(_imgPath));
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -321,13 +418,14 @@ OfflineMap::OfflineMap(const QString &path, QObject *parent) : Map(parent)
|
||||
{
|
||||
int errorLine = -2;
|
||||
QList<ReferencePoint> points;
|
||||
QString proj;
|
||||
QString proj, datum;
|
||||
ProjectionSetup setup;
|
||||
|
||||
|
||||
_valid = false;
|
||||
_img = 0;
|
||||
_projection = 0;
|
||||
_resolution = 0;
|
||||
|
||||
QFileInfo fi(path);
|
||||
_name = fi.fileName();
|
||||
@ -347,7 +445,7 @@ OfflineMap::OfflineMap(const QString &path, QObject *parent) : Map(parent)
|
||||
if (tarFiles.at(j).endsWith(".map")) {
|
||||
QByteArray ba = _tar.file(tarFiles.at(j));
|
||||
QBuffer buffer(&ba);
|
||||
errorLine = parseMapFile(buffer, points, proj, setup);
|
||||
errorLine = parseMapFile(buffer, points, proj, setup, datum);
|
||||
_imgPath = QString();
|
||||
break;
|
||||
}
|
||||
@ -355,14 +453,14 @@ OfflineMap::OfflineMap(const QString &path, QObject *parent) : Map(parent)
|
||||
break;
|
||||
} else if (fileName.endsWith(".map")) {
|
||||
QFile mapFile(mapFiles.at(i).absoluteFilePath());
|
||||
errorLine = parseMapFile(mapFile, points, proj, setup);
|
||||
errorLine = parseMapFile(mapFile, points, proj, setup, datum);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!mapLoaded(errorLine))
|
||||
return;
|
||||
|
||||
if (!createProjection(proj, setup, points))
|
||||
if (!createProjection(datum, proj, setup, points))
|
||||
return;
|
||||
if (!computeTransformation(points))
|
||||
return;
|
||||
@ -395,7 +493,7 @@ OfflineMap::OfflineMap(Tar &tar, const QString &path, QObject *parent)
|
||||
{
|
||||
int errorLine = -2;
|
||||
QList<ReferencePoint> points;
|
||||
QString proj;
|
||||
QString proj, datum;
|
||||
ProjectionSetup setup;
|
||||
|
||||
|
||||
@ -413,14 +511,14 @@ OfflineMap::OfflineMap(Tar &tar, const QString &path, QObject *parent)
|
||||
if (tarFiles.at(j).startsWith(prefix)) {
|
||||
QByteArray ba = tar.file(tarFiles.at(j));
|
||||
QBuffer buffer(&ba);
|
||||
errorLine = parseMapFile(buffer, points, proj, setup);
|
||||
errorLine = parseMapFile(buffer, points, proj, setup, datum);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!mapLoaded(errorLine))
|
||||
return;
|
||||
|
||||
if (!createProjection(proj, setup, points))
|
||||
if (!createProjection(datum, proj, setup, points))
|
||||
return;
|
||||
if (!totalSizeSet())
|
||||
return;
|
||||
@ -460,7 +558,7 @@ void OfflineMap::load()
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_img && !_imgPath.isNull()) {
|
||||
if (!_img && !_imgPath.isNull() && !_ozf.isOpen()) {
|
||||
_img = new QImage(_imgPath);
|
||||
if (_img->isNull())
|
||||
qWarning("%s: error loading map image", qPrintable(_imgPath));
|
||||
@ -475,104 +573,100 @@ void OfflineMap::unload()
|
||||
}
|
||||
}
|
||||
|
||||
QRectF OfflineMap::bounds() const
|
||||
void OfflineMap::drawTiled(QPainter *painter, const QRectF &rect)
|
||||
{
|
||||
return QRectF(QPointF(0, 0), _size);
|
||||
}
|
||||
QPoint tl = QPoint((int)floor(rect.left() / (qreal)_tileSize.width())
|
||||
* _tileSize.width(), (int)floor(rect.top() / _tileSize.height())
|
||||
* _tileSize.height());
|
||||
|
||||
qreal OfflineMap::zoomFit(const QSize &size, const QRectF &br)
|
||||
{
|
||||
Q_UNUSED(size);
|
||||
Q_UNUSED(br);
|
||||
QSizeF s(rect.right() - tl.x(), rect.bottom() - tl.y());
|
||||
for (int i = 0; i < ceil(s.width() / _tileSize.width()); i++) {
|
||||
for (int j = 0; j < ceil(s.height() / _tileSize.height()); j++) {
|
||||
int x = tl.x() + i * _tileSize.width();
|
||||
int y = tl.y() + j * _tileSize.height();
|
||||
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
qreal OfflineMap::resolution(const QPointF &p) const
|
||||
{
|
||||
Q_UNUSED(p);
|
||||
|
||||
return _resolution;
|
||||
}
|
||||
|
||||
qreal OfflineMap::zoomIn()
|
||||
{
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
qreal OfflineMap::zoomOut()
|
||||
{
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
void OfflineMap::draw(QPainter *painter, const QRectF &rect)
|
||||
{
|
||||
if (_tileSize.isValid()) {
|
||||
QPoint tl = QPoint((int)floor(rect.left() / (qreal)_tileSize.width())
|
||||
* _tileSize.width(), (int)floor(rect.top() / _tileSize.height())
|
||||
* _tileSize.height());
|
||||
|
||||
QSizeF s(rect.right() - tl.x(), rect.bottom() - tl.y());
|
||||
for (int i = 0; i < ceil(s.width() / _tileSize.width()); i++) {
|
||||
for (int j = 0; j < ceil(s.height() / _tileSize.height()); j++) {
|
||||
int x = tl.x() + i * _tileSize.width();
|
||||
int y = tl.y() + j * _tileSize.height();
|
||||
QString tileName(_tileName.arg(QString::number(x),
|
||||
QString::number(y)));
|
||||
QPixmap pixmap;
|
||||
|
||||
if (_tar.isOpen()) {
|
||||
QString key = _tar.fileName() + "/" + tileName;
|
||||
if (!QPixmapCache::find(key, &pixmap)) {
|
||||
QByteArray ba = _tar.file(tileName);
|
||||
pixmap = QPixmap::fromImage(QImage::fromData(ba));
|
||||
if (!pixmap.isNull())
|
||||
QPixmapCache::insert(key, pixmap);
|
||||
}
|
||||
} else
|
||||
pixmap = QPixmap(tileName);
|
||||
|
||||
if (pixmap.isNull()) {
|
||||
qWarning("%s: error loading tile image", qPrintable(
|
||||
_tileName.arg(QString::number(x), QString::number(y))));
|
||||
painter->fillRect(QRectF(QPoint(x, y), _tileSize),
|
||||
Qt::white);
|
||||
} else
|
||||
painter->drawPixmap(QPoint(x, y), pixmap);
|
||||
if (!QRectF(QPointF(x, y), _ozf.tileSize()).intersects(bounds())) {
|
||||
painter->fillRect(QRectF(QPoint(x, y), _tileSize), Qt::white);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!_img || _img->isNull())
|
||||
painter->fillRect(rect, Qt::white);
|
||||
else {
|
||||
QPoint p = rect.topLeft().toPoint();
|
||||
QImage crop = _img->copy(QRect(p, rect.size().toSize()));
|
||||
painter->drawImage(rect.topLeft(), crop);
|
||||
|
||||
QString tileName(_tileName.arg(QString::number(x),
|
||||
QString::number(y)));
|
||||
QPixmap pixmap;
|
||||
|
||||
if (_tar.isOpen()) {
|
||||
QString key = _tar.fileName() + "/" + tileName;
|
||||
if (!QPixmapCache::find(key, &pixmap)) {
|
||||
QByteArray ba = _tar.file(tileName);
|
||||
pixmap = QPixmap::fromImage(QImage::fromData(ba));
|
||||
if (!pixmap.isNull())
|
||||
QPixmapCache::insert(key, pixmap);
|
||||
}
|
||||
} else
|
||||
pixmap = QPixmap(tileName);
|
||||
|
||||
if (pixmap.isNull()) {
|
||||
qWarning("%s: error loading tile image", qPrintable(
|
||||
_tileName.arg(QString::number(x), QString::number(y))));
|
||||
painter->fillRect(QRectF(QPoint(x, y), _tileSize), Qt::white);
|
||||
} else
|
||||
painter->drawPixmap(QPoint(x, y), pixmap);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QPointF OfflineMap::ll2xy(const Coordinates &c) const
|
||||
void OfflineMap::drawOZF(QPainter *painter, const QRectF &rect)
|
||||
{
|
||||
return _transform.map(_projection->ll2xy(c));
|
||||
QPoint tl = QPoint((int)floor(rect.left() / _ozf.tileSize().width())
|
||||
* _ozf.tileSize().width(), (int)floor(rect.top()
|
||||
/ _ozf.tileSize().height()) * _ozf.tileSize().height());
|
||||
|
||||
QSizeF s(rect.right() - tl.x(), rect.bottom() - tl.y());
|
||||
for (int i = 0; i < ceil(s.width() / _ozf.tileSize().width()); i++) {
|
||||
for (int j = 0; j < ceil(s.height() / _ozf.tileSize().height()); j++) {
|
||||
int x = tl.x() + i * _ozf.tileSize().width();
|
||||
int y = tl.y() + j * _ozf.tileSize().height();
|
||||
|
||||
if (!QRectF(QPointF(x, y), _ozf.tileSize()).intersects(bounds())) {
|
||||
painter->fillRect(QRectF(QPoint(x, y), _tileSize), Qt::white);
|
||||
continue;
|
||||
}
|
||||
|
||||
QPixmap pixmap;
|
||||
QString key = _ozf.fileName() + "/" + QString::number(x)
|
||||
+ "_" + QString::number(y);
|
||||
if (!QPixmapCache::find(key, &pixmap)) {
|
||||
pixmap = _ozf.tile(x, y);
|
||||
if (!pixmap.isNull())
|
||||
QPixmapCache::insert(key, pixmap);
|
||||
}
|
||||
|
||||
if (pixmap.isNull()) {
|
||||
qWarning("%s: error loading tile image", qPrintable(key));
|
||||
painter->fillRect(QRectF(QPoint(x, y), _tileSize), Qt::white);
|
||||
} else
|
||||
painter->drawPixmap(QPoint(x, y), pixmap);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Coordinates OfflineMap::xy2ll(const QPointF &p) const
|
||||
void OfflineMap::drawImage(QPainter *painter, const QRectF &rect)
|
||||
{
|
||||
return _projection->xy2ll(_transform.inverted().map(p));
|
||||
if (!_img || _img->isNull())
|
||||
painter->fillRect(rect, Qt::white);
|
||||
else {
|
||||
QPoint p = rect.topLeft().toPoint();
|
||||
QImage crop = _img->copy(QRect(p, rect.size().toSize()));
|
||||
painter->drawImage(rect.topLeft(), crop);
|
||||
}
|
||||
}
|
||||
|
||||
QPointF OfflineMap::ll2pp(const Coordinates &c) const
|
||||
void OfflineMap::draw(QPainter *painter, const QRectF &rect)
|
||||
{
|
||||
return _projection->ll2xy(c);
|
||||
}
|
||||
|
||||
QPointF OfflineMap::xy2pp(const QPointF &p) const
|
||||
{
|
||||
return _transform.inverted().map(p);
|
||||
}
|
||||
|
||||
QPointF OfflineMap::pp2xy(const QPointF &p) const
|
||||
{
|
||||
return _transform.map(p);
|
||||
if (_ozf.isOpen())
|
||||
drawOZF(painter, rect);
|
||||
else if (_tileSize.isValid())
|
||||
drawTiled(painter, rect);
|
||||
else
|
||||
drawImage(painter, rect);
|
||||
}
|
||||
|
@ -4,11 +4,13 @@
|
||||
#include <QTransform>
|
||||
#include "map.h"
|
||||
#include "tar.h"
|
||||
#include "ozf.h"
|
||||
#include "coordinates.h"
|
||||
#include "projection.h"
|
||||
|
||||
|
||||
class QIODevice;
|
||||
class QImage;
|
||||
class Projection;
|
||||
|
||||
class OfflineMap : public Map
|
||||
{
|
||||
@ -21,16 +23,18 @@ public:
|
||||
|
||||
const QString &name() const {return _name;}
|
||||
|
||||
QRectF bounds() const;
|
||||
qreal resolution(const QPointF &p) const;
|
||||
QRectF bounds() const {return QRectF(QPointF(0, 0), _size);}
|
||||
qreal resolution(const QPointF &) const {return _resolution;}
|
||||
|
||||
qreal zoom() const {return 1.0;}
|
||||
qreal zoomFit(const QSize &size, const QRectF &br);
|
||||
qreal zoomIn();
|
||||
qreal zoomOut();
|
||||
qreal zoomFit(const QSize &, const QRectF &) {return 1.0;}
|
||||
qreal zoomIn() {return 1.0;}
|
||||
qreal zoomOut() {return 1.0;}
|
||||
|
||||
QPointF ll2xy(const Coordinates &c) const;
|
||||
Coordinates xy2ll(const QPointF &p) const;
|
||||
QPointF ll2xy(const Coordinates &c) const
|
||||
{return _transform.map(_projection->ll2xy(c));}
|
||||
Coordinates xy2ll(const QPointF &p) const
|
||||
{return _projection->xy2ll(_inverted.map(p));}
|
||||
|
||||
void draw(QPainter *painter, const QRectF &rect);
|
||||
|
||||
@ -39,9 +43,12 @@ public:
|
||||
|
||||
bool isValid() {return _valid;}
|
||||
|
||||
QPointF ll2pp(const Coordinates &c) const;
|
||||
QPointF xy2pp(const QPointF &p) const;
|
||||
QPointF pp2xy(const QPointF &p) const;
|
||||
QPointF ll2pp(const Coordinates &c) const
|
||||
{return _projection->ll2xy(c);}
|
||||
QPointF xy2pp(const QPointF &p) const
|
||||
{return _inverted.map(p);}
|
||||
QPointF pp2xy(const QPointF &p) const
|
||||
{return _transform.map(p);}
|
||||
|
||||
private:
|
||||
typedef struct {
|
||||
@ -51,30 +58,38 @@ private:
|
||||
} ReferencePoint;
|
||||
|
||||
typedef struct {
|
||||
double centralMeridian;
|
||||
double latitudeOrigin;
|
||||
double longitudeOrigin;
|
||||
double scale;
|
||||
double falseEasting;
|
||||
double falseNorthing;
|
||||
double standardParallel1;
|
||||
double standardParallel2;
|
||||
int zone;
|
||||
} ProjectionSetup;
|
||||
|
||||
int parseMapFile(QIODevice &device, QList<ReferencePoint> &points,
|
||||
QString &projection, ProjectionSetup &setup);
|
||||
QString &projection, ProjectionSetup &setup, QString &datum);
|
||||
bool mapLoaded(int res);
|
||||
bool totalSizeSet();
|
||||
bool createProjection(const QString &projection,
|
||||
bool createProjection(const QString &datum, const QString &projection,
|
||||
const ProjectionSetup &setup, QList<ReferencePoint> &points);
|
||||
bool computeTransformation(const QList<ReferencePoint> &points);
|
||||
bool computeResolution(QList<ReferencePoint> &points);
|
||||
bool getTileInfo(const QStringList &tiles, const QString &path = QString());
|
||||
bool getImageInfo(const QString &path);
|
||||
|
||||
void drawTiled(QPainter *painter, const QRectF &rect);
|
||||
void drawOZF(QPainter *painter, const QRectF &rect);
|
||||
void drawImage(QPainter *painter, const QRectF &rect);
|
||||
|
||||
QString _name;
|
||||
QSize _size;
|
||||
Projection *_projection;
|
||||
QTransform _transform;
|
||||
QTransform _transform, _inverted;
|
||||
qreal _resolution;
|
||||
|
||||
OZF _ozf;
|
||||
Tar _tar;
|
||||
QString _tarPath;
|
||||
QImage *_img;
|
||||
|
@ -45,7 +45,6 @@ OnlineMap::OnlineMap(const QString &name, const QString &url, QObject *parent)
|
||||
{
|
||||
_name = name;
|
||||
_url = url;
|
||||
downloader = downloader;
|
||||
_block = false;
|
||||
_scale = ((360.0/(qreal)(1<<ZOOM_MAX))/(qreal)TILE_SIZE);
|
||||
|
||||
|
142
src/ozf.cpp
Normal file
142
src/ozf.cpp
Normal file
@ -0,0 +1,142 @@
|
||||
#include <QtEndian>
|
||||
#include <QFile>
|
||||
#include "ozf.h"
|
||||
|
||||
|
||||
#define OZF2_MAGIC 0x7778
|
||||
#define OZF2_SEPARATOR 0x77777777
|
||||
|
||||
template<class T> bool OZF::readValue(T &val)
|
||||
{
|
||||
T data;
|
||||
|
||||
if (_file.read((char*)&data, sizeof(T)) < (qint64)sizeof(T))
|
||||
return false;
|
||||
|
||||
if (sizeof(T) > 1)
|
||||
val = qFromLittleEndian(data);
|
||||
else
|
||||
val = data;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OZF::readHeaders()
|
||||
{
|
||||
quint16 magic;
|
||||
quint32 separator;
|
||||
|
||||
if (!readValue(magic) || magic != OZF2_MAGIC)
|
||||
return false;
|
||||
|
||||
if (!_file.seek(_file.pos() + 52))
|
||||
return false;
|
||||
if (!readValue(separator) || separator != OZF2_SEPARATOR)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OZF::readTileTable()
|
||||
{
|
||||
quint32 offset, bgr0, w, h;
|
||||
quint16 x, y;
|
||||
|
||||
|
||||
if (!_file.seek(_file.size() - 4))
|
||||
return false;
|
||||
// table offset
|
||||
if (!readValue(offset))
|
||||
return false;
|
||||
if (!_file.seek(offset))
|
||||
return false;
|
||||
// tiles offset (zoom level 0)
|
||||
if (!readValue(offset))
|
||||
return false;
|
||||
if (!_file.seek(offset))
|
||||
return false;
|
||||
|
||||
if (!readValue(w))
|
||||
return false;
|
||||
if (!readValue(h))
|
||||
return false;
|
||||
if (!readValue(x))
|
||||
return false;
|
||||
if (!readValue(y))
|
||||
return false;
|
||||
|
||||
_size = QSize(w, h);
|
||||
_dim = QSize(x, y);
|
||||
|
||||
_palette = QVector<quint32>(256);
|
||||
for (int i = 0; i < _palette.size(); i++) {
|
||||
if (!readValue(bgr0))
|
||||
return false;
|
||||
|
||||
quint32 b = (bgr0 & 0x000000FF);
|
||||
quint32 g = (bgr0 & 0x0000FF00) >> 8;
|
||||
quint32 r = (bgr0 & 0x00FF0000) >> 16;
|
||||
|
||||
_palette[i] = 0xFF000000 | r << 16 | g << 8 | b;
|
||||
}
|
||||
|
||||
_tiles = QVector<quint32>(_dim.width() * _dim.height() + 1);
|
||||
for (int i = 0; i < _tiles.size(); i++)
|
||||
if (!readValue(_tiles[i]))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OZF::load(const QString &path)
|
||||
{
|
||||
if (_file.isOpen())
|
||||
_file.close();
|
||||
|
||||
_file.setFileName(path);
|
||||
if (!_file.open(QIODevice::ReadOnly))
|
||||
return false;
|
||||
|
||||
if (!readHeaders()) {
|
||||
qWarning("%s: not a OZF2 file", qPrintable(_file.fileName()));
|
||||
_file.close();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!readTileTable()) {
|
||||
qWarning("%s: file format error", qPrintable(_file.fileName()));
|
||||
_file.close();
|
||||
_size = QSize();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
QPixmap OZF::tile(int x, int y)
|
||||
{
|
||||
Q_ASSERT(_file.isOpen());
|
||||
|
||||
int i = (y/tileSize().height()) * _dim.width() + (x/tileSize().width());
|
||||
if (i >= _tiles.size() - 1 || i < 0)
|
||||
return QPixmap();
|
||||
|
||||
int size = _tiles.at(i+1) - _tiles.at(i);
|
||||
if (!_file.seek(_tiles.at(i)))
|
||||
return QPixmap();
|
||||
|
||||
QByteArray ba = _file.read(size);
|
||||
if (ba.size() != size)
|
||||
return QPixmap();
|
||||
quint32 bes = qToBigEndian(tileSize().width() * tileSize().height());
|
||||
ba.prepend(QByteArray((char*)&bes, sizeof(bes)));
|
||||
QByteArray uba = qUncompress(ba);
|
||||
if (uba.size() != tileSize().width() * tileSize().height())
|
||||
return QPixmap();
|
||||
|
||||
QImage img((const uchar*)uba.constData(), tileSize().width(),
|
||||
tileSize().height(), QImage::Format_Indexed8);
|
||||
img.setColorTable(_palette);
|
||||
|
||||
return QPixmap::fromImage(img.mirrored());
|
||||
}
|
36
src/ozf.h
Normal file
36
src/ozf.h
Normal file
@ -0,0 +1,36 @@
|
||||
#ifndef OZF_H
|
||||
#define OZF_H
|
||||
|
||||
#include <QString>
|
||||
#include <QSize>
|
||||
#include <QColor>
|
||||
#include <QVector>
|
||||
#include <QFile>
|
||||
#include <QPixmap>
|
||||
|
||||
class OZF
|
||||
{
|
||||
public:
|
||||
bool load(const QString &path);
|
||||
|
||||
QString fileName() const {return _file.fileName();}
|
||||
bool isOpen() const {return _file.isOpen();}
|
||||
|
||||
QSize size() const {return _size;}
|
||||
QSize tileSize() const {return QSize(64, 64);}
|
||||
QPixmap tile(int x, int y);
|
||||
|
||||
private:
|
||||
template<class T> bool readValue(T &val);
|
||||
bool readHeaders();
|
||||
bool readTileTable();
|
||||
|
||||
QSize _size;
|
||||
QSize _dim;
|
||||
QVector<QRgb> _palette;
|
||||
QVector<quint32> _tiles;
|
||||
|
||||
QFile _file;
|
||||
};
|
||||
|
||||
#endif // OZF_H
|
@ -24,6 +24,7 @@ PathItem::PathItem(const Path &path, Map *map, QGraphicsItem *parent)
|
||||
|
||||
_marker = new MarkerItem(this);
|
||||
_marker->setPos(position(_path.at(0).distance()));
|
||||
_marker->setFlag(QGraphicsItem::ItemIgnoresTransformations);
|
||||
_md = _path.at(0).distance();
|
||||
|
||||
setCursor(Qt::ArrowCursor);
|
||||
@ -79,7 +80,7 @@ void PathItem::setColor(const QColor &color)
|
||||
update();
|
||||
}
|
||||
|
||||
void PathItem::setWidth(int width)
|
||||
void PathItem::setWidth(qreal width)
|
||||
{
|
||||
prepareGeometryChange();
|
||||
|
||||
|
@ -26,7 +26,7 @@ public:
|
||||
void setMap(Map *map);
|
||||
|
||||
void setColor(const QColor &color);
|
||||
void setWidth(int width);
|
||||
void setWidth(qreal width);
|
||||
void setStyle(Qt::PenStyle style);
|
||||
|
||||
void showMarker(bool show) {_marker->setVisible(show);}
|
||||
@ -52,7 +52,7 @@ private:
|
||||
Map *_map;
|
||||
qreal _md;
|
||||
|
||||
int _width;
|
||||
qreal _width;
|
||||
QPen _pen;
|
||||
QPainterPath _shape;
|
||||
QPainterPath _painterPath;
|
||||
|
121
src/pathview.cpp
121
src/pathview.cpp
@ -1,7 +1,7 @@
|
||||
#include <QGraphicsView>
|
||||
#include <QGraphicsScene>
|
||||
#include <QWheelEvent>
|
||||
#include <QSysInfo>
|
||||
#include <QApplication>
|
||||
#include "opengl.h"
|
||||
#include "misc.h"
|
||||
#include "poi.h"
|
||||
@ -12,9 +12,11 @@
|
||||
#include "routeitem.h"
|
||||
#include "waypointitem.h"
|
||||
#include "scaleitem.h"
|
||||
#include "keys.h"
|
||||
#include "pathview.h"
|
||||
|
||||
|
||||
#define MAX_ZOOM 1
|
||||
#define MIN_ZOOM -3
|
||||
#define MARGIN 10.0
|
||||
#define SCALE_OFFSET 7
|
||||
|
||||
@ -48,6 +50,7 @@ PathView::PathView(Map *map, POI *poi, QWidget *parent)
|
||||
|
||||
_mapScale = new ScaleItem();
|
||||
_mapScale->setZValue(2.0);
|
||||
_mapScale->setFlag(QGraphicsItem::ItemIgnoresTransformations);
|
||||
|
||||
_map = map;
|
||||
_poi = poi;
|
||||
@ -71,6 +74,7 @@ PathView::PathView(Map *map, POI *poi, QWidget *parent)
|
||||
_routeStyle = Qt::DashLine;
|
||||
|
||||
_plot = false;
|
||||
_digitalZoom = 0;
|
||||
|
||||
_scene->setSceneRect(_map->bounds());
|
||||
_res = _map->resolution(_scene->sceneRect().center());
|
||||
@ -93,7 +97,7 @@ PathItem *PathView::addTrack(const Track &track)
|
||||
_tracks.append(ti);
|
||||
_tr |= ti->path().boundingRect();
|
||||
ti->setColor(_palette.nextColor());
|
||||
ti->setWidth(_trackWidth);
|
||||
ti->setWidth(_trackWidth * pow(2, -_digitalZoom));
|
||||
ti->setStyle(_trackStyle);
|
||||
ti->setVisible(_showTracks);
|
||||
_scene->addItem(ti);
|
||||
@ -114,7 +118,7 @@ PathItem *PathView::addRoute(const Route &route)
|
||||
_routes.append(ri);
|
||||
_rr |= ri->path().boundingRect();
|
||||
ri->setColor(_palette.nextColor());
|
||||
ri->setWidth(_routeWidth);
|
||||
ri->setWidth(_routeWidth * pow(2, -_digitalZoom));
|
||||
ri->setStyle(_routeStyle);
|
||||
ri->setVisible(_showRoutes);
|
||||
ri->showWaypoints(_showRouteWaypoints);
|
||||
@ -138,6 +142,7 @@ void PathView::addWaypoints(const QList<Waypoint> &waypoints)
|
||||
wi->setZValue(1);
|
||||
wi->showLabel(_showWaypointLabels);
|
||||
wi->setVisible(_showWaypoints);
|
||||
wi->setFlag(QGraphicsItem::ItemIgnoresTransformations);
|
||||
_scene->addItem(wi);
|
||||
}
|
||||
|
||||
@ -268,6 +273,8 @@ void PathView::setMap(Map *map)
|
||||
_map->load();
|
||||
connect(_map, SIGNAL(loaded()), this, SLOT(redraw()));
|
||||
|
||||
resetDigitalZoom();
|
||||
|
||||
mapScale();
|
||||
_scene->setSceneRect(_map->bounds());
|
||||
|
||||
@ -278,6 +285,11 @@ void PathView::setMap(Map *map)
|
||||
for (int i = 0; i < _waypoints.size(); i++)
|
||||
_waypoints.at(i)->setMap(map);
|
||||
|
||||
QHash<Waypoint, WaypointItem*>::const_iterator it;
|
||||
for (it = _pois.constBegin(); it != _pois.constEnd(); it++)
|
||||
it.value()->setMap(_map);
|
||||
updatePOIVisibility();
|
||||
|
||||
QPointF center = contentCenter();
|
||||
centerOn(center);
|
||||
|
||||
@ -328,6 +340,7 @@ void PathView::addPOI(const QVector<Waypoint> &waypoints)
|
||||
pi->setZValue(1);
|
||||
pi->showLabel(_showPOILabels);
|
||||
pi->setVisible(_showPOI);
|
||||
pi->setFlag(QGraphicsItem::ItemIgnoresTransformations);
|
||||
_scene->addItem(pi);
|
||||
|
||||
_pois.insert(w, pi);
|
||||
@ -357,22 +370,62 @@ void PathView::redraw()
|
||||
resetCachedContent();
|
||||
}
|
||||
|
||||
void PathView::zoom(const QPoint &pos, const Coordinates &c)
|
||||
void PathView::resetDigitalZoom()
|
||||
{
|
||||
QPoint offset = pos - viewport()->rect().center();
|
||||
_digitalZoom = 0;
|
||||
|
||||
rescale();
|
||||
resetTransform();
|
||||
|
||||
QPointF center = _map->ll2xy(c) - offset;
|
||||
centerOn(center);
|
||||
setTrackWidth(_trackWidth);
|
||||
setRouteWidth(_routeWidth);
|
||||
}
|
||||
|
||||
_res = _map->resolution(center);
|
||||
_mapScale->setResolution(_res);
|
||||
void PathView::digitalZoom(int zoom)
|
||||
{
|
||||
_digitalZoom += zoom;
|
||||
scale(pow(2, zoom), pow(2, zoom));
|
||||
|
||||
setTrackWidth(_trackWidth);
|
||||
setRouteWidth(_routeWidth);
|
||||
|
||||
_mapScale->setResolution(_res * pow(2, -_digitalZoom));
|
||||
}
|
||||
|
||||
void PathView::zoom(int zoom, const QPoint &pos, const Coordinates &c)
|
||||
{
|
||||
bool shift = QApplication::keyboardModifiers() & Qt::ShiftModifier;
|
||||
|
||||
if (_digitalZoom) {
|
||||
if (((_digitalZoom > 0 && zoom > 0) && (!shift || _digitalZoom
|
||||
>= MAX_ZOOM)) || ((_digitalZoom < 0 && zoom < 0) && (!shift
|
||||
|| _digitalZoom <= MIN_ZOOM)))
|
||||
return;
|
||||
|
||||
digitalZoom(zoom);
|
||||
} else {
|
||||
qreal os, ns;
|
||||
os = _map->zoom();
|
||||
ns = (zoom > 0) ? _map->zoomIn() : _map->zoomOut();
|
||||
|
||||
if (ns != os) {
|
||||
QPoint offset = pos - viewport()->rect().center();
|
||||
|
||||
rescale();
|
||||
|
||||
QPointF center = _map->ll2xy(c) - offset;
|
||||
centerOn(center);
|
||||
|
||||
_res = _map->resolution(center);
|
||||
_mapScale->setResolution(_res);
|
||||
} else {
|
||||
if (shift)
|
||||
digitalZoom(zoom);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PathView::wheelEvent(QWheelEvent *event)
|
||||
{
|
||||
qreal os, ns;
|
||||
static int deg = 0;
|
||||
|
||||
deg += event->delta() / 8;
|
||||
@ -380,48 +433,39 @@ void PathView::wheelEvent(QWheelEvent *event)
|
||||
return;
|
||||
deg = 0;
|
||||
|
||||
os = _map->zoom();
|
||||
Coordinates c = _map->xy2ll(mapToScene(event->pos()));
|
||||
|
||||
ns = (event->delta() > 0) ? _map->zoomIn() : _map->zoomOut();
|
||||
if (ns != os)
|
||||
zoom(event->pos(), c);
|
||||
zoom((event->delta() > 0) ? 1 : -1, event->pos(), c);
|
||||
}
|
||||
|
||||
void PathView::mouseDoubleClickEvent(QMouseEvent *event)
|
||||
{
|
||||
qreal os, ns;
|
||||
|
||||
if (event->button() != Qt::LeftButton && event->button() != Qt::RightButton)
|
||||
return;
|
||||
|
||||
os = _map->zoom();
|
||||
Coordinates c = _map->xy2ll(mapToScene(event->pos()));
|
||||
|
||||
ns = (event->button() == Qt::LeftButton) ? _map->zoomIn() : _map->zoomOut();
|
||||
if (ns != os)
|
||||
zoom(event->pos(), c);
|
||||
zoom((event->button() == Qt::LeftButton) ? 1 : -1, event->pos(), c);
|
||||
}
|
||||
|
||||
void PathView::keyPressEvent(QKeyEvent *event)
|
||||
{
|
||||
qreal os, ns;
|
||||
int z;
|
||||
|
||||
os = _map->zoom();
|
||||
QPoint pos = QRect(QPoint(), viewport()->size()).center();
|
||||
Coordinates c = _map->xy2ll(mapToScene(pos));
|
||||
|
||||
if (event->matches(QKeySequence::ZoomIn))
|
||||
ns = _map->zoomIn();
|
||||
else if (event->matches(QKeySequence::ZoomOut))
|
||||
ns = _map->zoomOut();
|
||||
else {
|
||||
QWidget::keyPressEvent(event);
|
||||
if (event->matches(ZOOM_IN))
|
||||
z = 1;
|
||||
else if (event->matches(ZOOM_OUT))
|
||||
z = -1;
|
||||
else if (_digitalZoom && event->key() == Qt::Key_Escape) {
|
||||
resetDigitalZoom();
|
||||
return;
|
||||
} else {
|
||||
QGraphicsView::keyPressEvent(event);
|
||||
return;
|
||||
}
|
||||
|
||||
if (ns != os)
|
||||
zoom(pos, c);
|
||||
zoom(z, pos, c);
|
||||
}
|
||||
|
||||
void PathView::plot(QPainter *painter, const QRectF &target)
|
||||
@ -474,6 +518,11 @@ void PathView::clear()
|
||||
|
||||
_tr = QRectF(); _rr = QRectF(); _wr = QRectF();
|
||||
_wp = QPointF();
|
||||
|
||||
_digitalZoom = 0;
|
||||
resetTransform();
|
||||
|
||||
resetCachedContent();
|
||||
}
|
||||
|
||||
void PathView::showTracks(bool show)
|
||||
@ -559,7 +608,7 @@ void PathView::setTrackWidth(int width)
|
||||
_trackWidth = width;
|
||||
|
||||
for (int i = 0; i < _tracks.count(); i++)
|
||||
_tracks.at(i)->setWidth(width);
|
||||
_tracks.at(i)->setWidth(width * pow(2, -_digitalZoom));
|
||||
}
|
||||
|
||||
void PathView::setRouteWidth(int width)
|
||||
@ -567,7 +616,7 @@ void PathView::setRouteWidth(int width)
|
||||
_routeWidth = width;
|
||||
|
||||
for (int i = 0; i < _routes.count(); i++)
|
||||
_routes.at(i)->setWidth(width);
|
||||
_routes.at(i)->setWidth(width * pow(2, -_digitalZoom));
|
||||
}
|
||||
|
||||
void PathView::setTrackStyle(Qt::PenStyle style)
|
||||
|
@ -76,7 +76,9 @@ private:
|
||||
qreal mapScale() const;
|
||||
QPointF contentCenter() const;
|
||||
void rescale();
|
||||
void zoom(const QPoint &pos, const Coordinates &c);
|
||||
void zoom(int zoom, const QPoint &pos, const Coordinates &c);
|
||||
void digitalZoom(int zoom);
|
||||
void resetDigitalZoom();
|
||||
void updatePOIVisibility();
|
||||
void updateWaypointsBoundingRect(const QPointF &wp);
|
||||
|
||||
@ -118,6 +120,7 @@ private:
|
||||
Qt::PenStyle _trackStyle;
|
||||
Qt::PenStyle _routeStyle;
|
||||
|
||||
int _digitalZoom;
|
||||
bool _plot;
|
||||
};
|
||||
|
||||
|
13
src/tar.cpp
13
src/tar.cpp
@ -50,18 +50,26 @@ bool Tar::load(const QString &path)
|
||||
quint64 size;
|
||||
qint64 ret;
|
||||
|
||||
if (_file.isOpen())
|
||||
_file.close();
|
||||
_index.clear();
|
||||
|
||||
_file.setFileName(path);
|
||||
if (!_file.open(QIODevice::ReadOnly))
|
||||
return false;
|
||||
|
||||
while ((ret = _file.read(buffer, BLOCKSIZE)) > 0) {
|
||||
if (ret < BLOCKSIZE)
|
||||
if (ret < BLOCKSIZE) {
|
||||
_file.close();
|
||||
return false;
|
||||
}
|
||||
size = number(hdr->size, sizeof(hdr->size));
|
||||
if (size)
|
||||
_index.insert(hdr->name, Info(size, _file.pos()));
|
||||
if (!_file.seek(_file.pos() + BLOCKCOUNT(size) * BLOCKSIZE))
|
||||
if (!_file.seek(_file.pos() + BLOCKCOUNT(size) * BLOCKSIZE)) {
|
||||
_file.close();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -73,6 +81,7 @@ QByteArray Tar::file(const QString &name)
|
||||
if (it == _index.end())
|
||||
return QByteArray();
|
||||
|
||||
Q_ASSERT(_file.isOpen());
|
||||
if (_file.seek(it.value().offset()))
|
||||
return _file.read(it.value().size());
|
||||
else
|
||||
|
@ -1,66 +1,70 @@
|
||||
#include <cmath>
|
||||
#include "rd.h"
|
||||
#include "wgs84.h"
|
||||
#include "ellipsoid.h"
|
||||
#include "transversemercator.h"
|
||||
|
||||
|
||||
TransverseMercator::TransverseMercator()
|
||||
{
|
||||
_centralMeridian = 0;
|
||||
_scale = 1.0;
|
||||
_falseEasting = 0;
|
||||
_falseNorthing = 0;
|
||||
}
|
||||
|
||||
TransverseMercator::TransverseMercator(double centralMeridian, double scale,
|
||||
double falseEasting, double falseNorthing)
|
||||
TransverseMercator::TransverseMercator(const Ellipsoid &ellipsoid,
|
||||
double centralMeridian, double scale, double falseEasting,
|
||||
double falseNorthing)
|
||||
{
|
||||
_centralMeridian = centralMeridian;
|
||||
_scale = scale;
|
||||
_falseEasting = falseEasting;
|
||||
_falseNorthing = falseNorthing;
|
||||
|
||||
|
||||
const double e2 = ellipsoid.flattening() * (2 - ellipsoid.flattening());
|
||||
const double n = ellipsoid.flattening() / (2 - ellipsoid.flattening());
|
||||
_rectifyingRadius = ellipsoid.radius() / (1 + n)
|
||||
* (1 + 0.25*pow(n, 2) + 0.015625*pow(n, 4));
|
||||
|
||||
_A = e2;
|
||||
_B = (5 * pow(e2, 2) - pow(e2, 3)) / 6.0;
|
||||
_C = (104 * pow(e2, 3) - 45 * pow(e2, 4)) / 120.0;
|
||||
_D = (1237 * pow(e2, 4)) / 1260.0;
|
||||
|
||||
_beta1 = 1/2.0 * n - 2/3.0 * pow(n, 2) + 5/16.0 * pow(n, 3) + 41/180.0
|
||||
* pow(n, 4);
|
||||
_beta2 = 13/48.0 * pow(n, 2) - 3/5.0 * pow(n, 3) + 557/1440.0 * pow(n, 4);
|
||||
_beta3 = 61/240.0 * pow(n, 3) - 103/140.0 * pow(n, 4);
|
||||
_beta4 = 49561/161280.0 * pow(n, 4);
|
||||
|
||||
_delta1 = 1/2.0 * n - 2/3.0 * pow(n, 2) + 37/96.0 * pow(n, 3) - 1/360.0
|
||||
* pow(n, 4);
|
||||
_delta2 = 1/48.0 * pow(n, 2) + 1/15.0 * pow(n, 3) - 437/1440.0 * pow(n, 4);
|
||||
_delta3 = 17/480.0 * pow(n, 3) - 37/840.0 * pow(n, 4);
|
||||
_delta4 = 4397/161280.0 * pow(n, 4);
|
||||
|
||||
_AStar = e2 + pow(e2, 2) + pow(e2, 3) + pow(e2, 4);
|
||||
_BStar = (7 * pow(e2, 2) + 17 * pow(e2, 3) + 30 * pow(e2, 4)) / -6;
|
||||
_CStar = (224 * pow(e2, 3) + 889 * pow(e2, 4)) / 120;
|
||||
_DStar = (4279 * pow(e2, 4)) / -1260;
|
||||
}
|
||||
|
||||
QPointF TransverseMercator::ll2xy(const Coordinates &c) const
|
||||
{
|
||||
QPointF p;
|
||||
|
||||
const double e2 = WGS84_FLATTENING * (2 - WGS84_FLATTENING);
|
||||
const double n = WGS84_FLATTENING / (2 - WGS84_FLATTENING);
|
||||
const double rectifyingRadius = WGS84_RADIUS / (1 + n)
|
||||
* (1 + 0.25*pow(n, 2) + 0.015625*pow(n, 4));
|
||||
|
||||
double A = e2;
|
||||
double B = (5 * pow(e2, 2) - pow(e2, 3)) / 6.0;
|
||||
double C = (104 * pow(e2, 3) - 45 * pow(e2, 4)) / 120.0;
|
||||
double D = (1237 * pow(e2, 4)) / 1260.0;
|
||||
|
||||
double phi = deg2rad(c.lat());
|
||||
double lambda = deg2rad(c.lon());
|
||||
double lambda0 = deg2rad(_centralMeridian);
|
||||
|
||||
double deltaLambda = lambda - lambda0;
|
||||
|
||||
double phiStar = phi - sin(phi) * cos(phi) * (A + B*pow(sin(phi), 2)
|
||||
+ C*pow(sin(phi), 4) + D*pow(sin(phi), 6));
|
||||
double phiStar = phi - sin(phi) * cos(phi) * (_A + _B*pow(sin(phi), 2)
|
||||
+ _C*pow(sin(phi), 4) + _D*pow(sin(phi), 6));
|
||||
|
||||
double xiPrim = atan(tan(phiStar) / cos(deltaLambda));
|
||||
double etaPrim = atanh(cos(phiStar) * sin(deltaLambda));
|
||||
|
||||
double beta1 = 1/2.0 * n - 2/3.0 * pow(n, 2) + 5/16.0 * pow(n, 3)
|
||||
+ 41/180.0 * pow(n, 4);
|
||||
double beta2 = 13/48.0 * pow(n, 2) - 3/5.0 * pow(n, 3) + 557/1440.0
|
||||
* pow(n, 4);
|
||||
double beta3 = 61/240.0 * pow(n, 3) - 103/140.0 * pow(n, 4);
|
||||
double beta4 = 49561/161280.0 * pow(n, 4);
|
||||
|
||||
p.ry() = _falseNorthing + _scale * rectifyingRadius * (xiPrim + beta1
|
||||
* sin(2*xiPrim) * cosh(2*etaPrim) + beta2 * sin(4*xiPrim)
|
||||
* cosh(4*etaPrim) + beta3 * sin(6*xiPrim) * cosh(6*etaPrim) + beta4
|
||||
p.ry() = _falseNorthing + _scale * _rectifyingRadius * (xiPrim + _beta1
|
||||
* sin(2*xiPrim) * cosh(2*etaPrim) + _beta2 * sin(4*xiPrim)
|
||||
* cosh(4*etaPrim) + _beta3 * sin(6*xiPrim) * cosh(6*etaPrim) + _beta4
|
||||
* sin(8*xiPrim) * cosh(8*etaPrim));
|
||||
p.rx() = _falseEasting + _scale * rectifyingRadius * (etaPrim + beta1
|
||||
* cos(2*xiPrim) * sinh(2*etaPrim) + beta2 * cos(4*xiPrim)
|
||||
* sinh(4*etaPrim) + beta3 * cos(6*xiPrim) * sinh(6*etaPrim) + beta4
|
||||
p.rx() = _falseEasting + _scale * _rectifyingRadius * (etaPrim + _beta1
|
||||
* cos(2*xiPrim) * sinh(2*etaPrim) + _beta2 * cos(4*xiPrim)
|
||||
* sinh(4*etaPrim) + _beta3 * cos(6*xiPrim) * sinh(6*etaPrim) + _beta4
|
||||
* cos(8*xiPrim) * sinh(8*etaPrim));
|
||||
|
||||
return p;
|
||||
@ -68,38 +72,21 @@ QPointF TransverseMercator::ll2xy(const Coordinates &c) const
|
||||
|
||||
Coordinates TransverseMercator::xy2ll(const QPointF &p) const
|
||||
{
|
||||
const double e2 = WGS84_FLATTENING * (2 - WGS84_FLATTENING);
|
||||
const double n = WGS84_FLATTENING / (2 - WGS84_FLATTENING);
|
||||
const double rectifyingRadius = WGS84_RADIUS / (1 + n)
|
||||
* (1 + 0.25*pow(n, 2) + 0.015625*pow(n, 4));
|
||||
double xi = (p.y() - _falseNorthing) / (_scale * _rectifyingRadius);
|
||||
double eta = (p.x() - _falseEasting) / (_scale * _rectifyingRadius);
|
||||
|
||||
double xi = (p.y() - _falseNorthing) / (_scale * rectifyingRadius);
|
||||
double eta = (p.x() - _falseEasting) / (_scale * rectifyingRadius);
|
||||
|
||||
double delta1 = 1/2.0 * n - 2/3.0 * pow(n, 2) + 37/96.0 * pow(n, 3)
|
||||
- 1/360.0 * pow(n, 4);
|
||||
double delta2 = 1/48.0 * pow(n, 2) + 1/15.0 * pow(n, 3) - 437/1440.0
|
||||
* pow(n, 4);
|
||||
double delta3 = 17/480.0 * pow(n, 3) - 37/840.0 * pow(n, 4);
|
||||
double delta4 = 4397/161280.0 * pow(n, 4);
|
||||
|
||||
double xiPrim = xi - delta1 * sin(2*xi) * cosh(2*eta) - delta2 * sin(4*xi)
|
||||
* cosh(4*eta) - delta3 * sin(6*xi) * cosh(6*eta) - delta4 * sin(8*xi)
|
||||
double xiPrim = xi - _delta1 * sin(2*xi) * cosh(2*eta) - _delta2 * sin(4*xi)
|
||||
* cosh(4*eta) - _delta3 * sin(6*xi) * cosh(6*eta) - _delta4 * sin(8*xi)
|
||||
* cosh(8*eta);
|
||||
double etaPrim = eta - delta1 * cos(2*xi) * sinh(2*eta) - delta2 * cos(4*xi)
|
||||
* sinh(4*eta) - delta3 * cos(6*xi) * sinh(6*eta) - delta4 * cos(8*xi)
|
||||
* sinh(8*eta);
|
||||
double etaPrim = eta - _delta1 * cos(2*xi) * sinh(2*eta) - _delta2
|
||||
* cos(4*xi) * sinh(4*eta) - _delta3 * cos(6*xi) * sinh(6*eta) - _delta4
|
||||
* cos(8*xi) * sinh(8*eta);
|
||||
|
||||
double phiStar = asin(sin(xiPrim) / cosh(etaPrim));
|
||||
double deltaLambda = atan(sinh(etaPrim) / cos(xiPrim));
|
||||
|
||||
double AStar = e2 + pow(e2, 2) + pow(e2, 3) + pow(e2, 4);
|
||||
double BStar = (7 * pow(e2, 2) + 17 * pow(e2, 3) + 30 * pow(e2, 4)) / -6;
|
||||
double CStar = (224 * pow(e2, 3) + 889 * pow(e2, 4)) / 120;
|
||||
double DStar = (4279 * pow(e2, 4)) / -1260;
|
||||
|
||||
double phi = phiStar + sin(phiStar) * cos(phiStar) * (AStar + BStar
|
||||
* pow(sin(phiStar), 2) + CStar * pow(sin(phiStar), 4) + DStar
|
||||
double phi = phiStar + sin(phiStar) * cos(phiStar) * (_AStar + _BStar
|
||||
* pow(sin(phiStar), 2) + _CStar * pow(sin(phiStar), 4) + _DStar
|
||||
* pow(sin(phiStar), 6));
|
||||
|
||||
return Coordinates(_centralMeridian + rad2deg(deltaLambda), rad2deg(phi));
|
||||
|
@ -3,12 +3,13 @@
|
||||
|
||||
#include "projection.h"
|
||||
|
||||
class Ellipsoid;
|
||||
|
||||
class TransverseMercator : public Projection
|
||||
{
|
||||
public:
|
||||
TransverseMercator();
|
||||
TransverseMercator(double centralMeridian, double scale,
|
||||
double falseEasting, double falseNorthing);
|
||||
TransverseMercator(const Ellipsoid &ellipsoid, double centralMeridian,
|
||||
double scale, double falseEasting, double falseNorthing);
|
||||
|
||||
virtual QPointF ll2xy(const Coordinates &c) const;
|
||||
virtual Coordinates xy2ll(const QPointF &p) const;
|
||||
@ -18,6 +19,12 @@ private:
|
||||
double _scale;
|
||||
double _falseEasting;
|
||||
double _falseNorthing;
|
||||
|
||||
double _rectifyingRadius;
|
||||
double _A, _B, _C, _D;
|
||||
double _beta1, _beta2, _beta3, _beta4;
|
||||
double _delta1, _delta2, _delta3, _delta4;
|
||||
double _AStar, _BStar, _CStar, _DStar;
|
||||
};
|
||||
|
||||
#endif // TRANSVERSEMERCATOR_H
|
||||
|
13
src/utm.cpp
13
src/utm.cpp
@ -1,6 +1,14 @@
|
||||
#include "ellipsoid.h"
|
||||
#include "utm.h"
|
||||
|
||||
UTM::UTM(const Coordinates &c)
|
||||
UTM::UTM(const Ellipsoid &ellipsoid, int zone)
|
||||
: _tm(ellipsoid, (qAbs(zone) - 1)*6 - 180 + 3, 0.9996, 500000,
|
||||
zone < 0 ? 10000000 : 0)
|
||||
{
|
||||
}
|
||||
|
||||
UTM::UTM(const Ellipsoid &ellipsoid, const Coordinates &c)
|
||||
: _tm(ellipsoid, 0, 0, 0, 0)
|
||||
{
|
||||
int zone = int((c.lon() + 180)/6) + 1;
|
||||
|
||||
@ -18,5 +26,6 @@ UTM::UTM(const Coordinates &c)
|
||||
}
|
||||
double cm = (zone - 1)*6 - 180 + 3;
|
||||
|
||||
_tm = TransverseMercator(cm, 0.9996, 500000, (c.lat() < 0) ? 10000000 : 0);
|
||||
_tm = TransverseMercator(ellipsoid, cm, 0.9996, 500000,
|
||||
(c.lat() < 0) ? 10000000 : 0);
|
||||
}
|
||||
|
@ -7,9 +7,8 @@
|
||||
class UTM : public Projection
|
||||
{
|
||||
public:
|
||||
UTM(int zone) : _tm((qAbs(zone) - 1)*6 - 180 + 3, 0.9996, 500000,
|
||||
zone < 0 ? 10000000 : 0) {}
|
||||
UTM(const Coordinates &c);
|
||||
UTM(const Ellipsoid &ellipsoid, int zone);
|
||||
UTM(const Ellipsoid &ellipsoid, const Coordinates &c);
|
||||
|
||||
virtual QPointF ll2xy(const Coordinates &c) const
|
||||
{return _tm.ll2xy(c);}
|
||||
|
Reference in New Issue
Block a user