1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-07-23 15:14:24 +02:00

Compare commits

...

56 Commits

Author SHA1 Message Date
816681f267 Pillar LNDMRKs 2024-12-19 11:35:43 +01:00
d738555a68 Extended ACHARE areas 2024-12-19 11:18:53 +01:00
4e466d16a1 Merged ENC point and areas labels 2024-12-19 09:50:39 +01:00
b7bb3b649a BUAARE area labels 2024-12-18 18:48:50 +01:00
e0e9fa660a BERTHS polygons + NAVLNE restyling 2024-12-18 17:45:25 +01:00
67b91f62a0 Radar reflectors (RADRFL) 2024-12-18 13:58:49 +01:00
0ab6e02e6c RCTLPT areas and TSSLPT/RCTLPT points 2024-12-18 12:41:05 +01:00
7f20e2e307 Cosmetics 2024-12-17 11:28:23 +01:00
68f1f1fc3f Code cleanup 2024-12-17 10:55:01 +01:00
a4449897a7 Version++ 2024-12-16 15:03:02 +01:00
80a8ac260d const correctness 2024-12-10 19:13:00 +01:00
6673281e1c Removed obsolete comment 2024-12-10 09:23:25 +01:00
30157f8e4a Use Qt 6.8 in the Windows CI builds 2024-12-10 07:55:49 +01:00
12e3bbc988 Never use (semi)transparent areas 2024-12-05 18:13:37 +01:00
9d5ac81f2f Slipways 2024-12-04 00:24:17 +01:00
c0f97ddbd4 Distinguish parking types 2024-12-04 00:12:49 +01:00
d7d193871a Fixed broken placeholder 2024-12-03 23:35:21 +01:00
4b9bb04cec Translated using Weblate (Finnish)
Currently translated at 96.9% (473 of 488 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/fi/
2024-12-03 23:25:37 +01:00
d3889b6dfe Use the same locking algorithm like in IMG/Mapsforge maps 2024-12-03 20:25:38 +01:00
240ddaf39c Use the same locking algorithm like in IMG/Mapsforge maps 2024-12-03 20:20:40 +01:00
53685253d7 Quarry names 2024-12-03 09:21:52 +01:00
38486e594b Fountains + minor fixes 2024-12-03 07:14:28 +01:00
47dd212f47 Wayside crosses 2024-12-03 06:46:35 +01:00
a11ba0487c Improved tile loading parallelism 2024-12-01 12:34:26 +01:00
c014526bd9 Improved tile loading parallelism 2024-12-01 10:25:10 +01:00
f620bbc383 Reduce the number of file opens for IMG files 2024-11-30 00:13:35 +01:00
9ac10e2909 Cricket 2024-11-29 08:51:00 +01:00
5f623975f9 Volleyball 2024-11-29 08:42:18 +01:00
bd266ea73c Some more sports 2024-11-29 08:34:38 +01:00
6774e29d3f SVG code cleanup 2024-11-28 18:47:57 +01:00
a02f157bd8 Emergency stuff 2024-11-28 09:33:16 +01:00
4bad7c9b46 Power plants 2024-11-28 05:37:52 +01:00
93402dd4cd Neighbourhoods 2024-11-28 04:59:25 +01:00
f6dcf43c1a Track lines 2024-11-27 23:08:16 +01:00
7452650999 Missing railway areas 2024-11-27 07:37:13 +01:00
863f6ac58f Improved tracks rendering 2024-11-26 19:58:22 +01:00
a57b50e07c Distinguish peaks 2024-11-26 07:42:00 +01:00
450b8aad59 Version++ 2024-11-26 07:40:45 +01:00
2fcee5aae0 Translated using Weblate (Danish)
Currently translated at 100.0% (488 of 488 strings)

Translation: GPXSee/Translations
Translate-URL: https://hosted.weblate.org/projects/gpxsee/translations/da/
2024-11-24 14:33:57 +01:00
2fefd3ec55 Water bodies labels adjustments 2024-11-24 12:52:02 +01:00
8a3808248a Code cleanup 2024-11-24 09:09:45 +01:00
7d2bbfe12a Added missing rails 2024-11-24 02:54:19 +01:00
929035eee9 Fixed city labels fetching 2024-11-23 23:09:00 +01:00
cccda7395e Allow more labels for same symbol-id 2024-11-23 18:31:56 +01:00
93775a5adf Do not show the glaciers later than the other terain 2024-11-23 15:22:16 +01:00
f5b0c3f041 Quarters 2024-11-23 10:37:20 +01:00
c1eca4eacf Show the suburbs on lower zooms 2024-11-23 09:43:53 +01:00
6b0a08ae91 Bunkers 2024-11-23 07:15:17 +01:00
81751a2564 SVG code cleanup 2024-11-23 07:14:13 +01:00
4281e809be Redesigned City/town/village label sizes + suburbs 2024-11-22 22:37:07 +01:00
67820d7c4d Do not try to draw labels outside the tile rect 2024-11-22 21:52:32 +01:00
2a16a1f34c Fixed typo 2024-11-22 21:52:22 +01:00
a086c13648 Increase the vector tile caches size 2024-11-22 21:18:34 +01:00
85fd574b38 Do not try to draw labels outside the tile rect 2024-11-22 20:45:43 +01:00
62ae50ecda Always show the rails when the railway stations are shown 2024-11-22 19:11:27 +01:00
b969eef432 Version++ 2024-11-22 19:10:54 +01:00
54 changed files with 850 additions and 559 deletions

View File

@ -1,4 +1,4 @@
version: 13.31.{build} version: 13.34.{build}
configuration: configuration:
- Release - Release
@ -12,7 +12,7 @@ environment:
- QTDIR: C:\Qt\5.15\msvc2019_64 - QTDIR: C:\Qt\5.15\msvc2019_64
OPENSSLDIR: C:\OpenSSL-v111-Win64\bin OPENSSLDIR: C:\OpenSSL-v111-Win64\bin
NSISDEF: /DOPENSSL /DANGLE NSISDEF: /DOPENSSL /DANGLE
- QTDIR: C:\Qt\6.7\msvc2019_64 - QTDIR: C:\Qt\6.8\msvc2019_64
OPENSSLDIR: C:\OpenSSL-v33-Win64\bin OPENSSLDIR: C:\OpenSSL-v33-Win64\bin
NSISDEF: /DQT6 /DOPENSSL NSISDEF: /DQT6 /DOPENSSL

View File

@ -21,9 +21,9 @@
</rule> </rule>
<rule e="way" closed="yes" k="natural" v="rock|stone|bare_rock|bedrock" zoom-min="14"> <rule e="way" closed="yes" k="natural" v="rock|stone|bare_rock|bedrock" zoom-min="14">
<area fill="#60000000"/> <area fill="#96968f"/>
</rule> </rule>
<rule e="way" closed="yes" k="natural" v="glacier" zoom-min="12"> <rule e="way" closed="yes" k="natural" v="glacier" zoom-min="10">
<area fill="#ddf1fd"/> <area fill="#ddf1fd"/>
</rule> </rule>
@ -32,7 +32,7 @@
<area fill="#e4efcf"/> <area fill="#e4efcf"/>
</rule> </rule>
<rule e="way" closed="yes" k="landuse" v="construction|quarry|landfill|industrial|farm|farmyard" zoom-min="10"> <rule e="way" closed="yes" k="landuse" v="construction|quarry|landfill|industrial|farm|farmyard|railway" zoom-min="10">
<area fill="#d6d4ce"/> <area fill="#d6d4ce"/>
</rule> </rule>
<rule e="way" closed="yes" k="landuse" v="allotments" zoom-min="10"> <rule e="way" closed="yes" k="landuse" v="allotments" zoom-min="10">
@ -82,7 +82,13 @@
<!-- Water --> <!-- Water -->
<rule e="way" closed="yes" k="natural" v="water"> <rule e="way" closed="yes" k="natural" v="water">
<area fill="#9fc4e1"/> <area fill="#9fc4e1"/>
<rule e="way" k="*" v="*" zoom-min="14"> <rule e="way" k="bBoxWeight" v="~|mid|large|xlarge|xxlarge|xxxlarge" zoom-min="14" zoom-max="15">
<caption fill="#ffffff" font-size="12" font-family="serif" font-style="italic" k="name" stroke="#9fc4e1" stroke-width="2"/>
</rule>
<rule e="way" k="bBoxWeight" v="~|xsmall|small|mid|large|xlarge|xxlarge|xxxlarge" zoom-min="16" zoom-max="16">
<caption fill="#ffffff" font-size="12" font-family="serif" font-style="italic" k="name" stroke="#9fc4e1" stroke-width="2"/>
</rule>
<rule e="way" k="*" v="*" zoom-min="17">
<caption fill="#ffffff" font-size="12" font-family="serif" font-style="italic" k="name" stroke="#9fc4e1" stroke-width="2"/> <caption fill="#ffffff" font-size="12" font-family="serif" font-style="italic" k="name" stroke="#9fc4e1" stroke-width="2"/>
</rule> </rule>
</rule> </rule>
@ -167,21 +173,28 @@
</rule> </rule>
<rule e="way" closed="yes" k="amenity" v="parking" zoom-min="10"> <rule e="way" closed="yes" k="amenity" v="parking" zoom-min="10">
<area fill="#ffffff" stroke="#d5cdc0" stroke-width="0.1"/> <area fill="#ffffff" stroke="#d5cdc0" stroke-width="0.1"/>
<rule e="way" k="*" v="*" zoom-min="17"> <rule e="way" k="parking" v="~|surface|street_side|lane" zoom-min="17">
<symbol id="parking" src=":/POI/parking-11.svg" symbol-width="11"/> <symbol id="parking" src=":/POI/parking-11.svg" symbol-width="11"/>
</rule> </rule>
<rule e="way" k="parking" v="underground|multi-storey" zoom-min="17">
<symbol id="garage" src=":/POI/parking-garage-11.svg" symbol-width="11"/>
</rule>
</rule> </rule>
<rule e="way" closed="yes" k="highway" v="pedestrian" zoom-min="10"> <rule e="way" closed="yes" k="highway" v="pedestrian" zoom-min="10">
<area fill="#ffffff"/> <area fill="#ffffff"/>
</rule> </rule>
<rule e="way" closed="yes" k="leisure" v="pitch|playground|track" zoom-min="10"> <rule e="way" closed="yes" k="leisure" v="pitch|playground|track|ls_track" zoom-min="10">
<area fill="#e3edc6" stroke="#c9d3a5" stroke-width="1" scale="none"/> <area fill="#e3edc6" stroke="#c9d3a5" stroke-width="1" scale="none"/>
</rule> </rule>
<rule e="way" closed="yes" k="leisure" v="swimming_pool" zoom-min="10"> <rule e="way" closed="no" k="leisure" v="track|ls_track" zoom-min="10">
<line stroke="#c9d3a5" stroke-width="0.3"/>
<line stroke="#e3edc6" stroke-width="0.2"/>
</rule>
<rule e="way" closed="yes" k="leisure" v="swimming_pool" zoom-min="12">
<area fill="#9fc4e1" stroke="#4398d9" stroke-width="1" scale="none"/> <area fill="#9fc4e1" stroke="#4398d9" stroke-width="1" scale="none"/>
</rule> </rule>
<rule e="way" k="leisure" v="track" zoom-min="10"> <rule e="way" closed="yes" k="amenity" v="fountain" zoom-min="12">
<line stroke="#e3edc6" stroke-width="1"/> <area fill="#9fc4e1"/>
</rule> </rule>
<!-- Area overlays --> <!-- Area overlays -->
@ -449,7 +462,7 @@
<!-- Railways --> <!-- Railways -->
<rule e="way" k="tunnel" v="~|false|no"> <rule e="way" k="tunnel" v="~|false|no">
<rule e="way" k="railway" v="rail"> <rule e="way" k="railway" v="rail|preserved|disused">
<rule e="way" k="*" v="*" zoom-min="10" zoom-max="12"> <rule e="way" k="*" v="*" zoom-min="10" zoom-max="12">
<line stroke="#717171" stroke-width="1" stroke-linecap="butt"/> <line stroke="#717171" stroke-width="1" stroke-linecap="butt"/>
</rule> </rule>
@ -466,7 +479,7 @@
<line stroke="#ffffff" stroke-width="0.4608" stroke-dasharray="2,2" stroke-linecap="butt" scale="all"/> <line stroke="#ffffff" stroke-width="0.4608" stroke-dasharray="2,2" stroke-linecap="butt" scale="all"/>
</rule> </rule>
</rule> </rule>
<rule e="way" k="railway" v="narrow_gauge|light_rail|funicular" zoom-min="15"> <rule e="way" k="railway" v="narrow_gauge|light_rail|funicular" zoom-min="14">
<line stroke="#414141" stroke-width="0.2" stroke-linecap="butt"/> <line stroke="#414141" stroke-width="0.2" stroke-linecap="butt"/>
</rule> </rule>
<rule e="way" k="railway" v="tram" zoom-min="15"> <rule e="way" k="railway" v="tram" zoom-min="15">
@ -474,7 +487,7 @@
</rule> </rule>
</rule> </rule>
<rule e="way" k="tunnel" v="yes|true"> <rule e="way" k="tunnel" v="yes|true">
<rule e="way" k="railway" v="rail"> <rule e="way" k="railway" v="rail|preserved|disused">
<rule e="way" k="*" v="*" zoom-min="10" zoom-max="12"> <rule e="way" k="*" v="*" zoom-min="10" zoom-max="12">
<line stroke="#717171" stroke-width="1" stroke-linecap="butt" stroke-dasharray="10,8"/> <line stroke="#717171" stroke-width="1" stroke-linecap="butt" stroke-dasharray="10,8"/>
</rule> </rule>
@ -488,7 +501,7 @@
<line stroke="#878787" stroke-width="0.4144" stroke-linecap="butt" stroke-dasharray="2,1" scale="all"/> <line stroke="#878787" stroke-width="0.4144" stroke-linecap="butt" stroke-dasharray="2,1" scale="all"/>
</rule> </rule>
</rule> </rule>
<rule e="way" k="railway" v="narrow_gauge|light_rail|funicular" zoom-min="15"> <rule e="way" k="railway" v="narrow_gauge|light_rail|funicular" zoom-min="14">
<line stroke="#414141" stroke-width="0.2" stroke-linecap="butt" stroke-dasharray="12,4"/> <line stroke="#414141" stroke-width="0.2" stroke-linecap="butt" stroke-dasharray="12,4"/>
</rule> </rule>
<rule e="way" k="railway" v="tram" zoom-min="15"> <rule e="way" k="railway" v="tram" zoom-min="15">
@ -533,45 +546,91 @@
</rule> </rule>
</rule> </rule>
<!-- Town & vilage names --> <!-- Town & village names -->
<rule e="node" k="place" v="locality|isolated_dwelling|farm" zoom-min="14"> <rule e="node" k="place" v="locality|isolated_dwelling|farm" zoom-min="14">
<caption fill="#000000" font-size="10" k="name" priority="10" stroke="#FFFFFF" stroke-width="2"/> <caption fill="#000000" font-size="10" k="name" priority="10" stroke="#FFFFFF" stroke-width="2"/>
</rule> </rule>
<rule e="node" k="place" v="hamlet" zoom-min="12"> <rule e="node" k="place" v="hamlet" zoom-min="12">
<caption fill="#000000" font-size="12" k="name" priority="20" stroke="#FFFFFF" stroke-width="2"/> <caption fill="#000000" font-size="14" k="name" priority="20" stroke="#FFFFFF" stroke-width="2"/>
</rule> </rule>
<rule e="node" k="place" v="village" zoom-min="11"> <rule e="node" k="place" v="village" zoom-min="11">
<caption fill="#000000" font-size="12" k="name" priority="20" stroke="#FFFFFF" stroke-width="2"/> <caption fill="#000000" font-size="14" k="name" priority="20" stroke="#FFFFFF" stroke-width="2"/>
</rule> </rule>
<rule e="node" k="place" v="town" zoom-min="9"> <rule e="node" k="place" v="town" zoom-min="9" zoom-max="14">
<caption fill="#000000" font-size="14" k="name" priority="30" stroke="#FFFFFF" stroke-width="2"/> <rule e="node" k="*" v="*" zoom-max="10">
<caption fill="#000000" font-size="14" k="name" priority="30" stroke="#FFFFFF" stroke-width="2"/>
</rule>
<rule e="node" k="*" v="*" zoom-min="11">
<caption fill="#000000" font-size="16" k="name" font-style="bold" priority="30" stroke="#FFFFFF" stroke-width="2"/>
</rule>
</rule> </rule>
<rule e="node" k="place" v="city"> <rule e="node" k="place" v="city">
<rule e="node" k="capital" v="yes|1|2"> <rule e="node" k="*" v="*" zoom-max="10">
<caption fill="#000000" font-size="16" font-style="bold" k="name" priority="40" stroke="#FFFFFF" stroke-width="2" text-transform="uppercase"/> <rule e="node" k="capital" v="2">
<caption fill="#000000" font-size="18" font-style="bold" k="name" priority="40" stroke="#FFFFFF" stroke-width="2" text-transform="uppercase"/>
</rule>
<rule e="node" k="capital" v="4|~">
<caption fill="#000000" font-size="18" font-style="bold" k="name" priority="35" stroke="#FFFFFF" stroke-width="2"/>
</rule>
</rule> </rule>
<rule e="node" k="capital" v="no|~"> <rule e="node" k="*" v="*" zoom-min="11" zoom-max="14">
<caption fill="#000000" font-size="16" font-style="bold" k="name" priority="35" stroke="#FFFFFF" stroke-width="2"/> <rule e="node" k="capital" v="2">
<caption fill="#000000" font-size="22" font-style="bold" k="name" priority="40" stroke="#FFFFFF" stroke-width="2" text-transform="uppercase"/>
</rule>
<rule e="node" k="capital" v="4|~">
<caption fill="#000000" font-size="22" font-style="bold" k="name" priority="35" stroke="#FFFFFF" stroke-width="2"/>
</rule>
</rule> </rule>
</rule> </rule>
<rule e="node" k="place" v="suburb">
<rule e="node" k="*" v="*" zoom-min="12" zoom-max="13">
<caption fill="#000000" font-size="14" k="name" priority="25" stroke="#FFFFFF" stroke-width="2"/>
</rule>
<rule e="node" k="*" v="*" zoom-min="14" zoom-max="17">
<caption fill="#000000" font-size="16" k="name" priority="25" stroke="#FFFFFF" stroke-width="2"/>
</rule>
</rule>
<rule e="node" k="place" v="quarter" zoom-min="14" zoom-max="17">
<caption fill="#000000" font-size="14" k="name" priority="20" stroke="#FFFFFF" stroke-width="2"/>
</rule>
<rule e="node" k="place" v="neighbourhood" zoom-min="15" zoom-max="17">
<caption fill="#000000" font-size="12" k="name" priority="15" stroke="#FFFFFF" stroke-width="2"/>
</rule>
<!-- Nature POIs --> <!-- Nature POIs -->
<rule e="node" k="natural" v="peak" zoom-min="13"> <rule e="node" k="natural" v="peak" zoom-min="13">
<rule e="node" k="name" v="*"> <rule e="node" k="ele" v="*">
<symbol id="peak" src=":/POI/mountain-11.svg" symbol-width="11" priority="10"/> <rule e="node" k="name" v="*">
<caption fill="#000000" font-size="10" font-family="serif" font-style="italic" k="name" stroke="#FFFFFF" stroke-width="2" symbol-id="peak"/> <symbol id="peak" src=":/POI/triangle-11.svg" symbol-width="11" priority="10"/>
<caption fill="#000000" font-size="10" font-family="serif" font-style="italic" k="name" stroke="#FFFFFF" stroke-width="2" symbol-id="peak"/>
<rule e="node" k="*" v="*" zoom-min="14">
<caption fill="#000000" font-size="10" font-family="serif" font-style="italic" k="ele" stroke="#FFFFFF" stroke-width="2" symbol-id="peak" priority="-1"/>
</rule>
</rule>
</rule>
<rule e="node" k="ele" v="~" zoom-min="15">
<rule e="node" k="name" v="*">
<symbol id="peak-minor" src=":/POI/triangle-stroked-11.svg" symbol-width="11" priority="5"/>
<caption fill="#000000" font-size="10" font-family="serif" font-style="italic" k="name" stroke="#FFFFFF" stroke-width="2" symbol-id="peak-minor"/>
</rule>
</rule> </rule>
</rule> </rule>
<rule e="node" k="natural" v="saddle" zoom-min="13"> <rule e="node" k="natural" v="saddle" zoom-min="13">
<rule e="node" k="name" v="*"> <rule e="node" k="name" v="*">
<symbol id="saddle" src=":/symbols/saddle.svg" symbol-width="9" symbol-height="11" priority="9"/> <symbol id="saddle" src=":/symbols/saddle.svg" symbol-width="9" symbol-height="11" priority="9"/>
<caption fill="#000000" font-size="10" font-family="serif" font-style="italic" k="name" stroke="#FFFFFF" stroke-width="2" symbol-id="saddle"/> <caption fill="#000000" font-size="10" font-family="serif" font-style="italic" k="name" stroke="#FFFFFF" stroke-width="2" symbol-id="saddle"/>
<rule e="node" k="*" v="*" zoom-min="14">
<caption fill="#000000" font-size="10" font-family="serif" font-style="italic" k="ele" stroke="#FFFFFF" stroke-width="2" symbol-id="saddle" priority="-1"/>
</rule>
</rule> </rule>
</rule> </rule>
<rule e="node" k="natural" v="volcano" zoom-min="13"> <rule e="node" k="natural" v="volcano" zoom-min="13">
<rule e="node" k="name" v="*"> <rule e="node" k="name" v="*">
<symbol id="volcano" src=":/POI/volcano-11.svg" symbol-width="11" priority="10"/> <symbol id="volcano" src=":/POI/volcano-11.svg" symbol-width="11" priority="10"/>
<caption fill="#000000" font-size="10" font-family="serif" font-style="italic" k="name" stroke="#FFFFFF" stroke-width="2" symbol-id="volcano"/> <caption fill="#000000" font-size="10" font-family="serif" font-style="italic" k="name" stroke="#FFFFFF" stroke-width="2" symbol-id="volcano"/>
<rule e="node" k="*" v="*" zoom-min="14">
<caption fill="#000000" font-size="10" font-family="serif" font-style="italic" k="ele" stroke="#FFFFFF" stroke-width="2" symbol-id="volcano" priority="-1"/>
</rule>
</rule> </rule>
</rule> </rule>
<rule e="node" k="waterway" v="waterfall" zoom-min="15"> <rule e="node" k="waterway" v="waterfall" zoom-min="15">
@ -788,7 +847,7 @@
<caption fill="#000000" font-size="10" font-style="italic" k="name" stroke="#FFFFFF" stroke-width="2" symbol-id="post"/> <caption fill="#000000" font-size="10" font-style="italic" k="name" stroke="#FFFFFF" stroke-width="2" symbol-id="post"/>
</rule> </rule>
</rule> </rule>
<rule e="any" k="historic" v="memorial" zoom-min="17"> <rule e="any" k="historic" v="memorial|monument" zoom-min="17">
<symbol id="memorial" src=":/POI/monument-11.svg" symbol-width="11"/> <symbol id="memorial" src=":/POI/monument-11.svg" symbol-width="11"/>
<rule e="any" k="*" v="*" zoom-min="18"> <rule e="any" k="*" v="*" zoom-min="18">
<caption fill="#000000" font-size="10" font-style="italic" k="name" stroke="#FFFFFF" stroke-width="2" symbol-id="memorial"/> <caption fill="#000000" font-size="10" font-style="italic" k="name" stroke="#FFFFFF" stroke-width="2" symbol-id="memorial"/>
@ -821,7 +880,7 @@
<caption fill="#000000" font-size="10" font-style="italic" k="name" stroke="#FFFFFF" stroke-width="2" symbol-id="townhall"/> <caption fill="#000000" font-size="10" font-style="italic" k="name" stroke="#FFFFFF" stroke-width="2" symbol-id="townhall"/>
</rule> </rule>
</rule> </rule>
<rule e="any" k="amenity" v="university" zoom-min="16"> <rule e="any" k="amenity" v="university|college" zoom-min="16">
<symbol id="university" src=":/POI/college-11.svg" symbol-width="11"/> <symbol id="university" src=":/POI/college-11.svg" symbol-width="11"/>
<rule e="any" k="*" v="*" zoom-min="17"> <rule e="any" k="*" v="*" zoom-min="17">
<caption fill="#000000" font-size="10" font-style="italic" k="name" stroke="#FFFFFF" stroke-width="2" symbol-id="university"/> <caption fill="#000000" font-size="10" font-style="italic" k="name" stroke="#FFFFFF" stroke-width="2" symbol-id="university"/>
@ -896,6 +955,36 @@
<caption fill="#000000" font-size="10" font-style="italic" k="name" stroke="#FFFFFF" stroke-width="2" symbol-id="skateboard"/> <caption fill="#000000" font-size="10" font-style="italic" k="name" stroke="#FFFFFF" stroke-width="2" symbol-id="skateboard"/>
</rule> </rule>
</rule> </rule>
<rule e="any" k="sport" v="baseball" zoom-min="17">
<symbol id="baseball" src=":/POI/baseball-11.svg" symbol-width="11"/>
<rule e="any" k="*" v="*" zoom-min="18">
<caption fill="#000000" font-size="10" font-style="italic" k="name" stroke="#FFFFFF" stroke-width="2" symbol-id="baseball"/>
</rule>
</rule>
<rule e="any" k="sport" v="basketball" zoom-min="17">
<symbol id="basketball" src=":/POI/basketball-11.svg" symbol-width="11"/>
<rule e="any" k="*" v="*" zoom-min="18">
<caption fill="#000000" font-size="10" font-style="italic" k="name" stroke="#FFFFFF" stroke-width="2" symbol-id="basketball"/>
</rule>
</rule>
<rule e="any" k="sport" v="volleyball" zoom-min="17">
<symbol id="volleyball" src=":/POI/volleyball-11.svg" symbol-width="11"/>
<rule e="any" k="*" v="*" zoom-min="18">
<caption fill="#000000" font-size="10" font-style="italic" k="name" stroke="#FFFFFF" stroke-width="2" symbol-id="volleyball"/>
</rule>
</rule>
<rule e="any" k="sport" v="equestrian" zoom-min="17">
<symbol id="equestrian" src=":/POI/horse-riding-11.svg" symbol-width="11"/>
<rule e="any" k="*" v="*" zoom-min="18">
<caption fill="#000000" font-size="10" font-style="italic" k="name" stroke="#FFFFFF" stroke-width="2" symbol-id="equestrian"/>
</rule>
</rule>
<rule e="any" k="sport" v="cricket" zoom-min="17">
<symbol id="cricket" src=":/POI/cricket-11.svg" symbol-width="11"/>
<rule e="any" k="*" v="*" zoom-min="18">
<caption fill="#000000" font-size="10" font-style="italic" k="name" stroke="#FFFFFF" stroke-width="2" symbol-id="cricket"/>
</rule>
</rule>
<rule e="any" k="amenity" v="restaurant" zoom-min="17"> <rule e="any" k="amenity" v="restaurant" zoom-min="17">
<symbol id="restaurant" src=":/POI/restaurant-11.svg" symbol-width="11" priority="-5"/> <symbol id="restaurant" src=":/POI/restaurant-11.svg" symbol-width="11" priority="-5"/>
@ -1005,4 +1094,37 @@
</rule> </rule>
</rule> </rule>
<rule e="any" k="military" v="bunker|bunker_disused" zoom-min="17">
<symbol id="bunker" src=":/symbols/bunker.svg" symbol-width="11" symbol-height="9"/>
<rule e="any" k="*" v="*" zoom-min="18">
<caption fill="#000000" font-size="10" font-style="italic" k="name" stroke="#FFFFFF" stroke-width="2" symbol-id="bunker"/>
</rule>
</rule>
<rule e="any" k="historic" v="wayside_cross|wayside_shrine" zoom-min="17">
<symbol id="wayside-cross" src=":/symbols/cross.svg" symbol-width="6" symbol-height="8"/>
<rule e="any" k="*" v="*" zoom-min="18">
<caption fill="#000000" font-size="10" font-style="italic" k="name" stroke="#FFFFFF" stroke-width="2" symbol-id="wayside-cross"/>
</rule>
</rule>
<rule e="any" k="leisure" v="slipway" zoom-min="16">
<symbol id="slipway" src=":/POI/slipway-11.svg" symbol-width="11"/>
<rule e="any" k="*" v="*" zoom-min="17">
<caption fill="#000000" font-size="10" font-style="italic" k="name" stroke="#FFFFFF" stroke-width="2" symbol-id="slipway"/>
</rule>
</rule>
<rule e="any" k="power" v="plant" zoom-min="15">
<caption fill="#000000" font-size="10" font-style="italic" k="name" stroke="#FFFFFF" stroke-width="2" priority="1"/>
</rule>
<rule e="any" k="landuse" v="quarry" zoom-min="14">
<caption fill="#000000" font-size="10" font-style="italic" k="name" stroke="#FFFFFF" stroke-width="2"/>
</rule>
<rule e="any" k="emergency" v="phone" zoom-min="16">
<symbol id="phone" src=":/POI/telephone-11.svg" symbol-width="11"/>
</rule>
<rule e="any" k="emergency" v="defibrillator" zoom-min="16">
<symbol id="defibrillator" src=":/POI/defibrillator-11.svg" symbol-width="11"/>
</rule>
</rendertheme> </rendertheme>

View File

@ -3,7 +3,7 @@ unix:!macx:!android {
} else { } else {
TARGET = GPXSee TARGET = GPXSee
} }
VERSION = 13.31 VERSION = 13.34
QT += core \ QT += core \

View File

@ -6,7 +6,9 @@
<!-- Common map stuff --> <!-- Common map stuff -->
<qresource prefix="/symbols"> <qresource prefix="/symbols">
<file alias="bunker.svg">icons/map/symbols/bunker.svg</file>
<file alias="cliff.svg">icons/map/symbols/cliff.svg</file> <file alias="cliff.svg">icons/map/symbols/cliff.svg</file>
<file alias="cross.svg">icons/map/symbols/cross.svg</file>
<file alias="exit.svg">icons/map/symbols/exit.svg</file> <file alias="exit.svg">icons/map/symbols/exit.svg</file>
<file alias="flow.svg">icons/map/symbols/flow.svg</file> <file alias="flow.svg">icons/map/symbols/flow.svg</file>
<file alias="oneway.svg">icons/map/symbols/oneway.svg</file> <file alias="oneway.svg">icons/map/symbols/oneway.svg</file>
@ -23,6 +25,8 @@
<file alias="bank-11.svg">icons/map/POI/bank-11.svg</file> <file alias="bank-11.svg">icons/map/POI/bank-11.svg</file>
<file alias="bar-11.svg">icons/map/POI/bar-11.svg</file> <file alias="bar-11.svg">icons/map/POI/bar-11.svg</file>
<file alias="barrier-11.svg">icons/map/POI/barrier-11.svg</file> <file alias="barrier-11.svg">icons/map/POI/barrier-11.svg</file>
<file alias="baseball-11.svg">icons/map/POI/baseball-11.svg</file>
<file alias="basketball-11.svg">icons/map/POI/basketball-11.svg</file>
<file alias="bbq-11.svg">icons/map/POI/bbq-11.svg</file> <file alias="bbq-11.svg">icons/map/POI/bbq-11.svg</file>
<file alias="beach-11.svg">icons/map/POI/beach-11.svg</file> <file alias="beach-11.svg">icons/map/POI/beach-11.svg</file>
<file alias="beer-11.svg">icons/map/POI/beer-11.svg</file> <file alias="beer-11.svg">icons/map/POI/beer-11.svg</file>
@ -44,9 +48,11 @@
<file alias="college-11.svg">icons/map/POI/college-11.svg</file> <file alias="college-11.svg">icons/map/POI/college-11.svg</file>
<file alias="communications-tower-11.svg">icons/map/POI/communications-tower-11.svg</file> <file alias="communications-tower-11.svg">icons/map/POI/communications-tower-11.svg</file>
<file alias="convenience-11.svg">icons/map/POI/convenience-11.svg</file> <file alias="convenience-11.svg">icons/map/POI/convenience-11.svg</file>
<file alias="cricket-11.svg">icons/map/POI/cricket-11.svg</file>
<file alias="cross-11.svg">icons/map/POI/cross-11.svg</file> <file alias="cross-11.svg">icons/map/POI/cross-11.svg</file>
<file alias="dam-11.svg">icons/map/POI/dam-11.svg</file> <file alias="dam-11.svg">icons/map/POI/dam-11.svg</file>
<file alias="danger-11.svg">icons/map/POI/danger-11.svg</file> <file alias="danger-11.svg">icons/map/POI/danger-11.svg</file>
<file alias="defibrillator-11.svg">icons/map/POI/defibrillator-11.svg</file>
<file alias="doctor-11.svg">icons/map/POI/doctor-11.svg</file> <file alias="doctor-11.svg">icons/map/POI/doctor-11.svg</file>
<file alias="drinking-water-11.svg">icons/map/POI/drinking-water-11.svg</file> <file alias="drinking-water-11.svg">icons/map/POI/drinking-water-11.svg</file>
<file alias="fast-food-11.svg">icons/map/POI/fast-food-11.svg</file> <file alias="fast-food-11.svg">icons/map/POI/fast-food-11.svg</file>
@ -66,6 +72,7 @@
<file alias="hardware-11.svg">icons/map/POI/hardware-11.svg</file> <file alias="hardware-11.svg">icons/map/POI/hardware-11.svg</file>
<file alias="heliport-11.svg">icons/map/POI/heliport-11.svg</file> <file alias="heliport-11.svg">icons/map/POI/heliport-11.svg</file>
<file alias="home-11.svg">icons/map/POI/home-11.svg</file> <file alias="home-11.svg">icons/map/POI/home-11.svg</file>
<file alias="horse-riding-11.svg">icons/map/POI/horse-riding-11.svg</file>
<file alias="hospital-11.svg">icons/map/POI/hospital-11.svg</file> <file alias="hospital-11.svg">icons/map/POI/hospital-11.svg</file>
<file alias="hot-spring.svg">icons/map/POI/hot-spring.svg</file> <file alias="hot-spring.svg">icons/map/POI/hot-spring.svg</file>
<file alias="ice-cream-11.svg">icons/map/POI/ice-cream-11.svg</file> <file alias="ice-cream-11.svg">icons/map/POI/ice-cream-11.svg</file>
@ -81,6 +88,7 @@
<file alias="observation-tower.svg">icons/map/POI/observation-tower.svg</file> <file alias="observation-tower.svg">icons/map/POI/observation-tower.svg</file>
<file alias="park-11.svg">icons/map/POI/park-11.svg</file> <file alias="park-11.svg">icons/map/POI/park-11.svg</file>
<file alias="parking-11.svg">icons/map/POI/parking-11.svg</file> <file alias="parking-11.svg">icons/map/POI/parking-11.svg</file>
<file alias="parking-garage-11.svg">icons/map/POI/parking-garage-11.svg</file>
<file alias="pharmacy-11.svg">icons/map/POI/pharmacy-11.svg</file> <file alias="pharmacy-11.svg">icons/map/POI/pharmacy-11.svg</file>
<file alias="picnic-site-11.svg">icons/map/POI/picnic-site-11.svg</file> <file alias="picnic-site-11.svg">icons/map/POI/picnic-site-11.svg</file>
<file alias="place-of-worship-11.svg">icons/map/POI/place-of-worship-11.svg</file> <file alias="place-of-worship-11.svg">icons/map/POI/place-of-worship-11.svg</file>
@ -103,6 +111,7 @@
<file alias="skateboard-11.svg">icons/map/POI/skateboard-11.svg</file> <file alias="skateboard-11.svg">icons/map/POI/skateboard-11.svg</file>
<file alias="skiing-11.svg">icons/map/POI/skiing-11.svg</file> <file alias="skiing-11.svg">icons/map/POI/skiing-11.svg</file>
<file alias="slaughterhouse-11.svg">icons/map/POI/slaughterhouse-11.svg</file> <file alias="slaughterhouse-11.svg">icons/map/POI/slaughterhouse-11.svg</file>
<file alias="slipway-11.svg">icons/map/POI/slipway-11.svg</file>
<file alias="soccer-11.svg">icons/map/POI/soccer-11.svg</file> <file alias="soccer-11.svg">icons/map/POI/soccer-11.svg</file>
<file alias="stadium-11.svg">icons/map/POI/stadium-11.svg</file> <file alias="stadium-11.svg">icons/map/POI/stadium-11.svg</file>
<file alias="swimming-11.svg">icons/map/POI/swimming-11.svg</file> <file alias="swimming-11.svg">icons/map/POI/swimming-11.svg</file>
@ -111,9 +120,12 @@
<file alias="theatre-11.svg">icons/map/POI/theatre-11.svg</file> <file alias="theatre-11.svg">icons/map/POI/theatre-11.svg</file>
<file alias="toilet-11.svg">icons/map/POI/toilet-11.svg</file> <file alias="toilet-11.svg">icons/map/POI/toilet-11.svg</file>
<file alias="town-hall-11.svg">icons/map/POI/town-hall-11.svg</file> <file alias="town-hall-11.svg">icons/map/POI/town-hall-11.svg</file>
<file alias="triangle-11.svg">icons/map/POI/triangle-11.svg</file>
<file alias="triangle-stroked-11.svg">icons/map/POI/triangle-stroked-11.svg</file>
<file alias="viewpoint-11.svg">icons/map/POI/viewpoint-11.svg</file> <file alias="viewpoint-11.svg">icons/map/POI/viewpoint-11.svg</file>
<file alias="village-11.svg">icons/map/POI/village-11.svg</file> <file alias="village-11.svg">icons/map/POI/village-11.svg</file>
<file alias="volcano-11.svg">icons/map/POI/volcano-11.svg</file> <file alias="volcano-11.svg">icons/map/POI/volcano-11.svg</file>
<file alias="volleyball-11.svg">icons/map/POI/volleyball-11.svg</file>
<file alias="water-11.svg">icons/map/POI/water-11.svg</file> <file alias="water-11.svg">icons/map/POI/water-11.svg</file>
<file alias="waterfall-11.svg">icons/map/POI/waterfall-11.svg</file> <file alias="waterfall-11.svg">icons/map/POI/waterfall-11.svg</file>
<file alias="watermill-11.svg">icons/map/POI/watermill-11.svg</file> <file alias="watermill-11.svg">icons/map/POI/watermill-11.svg</file>
@ -194,6 +206,7 @@
<file alias="kelp.png">icons/map/marine/kelp.png</file> <file alias="kelp.png">icons/map/marine/kelp.png</file>
<file alias="eddies.png">icons/map/marine/eddies.png</file> <file alias="eddies.png">icons/map/marine/eddies.png</file>
<file alias="dome.png">icons/map/marine/dome.png</file> <file alias="dome.png">icons/map/marine/dome.png</file>
<file alias="radar-reflector.png">icons/map/marine/radar-reflector.png</file>
</qresource> </qresource>
<!-- Patterns (Mapsforge) --> <!-- Patterns (Mapsforge) -->

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.1" id="baseball-11" xmlns="http://www.w3.org/2000/svg" width="11px" height="11px" viewBox="0 0 11 11">
<path d="M7,3c0,0.5523-0.4477,1-1,1S5,3.5523,5,3s0.4477-1,1-1S7,2.4477,7,3z M9.85,10.24L9.85,10.24l-3-4.85&#xA;&#x9;C6.7391,5.2011,6.5603,5.0616,6.35,5H2.5C2.2239,5,2,5.2239,2,5.5S2.2239,6,2.5,6H5l0.92,1.09l-2.73,3l0,0&#xA;&#x9;C3.0637,10.1876,2.9928,10.3405,3,10.5C3,10.7761,3.2239,11,3.5,11c0.1224-0.0006,0.2401-0.047,0.33-0.13l0,0l3-2.71L9,10.81l0,0&#xA;&#x9;c0.0912,0.1178,0.231,0.1877,0.38,0.19c0.2761,0,0.5-0.2239,0.5-0.5C9.8938,10.4122,9.8834,10.3223,9.85,10.24z M4,0.28&#xA;&#x9;C4,0.1254,3.8746,0,3.72,0C3.6221,0.0262,3.5348,0.0821,3.47,0.16L2,4.59C1.9941,4.6331,1.9941,4.6769,2,4.72&#xA;&#x9;C2,4.8746,2.1254,5,2.28,5c0.1015-0.0243,0.1926-0.0803,0.26-0.16L4,0.41C4.006,0.3669,4.006,0.3231,4,0.28z"/>
</svg>

After

Width:  |  Height:  |  Size: 876 B

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg id="basketball-11" xmlns="http://www.w3.org/2000/svg" width="11" height="11" viewBox="0 0 11 11">
<path id="icon_concepts:_sports_leisure" d="M2.63,3.51a5.1555,5.1555,0,0,1,.34,1.48H2.04A3.2586,3.2586,0,0,1,2.63,3.51Zm.55-.63a6.2022,6.2022,0,0,1,.55,2.11H5.12V2.01A3.4256,3.4256,0,0,0,3.18,2.88Zm2.7-.87V4.99H7.27a6.2022,6.2022,0,0,1,.55-2.11A3.4256,3.4256,0,0,0,5.88,2.01Zm2.49,1.5a5.1555,5.1555,0,0,0-.34,1.48h.93A3.2586,3.2586,0,0,0,8.37,3.51ZM9.9,6.5a.4952.4952,0,0,1-.49.5H8.44L7.91,8.05v1.7a.2176.2176,0,0,1-.14.2.236.236,0,0,1-.08.02.1987.1987,0,0,1-.16-.07l-.75-.74-1.16.77a.2107.2107,0,0,1-.24,0L4.22,9.16l-.75.74a.2222.2222,0,0,1-.38-.15V8.05L2.57,7H1.6a.5.5,0,1,1,0-1H9.4a.4951.4951,0,0,1,.5.49ZM3.53,8V9.22l.5-.5c.01,0,.01-.01.02-.01L5.1,7H3.06l.45.9A.3561.3561,0,0,1,3.53,8Zm2.97.82-1-1.63-1,1.63,1,.67ZM7.94,7H5.9L6.95,8.71c.01,0,.01.01.02.01l.5.5V8a.3561.3561,0,0,1,.02-.1Z"/>
</svg>

After

Width:  |  Height:  |  Size: 944 B

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.1" id="cricket-11" xmlns="http://www.w3.org/2000/svg" width="11px" height="11px" viewBox="0 0 11 11">
<path d="M6,1c0,0.5523-0.4477,1-1,1S4,1.5523,4,1s0.4477-1,1-1S6,0.4477,6,1z M8.88,5.18l-1-2l0,0l0,0&#xA;&#x9;C7.7859,3.0671,7.647,3.0012,7.5,3H2.77C2.3827,2.9815,2.0467,3.2651,2,3.65l0,0l-1,6.71l0,0c-0.0068,0.0464-0.0068,0.0936,0,0.14&#xA;&#x9;C1,10.7761,1.2239,11,1.5,11c0.2307,0.0129,0.4391-0.1371,0.5-0.36l0,0l1.22-3.89l0,0l0.21-0.83l0.4,0.44l0,0L5,7.6v2.9&#xA;&#x9;C5,10.7761,5.2239,11,5.5,11S6,10.7761,6,10.5v-3l0,0l0,0C5.9971,7.3984,5.9621,7.3004,5.9,7.22l0,0L4.45,5.5L5.5,4h1.71l0.92,1.84&#xA;&#x9;l0,0C8.2247,5.9439,8.3594,6.0022,8.5,6C8.7723,6.0001,8.9946,5.7822,9,5.51C8.9826,5.3931,8.9418,5.2808,8.88,5.18z M10.5,8&#xA;&#x9;C10.2239,8,10,8.2239,10,8.5S10.2239,9,10.5,9S11,8.7761,11,8.5S10.7761,8,10.5,8z M8.69,8V7.25C8.69,7.1119,8.5781,7,8.44,7&#xA;&#x9;S8.19,7.1119,8.19,7.25V8C8.0378,8.0855,7.9426,8.2455,7.94,8.42v2.08c0,0.2761,0.2239,0.5,0.5,0.5s0.5-0.2239,0.5-0.5V8.41&#xA;&#x9;C8.9339,8.2391,8.8392,8.0837,8.69,8z"/>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="11" height="11" viewBox="0 0 11 11" id="defibrillator-11">
<path d="M1.42,4.7955C-0.2131,1.5291,3.9327-.6514,5.512,2.6149,7.0914-.6514,11.2371,1.5291,9.6039,4.7955c-0.0225.0377-.0483,0.0732-0.071,0.1108H8.3867L7.5586,3.252a0.65,0.65,0,0,0-1.1172,0L5,6.1338,4.5586,5.252A0.6243,0.6243,0,0,0,4,4.9063H1.4913C1.4685,4.8687,1.4427,4.8332,1.42,4.7955ZM8,6.1563a0.6243,0.6243,0,0,1-.5586-0.3457L7,4.9287,5.5586,7.8105a0.6241,0.6241,0,0,1-1.1172,0L3.6133,6.1563H2.3006a24.2269,24.2269,0,0,0,2.8973,3.449L5.2134,9.6208A0.44,0.44,0,0,0,5.835,9.6053a24.2289,24.2289,0,0,0,2.8905-3.449H8Z"/>
</svg>

After

Width:  |  Height:  |  Size: 675 B

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg id="horse-riding-11" xmlns="http://www.w3.org/2000/svg" width="11" height="11" viewBox="0 0 11 11">
<path d="M4,1A1,1,0,1,1,5,2,1,1,0,0,1,4,1Zm6.88,3.5L9,3V2.5L7,5H6L7,6V7.014a.5.5,0,1,1-1,0V6.5L4,5H3a1,1,0,0,0-.8.446A1.189,1.189,0,0,0,1.247,5,1.076,1.076,0,0,0,0,5.988C0,7.3.635,7.471.635,7.471a.33.33,0,0,0,.115.023A.253.253,0,0,0,1,7.25V6a.49.49,0,0,1,.48-.5H1.5A.5.5,0,0,1,2,6V8.014l-.3.6a1.609,1.609,0,0,0-.2.6v1.542A.244.244,0,0,0,1.744,11,.255.255,0,0,0,2,10.756V9.514a.367.367,0,0,1,.1-.3l.9-1.2V9l.467,1.816A.256.256,0,0,0,3.709,11a.25.25,0,0,0,.25-.25v-.016l-.242-1.61a.6.6,0,0,1,.025-.236L3.8,8.714,4,8H6V9l.466,1.816A.256.256,0,0,0,6.709,11a.25.25,0,0,0,.25-.25L6.718,9.124a.6.6,0,0,1,.025-.236L7,8a.877.877,0,0,0,.934-.661L8.5,4.5a.6.6,0,0,0,.71.454.562.562,0,0,0,.143-.07l.9.116a.721.721,0,0,0,.392.1A.331.331,0,0,0,11,4.784.406.406,0,0,0,10.88,4.5ZM6,3.5A.51.51,0,0,0,5.5,3h-1a.482.482,0,0,0-.5.5V5H6Z"/>
</svg>

After

Width:  |  Height:  |  Size: 972 B

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.1" id="parking-garage-11" xmlns="http://www.w3.org/2000/svg" width="11px" height="11px" viewBox="0 0 11 11">
<path d="M7.25,7.44C6.8067,7.7602,6.2657,7.9158,5.72,7.88H4.45V10H3.19V4H5.8c0.5201-0.0279,1.0324,0.1358,1.44,0.46&#xA;&#x9;c0.3847,0.372,0.5828,0.8966,0.54,1.43C7.8557,6.4611,7.6596,7.0348,7.25,7.44z M6.25,5.28c-0.1946-0.1475-0.4365-0.2186-0.68-0.2&#xA;&#x9;H4.45v1.76H5.6c0.246,0.0129,0.4882-0.0654,0.68-0.22c0.1746-0.1813,0.2621-0.4293,0.24-0.68c0.023-0.2449-0.0651-0.4871-0.24-0.66&#xA;&#x9;L6.25,5.28z M10.41,3.28c0.1349-0.2403,0.0499-0.5444-0.19-0.68l-4.5-2.5c-0.1521-0.0855-0.3379-0.0855-0.49,0l-4.5,2.5&#xA;&#x9;C0.4972,2.7485,0.4288,3.0576,0.5773,3.2904C0.7144,3.5054,0.9913,3.5828,1.22,3.47l4.28-2.4l4.26,2.37&#xA;&#x9;c0.2421,0.1328,0.546,0.0442,0.6789-0.1979C10.4392,3.2414,10.4396,3.2407,10.44,3.24L10.41,3.28z"/>
</svg>

After

Width:  |  Height:  |  Size: 899 B

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg id="slipway-11" xmlns="http://www.w3.org/2000/svg" width="11" height="11" viewBox="0 0 11 11">
<g id="slipway-final">
<path d="M1.0417,8l8,1.3794V10h-8Zm8-4-1,1v.625L3.7345,4.01l.0777-.2852.86-.8447H5.5a.35.35,0,0,0,0-.6992H4.529a.3478.3478,0,0,0-.2451.1L3.2546,3.291a.3566.3566,0,0,0-.0928.1582l-.0856.3137L1.0417,3C1.0948,4,1,5.5094,3,5.8844,3.9829,6.0687,8.0948,7,8.0948,7l1.9469-2Z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 452 B

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.1" id="triangle-11" xmlns="http://www.w3.org/2000/svg" width="11px" height="11px" viewBox="0 0 11 11">
<path id="rect3338" d="M5.5174,1.2315&#xA;&#x9;C5.3163,1.2253,5.1276,1.328,5.024,1.5l-4,6.6598C0.8013,8.5293,1.0679,8.9999,1.5,9h8c0.4321-0.0001,0.6987-0.4707,0.476-0.8402&#xA;&#x9;l-4-6.6598C5.8787,1.3386,5.706,1.2375,5.5174,1.2315z"/>
</svg>

After

Width:  |  Height:  |  Size: 403 B

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.1" id="triangle-stroked-11" xmlns="http://www.w3.org/2000/svg" width="11px" height="11px" viewBox="0 0 11 11">
<path id="rect3338" d="M5.5174,1.2315&#xA;&#x9;C5.3163,1.2253,5.1276,1.328,5.024,1.5l-4,6.6598C0.8013,8.5293,1.0679,8.9999,1.5,9h8c0.4321-0.0001,0.6987-0.4707,0.476-0.8402&#xA;&#x9;l-4-6.6598C5.8787,1.3386,5.706,1.2375,5.5174,1.2315z M5.5,2.8627l3.0191,5.0286H2.4809L5.5,2.8627z"/>
</svg>

After

Width:  |  Height:  |  Size: 456 B

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg id="volleyball-11" xmlns="http://www.w3.org/2000/svg" width="11" height="11" viewBox="0 0 11 11">
<path d="M9.99,5.73a3.6572,3.6572,0,0,1-.1.74A6.3224,6.3224,0,0,0,7.44,5.05a5.9537,5.9537,0,0,0-1.32-.27c-.03,0-.07-.01-.11-.01A4.6052,4.6052,0,0,1,5.5,3.64a1.0563,1.0563,0,0,1-.06-.24h.12a4.8784,4.8784,0,0,1,1.01.11,5.0388,5.0388,0,0,1,1.14.36,4.8341,4.8341,0,0,1,.94.53A5.1356,5.1356,0,0,1,9.99,5.73ZM9.33,7.31a5.1964,5.1964,0,0,0-1.36-.97c-.05.1-.11.19-.17.29a5.8645,5.8645,0,0,1-.59.82,7.1807,7.1807,0,0,1-.78.78,6.72,6.72,0,0,1-.93.65,6.3643,6.3643,0,0,1-1.86.72,4.524,4.524,0,0,0,3.72,0,4.1584,4.1584,0,0,0,1.25-.86,3.1983,3.1983,0,0,0,.43-.47,3.7473,3.7473,0,0,0,.48-.76A1.1915,1.1915,0,0,0,9.33,7.31ZM8.68,2.32a4.5077,4.5077,0,0,0-1.24-.88,3.979,3.979,0,0,0-.75-.28,4.3423,4.3423,0,0,0-1.03-.15,1.2787,1.2787,0,0,0-.32,0A5.3628,5.3628,0,0,0,5.25,2c0,.14.01.28.02.41a1.6165,1.6165,0,0,1,.22-.01,1.9237,1.9237,0,0,1,.24.01,6.6508,6.6508,0,0,1,1,.11,5.6947,5.6947,0,0,1,1,.28,6.7814,6.7814,0,0,1,1.02.47,6.6645,6.6645,0,0,1,.98.69A4.5655,4.5655,0,0,0,8.68,2.32ZM3.03,6.34a5.808,5.808,0,0,1-.4-.92,5.7849,5.7849,0,0,1-.28-1.03,6.86,6.86,0,0,1-.1-1.12V3.25a5.656,5.656,0,0,1,.07-.93A4.3939,4.3939,0,0,0,1.27,3.97,4.3206,4.3206,0,0,0,1,5.5a1.7671,1.7671,0,0,0,.01.23,4.4161,4.4161,0,0,0,.09.73,4.0749,4.0749,0,0,0,.31.91,1.0685,1.0685,0,0,0,.27-.07A5.0679,5.0679,0,0,0,3.2,6.63C3.14,6.53,3.08,6.44,3.03,6.34Zm3.88-.4a5.4992,5.4992,0,0,0-1.35-.19c-.02.03-.04.05-.06.08a6.2466,6.2466,0,0,1-.91,1.01,5.8334,5.8334,0,0,1-.8.61,6.5727,6.5727,0,0,1-1.83.82,3.1983,3.1983,0,0,0,.43.47,5.1724,5.1724,0,0,0,2.18-.51,5.4146,5.4146,0,0,0,.93-.55,5.5958,5.5958,0,0,0,.91-.84A4.8049,4.8049,0,0,0,7,6.01a.0517.0517,0,0,0,.02-.04A.2283.2283,0,0,0,6.91,5.94ZM4.88,4.78a5.6391,5.6391,0,0,1-.45-1.27,6.3861,6.3861,0,0,1-.16-.99c-.01-.17-.02-.35-.02-.52a5.83,5.83,0,0,1,.06-.84,3.9815,3.9815,0,0,0-.75.28A5.5806,5.5806,0,0,0,3.27,2.8c-.01.15-.02.3-.02.45a4.2153,4.2153,0,0,0,.04.62,4.7107,4.7107,0,0,0,.27,1.18,5.0984,5.0984,0,0,0,.42.92A.0517.0517,0,0,0,4,6.01a.1778.1778,0,0,0,.08-.07h.01a5.6817,5.6817,0,0,0,.84-1.06A.3131.3131,0,0,1,4.88,4.78Z"/>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 B

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg viewBox="0 0 11 9" height="9" width="11" version="1.1">
<g stroke-width="1.5" stroke="#000000" fill="none">
<rect x="2" y="2" width="7" height="5"/>
<line x1="0" y1="0" x2="2" y2="2"/>
<line x1="11" y1="0" x2="9" y2="2"/>
<line x1="0" y1="9" x2="2" y2="7"/>
<line x1="11" y1="9" x2="9" y2="7"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 363 B

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<svg viewBox="0 0 4 5" height="5" width="4" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg"> <svg viewBox="0 0 4 5" height="5" width="4" version="1.1">
<g> <g stroke-width="1.0" stroke="#666666">
<path d="M 0.5,0 V 5" stroke-width="1.0" stroke="#666666"/> <path d="M 0.5,0 V 5"/>
<path d="M 0,0.5 H 4" stroke-width="1.0" stroke="#666666"/> <path d="M 0,0.5 H 4"/>
</g> </g>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 320 B

After

Width:  |  Height:  |  Size: 204 B

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="6" height="8" version="1.1" viewBox="0 0 6 8">
<path d="M 0.5,3 L 5.5,3 M 3,0.5 L 3,7.5" stroke="#000000" stroke-width="1"/>
</svg>

After

Width:  |  Height:  |  Size: 184 B

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="15" height="11" viewBox="0 0 15 11" version="1.1"> <svg width="15" height="11" viewBox="0 0 15 11" version="1.1">
<g> <g stroke="none" fill="#000000">
<path style="stroke:none;fill-rule:nonzero;fill:rgb(0%,0%,0%);fill-opacity:1;" d="M 15.007812 0.132812 C 15.007812 0.230469 15.007812 0.324219 15.007812 0.421875 C 14.570312 1.402344 14.0625 2.710938 13.589844 3.875 C 13.480469 4.140625 13.316406 4.886719 12.96875 4.859375 C 12.683594 4.835938 12.535156 4.089844 12.445312 3.8125 C 12.292969 3.339844 12.210938 3.003906 12.074219 2.605469 C 10.507812 3.261719 9.367188 4.308594 9.421875 6.476562 C 9.460938 8.195312 10.074219 9.632812 10.441406 11.007812 C 8.917969 11.007812 7.394531 11.007812 5.871094 11.007812 C 5.730469 7.347656 5.59375 3.683594 5.46875 0.0078125 C 5.996094 0.0078125 6.519531 0.0078125 7.042969 0.0078125 C 7.40625 1.230469 7.800781 2.421875 8.15625 3.652344 C 8.941406 2.871094 10.023438 2.042969 11.335938 1.65625 C 11.128906 1.378906 10.828125 1.179688 10.5625 0.957031 C 10.320312 0.757812 9.9375 0.570312 9.945312 0.132812 C 10.007812 0.113281 10.015625 0.0390625 10.070312 0.0078125 C 11.675781 0.0078125 13.28125 0.0078125 14.882812 0.0078125 C 14.898438 0.046875 14.921875 0.0742188 14.976562 0.0703125 C 14.972656 0.109375 14.984375 0.128906 15.007812 0.132812 Z M 15.007812 0.132812 "/> <path d="M 15.007812 0.132812 C 15.007812 0.230469 15.007812 0.324219 15.007812 0.421875 C 14.570312 1.402344 14.0625 2.710938 13.589844 3.875 C 13.480469 4.140625 13.316406 4.886719 12.96875 4.859375 C 12.683594 4.835938 12.535156 4.089844 12.445312 3.8125 C 12.292969 3.339844 12.210938 3.003906 12.074219 2.605469 C 10.507812 3.261719 9.367188 4.308594 9.421875 6.476562 C 9.460938 8.195312 10.074219 9.632812 10.441406 11.007812 C 8.917969 11.007812 7.394531 11.007812 5.871094 11.007812 C 5.730469 7.347656 5.59375 3.683594 5.46875 0.0078125 C 5.996094 0.0078125 6.519531 0.0078125 7.042969 0.0078125 C 7.40625 1.230469 7.800781 2.421875 8.15625 3.652344 C 8.941406 2.871094 10.023438 2.042969 11.335938 1.65625 C 11.128906 1.378906 10.828125 1.179688 10.5625 0.957031 C 10.320312 0.757812 9.9375 0.570312 9.945312 0.132812 C 10.007812 0.113281 10.015625 0.0390625 10.070312 0.0078125 C 11.675781 0.0078125 13.28125 0.0078125 14.882812 0.0078125 C 14.898438 0.046875 14.921875 0.0742188 14.976562 0.0703125 C 14.972656 0.109375 14.984375 0.128906 15.007812 0.132812 Z M 15.007812 0.132812"/>
<path style="stroke:none;fill-rule:nonzero;fill:rgb(0%,0%,0%);fill-opacity:1;" d="M 3.433594 0.0078125 C 3.957031 0.0078125 4.484375 0.0078125 5.007812 0.0078125 C 4.867188 3.667969 4.730469 7.332031 4.605469 11.007812 C 3.074219 11.007812 1.539062 11.007812 0.0078125 11.007812 C 0.0078125 10.976562 0.0078125 10.945312 0.0078125 10.914062 C 1.171875 7.300781 2.277344 3.628906 3.433594 0.0078125 Z M 3.433594 0.0078125 "/> <path d="M 3.433594 0.0078125 C 3.957031 0.0078125 4.484375 0.0078125 5.007812 0.0078125 C 4.867188 3.667969 4.730469 7.332031 4.605469 11.007812 C 3.074219 11.007812 1.539062 11.007812 0.0078125 11.007812 C 0.0078125 10.976562 0.0078125 10.945312 0.0078125 10.914062 C 1.171875 7.300781 2.277344 3.628906 3.433594 0.0078125 Z M 3.433594 0.0078125"/>
</g> </g>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<svg viewBox="0 0 9 11" height="11" width="9" version="1.1"> <svg viewBox="0 0 9 11" height="11" width="9" version="1.1">
<g> <g stroke-width="1" stroke="#000000" fill="none">
<path d="M 1.5,1.5 L3,3 L 3,8 L 1.5,9.5" stroke-width="1" stroke="#000000" fill="none"/> <path d="M 1.5,1.5 L3,3 L 3,8 L 1.5,9.5"/>
<path d="M 7.5,1.5 L6,3 L 6,8 L 7.5,9.5" stroke-width="1" stroke="#000000" fill="none"/> <path d="M 7.5,1.5 L6,3 L 6,8 L 7.5,9.5"/>
</g> </g>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 300 B

After

Width:  |  Height:  |  Size: 254 B

View File

@ -172,7 +172,7 @@
<message> <message>
<location filename="../src/data/data.cpp" line="180"/> <location filename="../src/data/data.cpp" line="180"/>
<source>GPSDump files</source> <source>GPSDump files</source>
<translation type="unfinished"></translation> <translation>GPSDump-filer</translation>
</message> </message>
<message> <message>
<location filename="../src/data/data.cpp" line="181"/> <location filename="../src/data/data.cpp" line="181"/>
@ -414,7 +414,7 @@
<message> <message>
<location filename="../src/GUI/gui.cpp" line="276"/> <location filename="../src/GUI/gui.cpp" line="276"/>
<source>Clear list</source> <source>Clear list</source>
<translation type="unfinished"></translation> <translation>Ryd liste</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/gui.cpp" line="288"/> <location filename="../src/GUI/gui.cpp" line="288"/>
@ -486,17 +486,17 @@
<message> <message>
<location filename="../src/GUI/gui.cpp" line="370"/> <location filename="../src/GUI/gui.cpp" line="370"/>
<source>All</source> <source>All</source>
<translation type="unfinished"></translation> <translation>Alle</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/gui.cpp" line="374"/> <location filename="../src/GUI/gui.cpp" line="374"/>
<source>Raster only</source> <source>Raster only</source>
<translation type="unfinished"></translation> <translation>Kun raster</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/gui.cpp" line="378"/> <location filename="../src/GUI/gui.cpp" line="378"/>
<source>Vector only</source> <source>Vector only</source>
<translation type="unfinished"></translation> <translation>Kun vektor</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/gui.cpp" line="385"/> <location filename="../src/GUI/gui.cpp" line="385"/>
@ -591,7 +591,7 @@
<message> <message>
<location filename="../src/GUI/gui.cpp" line="490"/> <location filename="../src/GUI/gui.cpp" line="490"/>
<source>Show hillshading</source> <source>Show hillshading</source>
<translation type="unfinished"></translation> <translation>Vis terrænskygge</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/gui.cpp" line="498"/> <location filename="../src/GUI/gui.cpp" line="498"/>
@ -713,7 +713,7 @@
<message> <message>
<location filename="../src/GUI/gui.cpp" line="664"/> <location filename="../src/GUI/gui.cpp" line="664"/>
<source>Open recent</source> <source>Open recent</source>
<translation type="unfinished"></translation> <translation>Åbn seneste</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/gui.cpp" line="689"/> <location filename="../src/GUI/gui.cpp" line="689"/>
@ -723,7 +723,7 @@
<message> <message>
<location filename="../src/GUI/gui.cpp" line="695"/> <location filename="../src/GUI/gui.cpp" line="695"/>
<source>Layers</source> <source>Layers</source>
<translation type="unfinished"></translation> <translation>Lag</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/gui.cpp" line="704"/> <location filename="../src/GUI/gui.cpp" line="704"/>
@ -772,9 +772,9 @@
<message numerus="yes"> <message numerus="yes">
<location filename="../src/GUI/gui.cpp" line="2001"/> <location filename="../src/GUI/gui.cpp" line="2001"/>
<source>Download %n DEM tiles?</source> <source>Download %n DEM tiles?</source>
<translation type="unfinished"> <translation>
<numerusform></numerusform> <numerusform>Download %n DEM-flise?</numerusform>
<numerusform></numerusform> <numerusform>Download %n DEM-fliser?</numerusform>
</translation> </translation>
</message> </message>
<message> <message>
@ -785,12 +785,12 @@
<message> <message>
<location filename="../src/GUI/gui.cpp" line="476"/> <location filename="../src/GUI/gui.cpp" line="476"/>
<source>Download data DEM</source> <source>Download data DEM</source>
<translation type="unfinished"></translation> <translation>Download data-DEM</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/gui.cpp" line="482"/> <location filename="../src/GUI/gui.cpp" line="482"/>
<source>Download map DEM</source> <source>Download map DEM</source>
<translation type="unfinished"></translation> <translation>Download kort-DEM</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/gui.cpp" line="721"/> <location filename="../src/GUI/gui.cpp" line="721"/>
@ -1053,7 +1053,7 @@
<message> <message>
<location filename="../src/GUI/gui.cpp" line="1998"/> <location filename="../src/GUI/gui.cpp" line="1998"/>
<source>DEM tiles download limit exceeded. If you really need data for such a huge area, download the files manually.</source> <source>DEM tiles download limit exceeded. If you really need data for such a huge area, download the files manually.</source>
<translation type="unfinished"></translation> <translation>Downloadgrænsen for DEM-fliser er overskredet. Hvis du virkelig har brug for data for stort et område, skal du downloade filerne manuelt.</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/gui.cpp" line="2014"/> <location filename="../src/GUI/gui.cpp" line="2014"/>
@ -1790,7 +1790,7 @@
<location filename="../src/GUI/optionsdialog.cpp" line="273"/> <location filename="../src/GUI/optionsdialog.cpp" line="273"/>
<location filename="../src/GUI/optionsdialog.cpp" line="639"/> <location filename="../src/GUI/optionsdialog.cpp" line="639"/>
<source>px</source> <source>px</source>
<translation type="unfinished">px</translation> <translation>px</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/optionsdialog.cpp" line="309"/> <location filename="../src/GUI/optionsdialog.cpp" line="309"/>
@ -1810,7 +1810,7 @@
<message> <message>
<location filename="../src/GUI/optionsdialog.cpp" line="388"/> <location filename="../src/GUI/optionsdialog.cpp" line="388"/>
<source>Detect pauses</source> <source>Detect pauses</source>
<translation type="unfinished"></translation> <translation>Registrer pauser</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/optionsdialog.cpp" line="392"/> <location filename="../src/GUI/optionsdialog.cpp" line="392"/>
@ -1821,7 +1821,7 @@
<message> <message>
<location filename="../src/GUI/optionsdialog.cpp" line="537"/> <location filename="../src/GUI/optionsdialog.cpp" line="537"/>
<source>Detection:</source> <source>Detection:</source>
<translation type="unfinished"></translation> <translation>Registrering:</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/optionsdialog.cpp" line="564"/> <location filename="../src/GUI/optionsdialog.cpp" line="564"/>
@ -1865,27 +1865,27 @@
<location filename="../src/GUI/optionsdialog.cpp" line="314"/> <location filename="../src/GUI/optionsdialog.cpp" line="314"/>
<location filename="../src/GUI/optionsdialog.cpp" line="655"/> <location filename="../src/GUI/optionsdialog.cpp" line="655"/>
<source>Opacity:</source> <source>Opacity:</source>
<translation type="unfinished"></translation> <translation>Gennemsigtighed:</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/optionsdialog.cpp" line="657"/> <location filename="../src/GUI/optionsdialog.cpp" line="657"/>
<source>Blur radius:</source> <source>Blur radius:</source>
<translation type="unfinished"></translation> <translation>Sløringsradius:</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/optionsdialog.cpp" line="659"/> <location filename="../src/GUI/optionsdialog.cpp" line="659"/>
<source>Azimuth:</source> <source>Azimuth:</source>
<translation type="unfinished"></translation> <translation>Azimut:</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/optionsdialog.cpp" line="660"/> <location filename="../src/GUI/optionsdialog.cpp" line="660"/>
<source>Altitude:</source> <source>Altitude:</source>
<translation type="unfinished"></translation> <translation>Højde:</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/optionsdialog.cpp" line="661"/> <location filename="../src/GUI/optionsdialog.cpp" line="661"/>
<source>Z Factor:</source> <source>Z Factor:</source>
<translation type="unfinished"></translation> <translation>Z-faktor:</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/optionsdialog.cpp" line="666"/> <location filename="../src/GUI/optionsdialog.cpp" line="666"/>
@ -1896,7 +1896,7 @@
<message> <message>
<location filename="../src/GUI/optionsdialog.cpp" line="667"/> <location filename="../src/GUI/optionsdialog.cpp" line="667"/>
<source>Hillshading</source> <source>Hillshading</source>
<translation type="unfinished"></translation> <translation>Terrænskygge</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/optionsdialog.cpp" line="687"/> <location filename="../src/GUI/optionsdialog.cpp" line="687"/>
@ -1917,7 +1917,7 @@
<message> <message>
<location filename="../src/GUI/optionsdialog.cpp" line="656"/> <location filename="../src/GUI/optionsdialog.cpp" line="656"/>
<source>Lightening:</source> <source>Lightening:</source>
<translation type="unfinished"></translation> <translation>Belysning:</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/optionsdialog.cpp" line="713"/> <location filename="../src/GUI/optionsdialog.cpp" line="713"/>
@ -2325,7 +2325,7 @@
<message> <message>
<location filename="../src/GUI/routeitem.cpp" line="38"/> <location filename="../src/GUI/routeitem.cpp" line="38"/>
<source>File</source> <source>File</source>
<translation type="unfinished">Fil</translation> <translation>Fil</translation>
</message> </message>
</context> </context>
<context> <context>
@ -2591,7 +2591,7 @@
<message> <message>
<location filename="../src/GUI/trackitem.cpp" line="46"/> <location filename="../src/GUI/trackitem.cpp" line="46"/>
<source>File</source> <source>File</source>
<translation type="unfinished">Fil</translation> <translation>Fil</translation>
</message> </message>
</context> </context>
<context> <context>

View File

@ -587,7 +587,7 @@
<message> <message>
<location filename="../src/GUI/gui.cpp" line="487"/> <location filename="../src/GUI/gui.cpp" line="487"/>
<source>Show local DEM tiles</source> <source>Show local DEM tiles</source>
<translation type="unfinished"></translation> <translation>Näytä paikalliset DEM-laatat</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/gui.cpp" line="490"/> <location filename="../src/GUI/gui.cpp" line="490"/>
@ -699,7 +699,7 @@
<message> <message>
<location filename="../src/GUI/gui.cpp" line="695"/> <location filename="../src/GUI/gui.cpp" line="695"/>
<source>Layers</source> <source>Layers</source>
<translation type="unfinished"></translation> <translation>Kerrokset</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/gui.cpp" line="721"/> <location filename="../src/GUI/gui.cpp" line="721"/>
@ -850,12 +850,12 @@
<message> <message>
<location filename="../src/GUI/gui.cpp" line="1998"/> <location filename="../src/GUI/gui.cpp" line="1998"/>
<source>DEM tiles download limit exceeded. If you really need data for such a huge area, download the files manually.</source> <source>DEM tiles download limit exceeded. If you really need data for such a huge area, download the files manually.</source>
<translation type="unfinished"></translation> <translation>DEM-laattojen latausraja ylitetty. Jos todella tarvitset tietoja niin suurelta alueelta, lataa tiedostot manuaalisesti.</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/gui.cpp" line="2014"/> <location filename="../src/GUI/gui.cpp" line="2014"/>
<source>Could not download all required DEM files.</source> <source>Could not download all required DEM files.</source>
<translation type="unfinished"></translation> <translation>Kaikkia vaadittuja DEM-tiedostoja ei voitu ladata.</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/gui.cpp" line="2048"/> <location filename="../src/GUI/gui.cpp" line="2048"/>
@ -898,12 +898,12 @@
<message> <message>
<location filename="../src/GUI/gui.cpp" line="476"/> <location filename="../src/GUI/gui.cpp" line="476"/>
<source>Download data DEM</source> <source>Download data DEM</source>
<translation type="unfinished"></translation> <translation>Lataa data-DEM</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/gui.cpp" line="482"/> <location filename="../src/GUI/gui.cpp" line="482"/>
<source>Download map DEM</source> <source>Download map DEM</source>
<translation type="unfinished"></translation> <translation>Lataa kartta-DEM</translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/gui.cpp" line="762"/> <location filename="../src/GUI/gui.cpp" line="762"/>
@ -961,7 +961,7 @@
<message> <message>
<location filename="../src/GUI/gui.cpp" line="1978"/> <location filename="../src/GUI/gui.cpp" line="1978"/>
<source>Clear &quot;%1&quot; tile cache?</source> <source>Clear &quot;%1&quot; tile cache?</source>
<translation type="unfinished"></translation> <translation>Tyhjennetäänkö &quot;%1&quot; ruutuvälimuisti?</translation>
</message> </message>
<message numerus="yes"> <message numerus="yes">
<location filename="../src/GUI/gui.cpp" line="2001"/> <location filename="../src/GUI/gui.cpp" line="2001"/>

View File

@ -37,7 +37,7 @@ Unicode true
; The name of the installer ; The name of the installer
Name "GPXSee" Name "GPXSee"
; Program version ; Program version
!define VERSION "13.31" !define VERSION "13.34"
; The file to write ; The file to write
OutFile "GPXSee-${VERSION}_x64.exe" OutFile "GPXSee-${VERSION}_x64.exe"

View File

@ -6,31 +6,23 @@ bool AtlasData::pointCb(MapEntry *map, void *context)
{ {
PointCTX *ctx = (PointCTX*)context; PointCTX *ctx = (PointCTX*)context;
start: map->lock.lock();
ctx->cacheLock.lock(); ctx->cacheLock.lock();
MapData *cached = ctx->cache.object(map->path); MapData *cached = ctx->cache.object(map->path);
if (!cached) { if (!cached) {
ctx->cacheLock.unlock(); ctx->cacheLock.unlock();
if (map->lock.tryLock()) { MapData *data = new MapData(map->path);
MapData *data = new MapData(map->path); data->points(ctx->rect, ctx->points);
data->points(ctx->rect, ctx->points);
ctx->cacheLock.lock(); ctx->cacheLock.lock();
ctx->cache.insert(map->path, data); ctx->cache.insert(map->path, data);
map->lock.unlock();
} else {
map->lock.lock();
map->lock.unlock();
goto start;
}
} else } else
cached->points(ctx->rect, ctx->points); cached->points(ctx->rect, ctx->points);
ctx->cacheLock.unlock(); ctx->cacheLock.unlock();
map->lock.unlock();
return true; return true;
} }
@ -39,34 +31,26 @@ bool AtlasData::polyCb(MapEntry *map, void *context)
{ {
PolyCTX *ctx = (PolyCTX*)context; PolyCTX *ctx = (PolyCTX*)context;
start: map->lock.lock();
ctx->cacheLock.lock(); ctx->cacheLock.lock();
MapData *cached = ctx->cache.object(map->path); MapData *cached = ctx->cache.object(map->path);
if (!cached) { if (!cached) {
ctx->cacheLock.unlock(); ctx->cacheLock.unlock();
if (map->lock.tryLock()) { MapData *data = new MapData(map->path);
MapData *data = new MapData(map->path); data->polygons(ctx->rect, ctx->polygons);
data->polygons(ctx->rect, ctx->polygons); data->lines(ctx->rect, ctx->lines);
data->lines(ctx->rect, ctx->lines);
ctx->cacheLock.lock(); ctx->cacheLock.lock();
ctx->cache.insert(map->path, data); ctx->cache.insert(map->path, data);
map->lock.unlock();
} else {
map->lock.lock();
map->lock.unlock();
goto start;
}
} else { } else {
cached->polygons(ctx->rect, ctx->polygons); cached->polygons(ctx->rect, ctx->polygons);
cached->lines(ctx->rect, ctx->lines); cached->lines(ctx->rect, ctx->lines);
} }
ctx->cacheLock.unlock(); ctx->cacheLock.unlock();
map->lock.unlock();
return true; return true;
} }

View File

@ -63,16 +63,17 @@ static QMap<uint,uint> orderMapInit()
map.insert(TYPE(PILPNT), 34); map.insert(TYPE(PILPNT), 34);
map.insert(TYPE(ACHBRT), 35); map.insert(TYPE(ACHBRT), 35);
map.insert(TYPE(I_ACHBRT), 35); map.insert(TYPE(I_ACHBRT), 35);
map.insert(TYPE(CRANES), 36); map.insert(TYPE(RADRFL), 36);
map.insert(TYPE(I_CRANES), 36); map.insert(TYPE(CRANES), 37);
map.insert(TYPE(I_WTWGAG), 37); map.insert(TYPE(I_CRANES), 37);
map.insert(TYPE(PYLONS), 38); map.insert(TYPE(I_WTWGAG), 38);
map.insert(TYPE(SLCONS), 39); map.insert(TYPE(PYLONS), 39);
map.insert(TYPE(LNDMRK), 40); map.insert(TYPE(SLCONS), 40);
map.insert(TYPE(SILTNK), 41); map.insert(TYPE(LNDMRK), 41);
map.insert(TYPE(LNDELV), 42); map.insert(TYPE(SILTNK), 42);
map.insert(TYPE(SMCFAC), 43); map.insert(TYPE(LNDELV), 43);
map.insert(TYPE(BUISGL), 44); map.insert(TYPE(SMCFAC), 44);
map.insert(TYPE(BUISGL), 45);
map.insert(TYPE(I_DISMAR), 0xFFFFFFFE); map.insert(TYPE(I_DISMAR), 0xFFFFFFFE);
map.insert(TYPE(SOUNDG), 0xFFFFFFFF); map.insert(TYPE(SOUNDG), 0xFFFFFFFF);
@ -169,6 +170,14 @@ static bool polygonCb(const MapData::Poly *polygon, void *context)
return true; return true;
} }
static bool polygonPointCb(const MapData::Poly *polygon, void *context)
{
QList<MapData::Point> *points = (QList<MapData::Point>*)context;
points->append(MapData::Point(polygon->type(), polygon->bounds().center(),
polygon->label(), polygon->param()));
return true;
}
static Coordinates coordinates(int x, int y, uint COMF) static Coordinates coordinates(int x, int y, uint COMF)
{ {
return Coordinates(x / (double)COMF, y / (double)COMF); return Coordinates(x / (double)COMF, y / (double)COMF);
@ -285,7 +294,14 @@ MapData::Point::Point(uint type, const Coordinates &c, const QString &label,
else else
_label += "\n(" + QString::fromLatin1(params.at(0)) _label += "\n(" + QString::fromLatin1(params.at(0))
+ "\xE2\x80\x89m)"; + "\xE2\x80\x89m)";
} } else if ((type == TYPE(TSSLPT) || type == TYPE(RCTLPT)) && params.size())
_param = QVariant(params.at(0).toDouble());
}
MapData::Point::Point(uint type, const Coordinates &c, const QString &label,
const QVariant &param) : _type(type), _pos(c), _label(label), _param(param)
{
_id = ((quint64)order(type))<<32 | (uint)qHash(c);
} }
MapData::Poly::Poly(uint type, const Polygon &path, const QString &label, MapData::Poly::Poly(uint type, const Polygon &path, const QString &label,
@ -293,7 +309,7 @@ MapData::Poly::Poly(uint type, const Polygon &path, const QString &label,
{ {
if (type == TYPE(DEPARE) && params.size()) if (type == TYPE(DEPARE) && params.size())
_type = SUBTYPE(DEPARE, depthLevel(params.at(0))); _type = SUBTYPE(DEPARE, depthLevel(params.at(0)));
else if (type == TYPE(TSSLPT) && params.size()) else if ((type == TYPE(TSSLPT) || type == TYPE(RCTLPT)) && params.size())
_param = QVariant(params.at(0).toDouble()); _param = QVariant(params.at(0).toDouble());
else if ((type == TYPE(BRIDGE) || type == TYPE(I_BRIDGE)) else if ((type == TYPE(BRIDGE) || type == TYPE(I_BRIDGE))
&& params.size()) { && params.size()) {
@ -302,7 +318,8 @@ MapData::Poly::Poly(uint type, const Polygon &path, const QString &label,
_label = QString::fromUtf8("\xE2\x86\x95") + UNIT_SPACE _label = QString::fromUtf8("\xE2\x86\x95") + UNIT_SPACE
+ QString::number(clr) + UNIT_SPACE + hUnits(HUNI); + QString::number(clr) + UNIT_SPACE + hUnits(HUNI);
} }
} else if (type>>16 == LNDARE || type>>16 == SEAARE) } else if (type>>16 == LNDARE || type>>16 == SEAARE || type>>16 == BERTHS
|| type>>16 == I_BERTHS || type>>16 == BUAARE)
_label = label; _label = label;
} }
@ -595,7 +612,9 @@ MapData::Attr MapData::pointAttr(const ISO8211::Record &r, uint OBJL)
|| (OBJL == RDOCAL && key == ORIENT) || (OBJL == RDOCAL && key == ORIENT)
|| (OBJL == I_RDOCAL && key == ORIENT) || (OBJL == I_RDOCAL && key == ORIENT)
|| (OBJL == CURENT && key == ORIENT) || (OBJL == CURENT && key == ORIENT)
|| (OBJL == LNDELV && key == ELEVAT)) || (OBJL == LNDELV && key == ELEVAT)
|| (OBJL == TSSLPT && key == ORIENT)
|| (OBJL == RCTLPT && key == ORIENT))
params[0] = av.at(1).toByteArray(); params[0] = av.at(1).toByteArray();
if ((OBJL == I_RDOCAL && key == COMCHA) if ((OBJL == I_RDOCAL && key == COMCHA)
|| (OBJL == RDOCAL && key == COMCHA) || (OBJL == RDOCAL && key == COMCHA)
@ -668,6 +687,7 @@ MapData::Attr MapData::polyAttr(const ISO8211::Record &r, uint OBJL)
} }
if ((OBJL == TSSLPT && key == ORIENT) if ((OBJL == TSSLPT && key == ORIENT)
|| (OBJL == RCTLPT && key == ORIENT)
|| (OBJL == DEPARE && key == DRVAL1)) || (OBJL == DEPARE && key == DRVAL1))
params[0] = av.at(1).toByteArray(); params[0] = av.at(1).toByteArray();
if ((OBJL == BRIDGE && key == VERCLR) if ((OBJL == BRIDGE && key == VERCLR)
@ -842,6 +862,7 @@ void MapData::points(const RectC &rect, QList<Point> *points) const
rectcBounds(rect, min, max); rectcBounds(rect, min, max);
_points.Search(min, max, pointCb, points); _points.Search(min, max, pointCb, points);
_areas.Search(min, max, polygonPointCb, points);
} }
void MapData::lines(const RectC &rect, QList<Line> *lines) const void MapData::lines(const RectC &rect, QList<Line> *lines) const

View File

@ -49,6 +49,8 @@ public:
public: public:
Point(uint type, const Coordinates &c, const QString &label, Point(uint type, const Coordinates &c, const QString &label,
const QVector<QByteArray> &params); const QVector<QByteArray> &params);
Point(uint type, const Coordinates &c, const QString &label,
const QVariant &param);
const Coordinates &pos() const {return _pos;} const Coordinates &pos() const {return _pos;}
uint type() const {return _type;} uint type() const {return _type;}

View File

@ -67,6 +67,7 @@
#define PONTON 95 #define PONTON 95
#define PRCARE 96 #define PRCARE 96
#define PYLONS 98 #define PYLONS 98
#define RADRFL 101
#define RADSTA 102 #define RADSTA 102
#define RTPBCN 103 #define RTPBCN 103
#define RDOCAL 104 #define RDOCAL 104
@ -74,6 +75,7 @@
#define RAILWY 106 #define RAILWY 106
#define RCRTCL 108 #define RCRTCL 108
#define RECTRC 109 #define RECTRC 109
#define RCTLPT 110
#define RSCSTA 111 #define RSCSTA 111
#define RESARE 112 #define RESARE 112
#define RIVERS 114 #define RIVERS 114

View File

@ -40,31 +40,6 @@ static bool showLabel(const QImage *img, const Range &range, int zoom, int type)
return true; return true;
} }
QPointF RasterTile::centroid(const QVector<Coordinates> &polygon) const
{
Q_ASSERT(polygon.size() > 3);
Q_ASSERT(polygon.first() == polygon.last());
double area = 0;
double cx = 0, cy = 0;
QPointF pi;
QPointF pj(ll2xy(polygon.at(0)));
for (int i = 0; i < polygon.size() - 1; i++) {
pi = pj;
pj = ll2xy(polygon.at(i + 1));
double f = pi.x() * pj.y() - pj.x() * pi.y();
area += f;
cx += (pi.x() + pj.x()) * f;
cy += (pi.y() + pj.y()) * f;
}
double factor = 1.0 / (3.0 * area);
return QPointF(cx * factor, cy * factor);
}
QPainterPath RasterTile::painterPath(const Polygon &polygon) const QPainterPath RasterTile::painterPath(const Polygon &polygon) const
{ {
QPainterPath path; QPainterPath path;
@ -150,19 +125,28 @@ QPolygonF RasterTile::tsslptArrow(const QPointF &p, qreal angle) const
return polygon; return polygon;
} }
void RasterTile::drawArrows(QPainter *painter, static void drawArrow(QPainter *painter, const QPolygonF &polygon, uint type)
const QList<MapData::Poly> &polygons)
{ {
for (int i = 0; i < polygons.size(); i++) { if (type>>16 == RCTLPT) {
const MapData::Poly &poly = polygons.at(i); painter->setPen(QPen(tsslptPen, 1, Qt::DashLine));
painter->setBrush(Qt::NoBrush);
} else {
painter->setPen(QPen(tsslptPen, 1));
painter->setBrush(QBrush(tsslptBrush));
}
painter->drawPolygon(polygon);
}
if (poly.type()>>16 == TSSLPT) { void RasterTile::drawArrows(QPainter *painter,
QPolygonF polygon(tsslptArrow(centroid(poly.path().first()), const QList<MapData::Point> &points)
deg2rad(poly.param().toDouble()))); {
for (int i = 0; i < points.size(); i++) {
const MapData::Point &point = points.at(i);
painter->setPen(QPen(tsslptPen, 1)); if (point.type()>>16 == TSSLPT || point.type()>>16 == RCTLPT) {
painter->setBrush(QBrush(tsslptBrush)); QPolygonF polygon(tsslptArrow(ll2xy(point.pos()),
painter->drawPolygon(polygon); deg2rad(point.param().toDouble())));
drawArrow(painter, polygon, point.type());
} }
} }
} }
@ -220,47 +204,12 @@ void RasterTile::drawLines(QPainter *painter, const QList<MapData::Line> &lines)
void RasterTile::drawTextItems(QPainter *painter, void RasterTile::drawTextItems(QPainter *painter,
const QList<TextItem*> &textItems) const QList<TextItem*> &textItems)
{ {
for (int i = 0; i < textItems.size(); i++) QRectF rect(_rect);
textItems.at(i)->paint(painter);
}
void RasterTile::processPolygons(const QList<MapData::Poly> &polygons, for (int i = 0; i < textItems.size(); i++) {
QList<TextItem*> &textItems) const TextItem *ti = textItems.at(i);
{ if (rect.intersects(ti->boundingRect()))
for (int i = 0; i < polygons.size(); i++) { ti->paint(painter);
const MapData::Poly &poly = polygons.at(i);
uint type = poly.type()>>16;
const QImage *img = 0;
const QString *label = 0;
const QFont *fnt = 0;
const QColor *color = 0, *hColor = 0;
QPoint offset(0, 0);
if (!poly.label().isEmpty()) {
const Style::Point &style = _style->point(poly.type());
fnt = _style->font(style.textFontSize());
color = &style.textColor();
hColor = style.haloColor().isValid() ? &style.haloColor() : 0;
label = &poly.label();
}
if (type == HRBFAC || type == I_TRNBSN
|| poly.type() == SUBTYPE(I_BERTHS, 6)) {
const Style::Point &style = _style->point(poly.type());
img = style.img().isNull() ? 0 : &style.img();
offset = style.offset();
}
if ((!label || !fnt) && !img)
continue;
TextPointItem *item = new TextPointItem(offset +
centroid(poly.path().first()).toPoint(), label, fnt, img, color,
hColor, 0, 0);
if (item->isValid() && _rect.contains(item->boundingRect().toRect())
&& !item->collides(textItems))
textItems.append(item);
else
delete item;
} }
} }
@ -384,7 +333,6 @@ void RasterTile::render()
fetchData(polygons, lines, points); fetchData(polygons, lines, points);
processPoints(points, textItems, lights); processPoints(points, textItems, lights);
processPolygons(polygons, textItems);
processLines(lines, textItems); processLines(lines, textItems);
QPainter painter(&img); QPainter painter(&img);
@ -394,7 +342,7 @@ void RasterTile::render()
drawPolygons(&painter, polygons); drawPolygons(&painter, polygons);
drawLines(&painter, lines); drawLines(&painter, lines);
drawArrows(&painter, polygons); drawArrows(&painter, points);
drawTextItems(&painter, lights); drawTextItems(&painter, lights);
drawTextItems(&painter, textItems); drawTextItems(&painter, textItems);

View File

@ -47,11 +47,9 @@ private:
QList<TextItem*> &textItems, QList<TextItem *> &lights); QList<TextItem*> &textItems, QList<TextItem *> &lights);
void processLines(const QList<MapData::Line> &lines, void processLines(const QList<MapData::Line> &lines,
QList<TextItem*> &textItems); QList<TextItem*> &textItems);
void processPolygons(const QList<MapData::Poly> &polygons,
QList<TextItem*> &textItems);
void drawBitmapPath(QPainter *painter, const QImage &img, void drawBitmapPath(QPainter *painter, const QImage &img,
const Polygon &polygon); const Polygon &polygon);
void drawArrows(QPainter *painter, const QList<MapData::Poly> &polygons); void drawArrows(QPainter *painter, const QList<MapData::Point> &points);
void drawPolygons(QPainter *painter, const QList<MapData::Poly> &polygons); void drawPolygons(QPainter *painter, const QList<MapData::Poly> &polygons);
void drawLines(QPainter *painter, const QList<MapData::Line> &lines); void drawLines(QPainter *painter, const QList<MapData::Line> &lines);
void drawTextItems(QPainter *painter, const QList<TextItem*> &textItems); void drawTextItems(QPainter *painter, const QList<TextItem*> &textItems);

View File

@ -82,7 +82,27 @@ void Style::polygonStyle()
_polygons[SUBTYPE(I_RESARE, 12)] = Polygon(QImage(":/marine/safety-zone-line.png")); _polygons[SUBTYPE(I_RESARE, 12)] = Polygon(QImage(":/marine/safety-zone-line.png"));
_polygons[SUBTYPE(RESARE, 1)] = Polygon(QImage(":/marine/safety-zone-line.png")); _polygons[SUBTYPE(RESARE, 1)] = Polygon(QImage(":/marine/safety-zone-line.png"));
_polygons[SUBTYPE(ACHARE, 1)] = Polygon(QImage(":/marine/anchor-line.png")); _polygons[SUBTYPE(ACHARE, 1)] = Polygon(QImage(":/marine/anchor-line.png"));
_polygons[SUBTYPE(I_ACHARE, 1)] = Polygon(QImage(":/marine/anchor-line.png")); _polygons[SUBTYPE(ACHARE, 2)] = _polygons[SUBTYPE(ACHARE, 1)];
_polygons[SUBTYPE(ACHARE, 3)] = _polygons[SUBTYPE(ACHARE, 1)];
_polygons[SUBTYPE(ACHARE, 4)] = _polygons[SUBTYPE(ACHARE, 1)];
_polygons[SUBTYPE(ACHARE, 5)] = _polygons[SUBTYPE(ACHARE, 1)];
_polygons[SUBTYPE(ACHARE, 6)] = _polygons[SUBTYPE(ACHARE, 1)];
_polygons[SUBTYPE(ACHARE, 7)] = _polygons[SUBTYPE(ACHARE, 1)];
_polygons[SUBTYPE(ACHARE, 8)] = Polygon(Qt::NoBrush,
QPen(QColor(0xeb, 0x49, 0xeb), 1, Qt::DashLine));
_polygons[SUBTYPE(ACHARE, 9)] = _polygons[SUBTYPE(ACHARE, 1)];
_polygons[SUBTYPE(I_ACHARE, 1)] = _polygons[SUBTYPE(ACHARE, 1)];
_polygons[SUBTYPE(I_ACHARE, 2)] = _polygons[SUBTYPE(ACHARE, 2)];
_polygons[SUBTYPE(I_ACHARE, 3)] = _polygons[SUBTYPE(ACHARE, 3)];
_polygons[SUBTYPE(I_ACHARE, 4)] = _polygons[SUBTYPE(ACHARE, 4)];
_polygons[SUBTYPE(I_ACHARE, 5)] = _polygons[SUBTYPE(ACHARE, 5)];
_polygons[SUBTYPE(I_ACHARE, 6)] = _polygons[SUBTYPE(ACHARE, 6)];
_polygons[SUBTYPE(I_ACHARE, 7)] = _polygons[SUBTYPE(ACHARE, 7)];
_polygons[SUBTYPE(I_ACHARE, 8)] = _polygons[SUBTYPE(ACHARE, 8)];
_polygons[SUBTYPE(I_ACHARE, 9)] = _polygons[SUBTYPE(ACHARE, 9)];
_polygons[SUBTYPE(I_ACHARE, 10)] = _polygons[SUBTYPE(I_ACHARE, 1)];
_polygons[SUBTYPE(I_ACHARE, 11)] = _polygons[SUBTYPE(I_ACHARE, 1)];
_polygons[SUBTYPE(I_ACHARE, 12)] = _polygons[SUBTYPE(I_ACHARE, 1)];
_polygons[TYPE(PRCARE)] = Polygon(QBrush(QColor(0xeb, 0x49, 0xeb), _polygons[TYPE(PRCARE)] = Polygon(QBrush(QColor(0xeb, 0x49, 0xeb),
Qt::BDiagPattern)); Qt::BDiagPattern));
_polygons[TYPE(DAMCON)] = Polygon(QBrush(QColor(0xd9, 0x8b, 0x21)), _polygons[TYPE(DAMCON)] = Polygon(QBrush(QColor(0xd9, 0x8b, 0x21)),
@ -113,8 +133,12 @@ void Style::polygonStyle()
_polygons[TYPE(CBLARE)] = Polygon(QImage(":/marine/cable-area-line.png")); _polygons[TYPE(CBLARE)] = Polygon(QImage(":/marine/cable-area-line.png"));
_polygons[TYPE(PIPARE)] = Polygon(QImage(":/marine/pipeline-area-line.png")); _polygons[TYPE(PIPARE)] = Polygon(QImage(":/marine/pipeline-area-line.png"));
_polygons[SUBTYPE(MARKUL, 3)] = Polygon(QImage(":/marine/fishing-farm-line.png")); _polygons[SUBTYPE(MARKUL, 3)] = Polygon(QImage(":/marine/fishing-farm-line.png"));
_polygons[SUBTYPE(I_BERTHS, 6)] = Polygon(Qt::NoBrush, _polygons[TYPE(BERTHS)] = Polygon(Qt::NoBrush, QPen(QColor(0xeb, 0x49, 0xeb),
QPen(QColor(0xeb, 0x49, 0xeb), 1, Qt::DashLine)); 1, Qt::DashLine));
_polygons[TYPE(I_BERTHS)] = _polygons[TYPE(BERTHS)];
_polygons[SUBTYPE(I_BERTHS, 6)] = _polygons[TYPE(BERTHS)];
_polygons[TYPE(I_TRNBSN)] = Polygon(Qt::NoBrush, QPen(QColor(0xeb, 0x49, 0xeb),
1, Qt::DashLine));
_polygons[TYPE(CONZNE)] = Polygon(Qt::NoBrush, QPen(QColor(0xeb, 0x49, 0xeb), _polygons[TYPE(CONZNE)] = Polygon(Qt::NoBrush, QPen(QColor(0xeb, 0x49, 0xeb),
1, Qt::DashDotLine)); 1, Qt::DashDotLine));
@ -129,13 +153,20 @@ void Style::polygonStyle()
<< TYPE(I_TERMNL) << TYPE(SLCONS) << TYPE(I_SLCONS) << TYPE(PONTON) << TYPE(I_TERMNL) << TYPE(SLCONS) << TYPE(I_SLCONS) << TYPE(PONTON)
<< TYPE(I_PONTON) << TYPE(HULKES) << TYPE(I_HULKES) << TYPE(FLODOC) << TYPE(I_PONTON) << TYPE(HULKES) << TYPE(I_HULKES) << TYPE(FLODOC)
<< TYPE(I_FLODOC) << TYPE(DRYDOC) << TYPE(DAMCON) << TYPE(PYLONS) << TYPE(I_FLODOC) << TYPE(DRYDOC) << TYPE(DAMCON) << TYPE(PYLONS)
<< TYPE(MORFAC) << TYPE(GATCON) << TYPE(I_GATCON) << SUBTYPE(I_BERTHS, 6) << TYPE(MORFAC) << TYPE(GATCON) << TYPE(I_GATCON) << TYPE(BERTHS)
<< TYPE(DMPGRD) << TYPE(TSEZNE) << TYPE(OBSTRN) << TYPE(UWTROC) << TYPE(I_BERTHS) << SUBTYPE(I_BERTHS, 6) << TYPE(DMPGRD) << TYPE(TSEZNE)
<< TYPE(DWRTPT) << SUBTYPE(ACHARE, 1) << SUBTYPE(I_ACHARE, 1) << TYPE(OBSTRN) << TYPE(UWTROC) << TYPE(DWRTPT) << SUBTYPE(ACHARE, 1)
<< SUBTYPE(RESARE, 9) << SUBTYPE(RESARE, 2) << SUBTYPE(I_RESARE, 2) << SUBTYPE(ACHARE, 2) << SUBTYPE(ACHARE, 3) << SUBTYPE(ACHARE, 4)
<< SUBTYPE(RESARE, 17) << SUBTYPE(I_RESARE, 17) << SUBTYPE(RESARE, 12) << SUBTYPE(ACHARE, 5) << SUBTYPE(ACHARE, 6) << SUBTYPE(ACHARE, 7)
<< SUBTYPE(I_RESARE, 12) << SUBTYPE(RESARE, 1) << TYPE(CBLARE) << SUBTYPE(ACHARE, 8) << SUBTYPE(ACHARE, 9) << SUBTYPE(I_ACHARE, 1)
<< TYPE(PIPARE) << TYPE(PRCARE) << SUBTYPE(MARKUL, 3) << TYPE(CONZNE); << SUBTYPE(I_ACHARE, 2) << SUBTYPE(I_ACHARE, 3) << SUBTYPE(I_ACHARE, 4)
<< SUBTYPE(I_ACHARE, 5) << SUBTYPE(I_ACHARE, 6) << SUBTYPE(I_ACHARE, 7)
<< SUBTYPE(I_ACHARE, 8) << SUBTYPE(I_ACHARE, 9) << SUBTYPE(I_ACHARE, 10)
<< SUBTYPE(I_ACHARE, 11) << SUBTYPE(I_ACHARE, 12) << SUBTYPE(RESARE, 9)
<< SUBTYPE(RESARE, 2) << SUBTYPE(I_RESARE, 2) << SUBTYPE(RESARE, 17)
<< SUBTYPE(I_RESARE, 17) << SUBTYPE(RESARE, 12) << SUBTYPE(I_RESARE, 12)
<< SUBTYPE(RESARE, 1) << TYPE(CBLARE) << TYPE(PIPARE) << TYPE(PRCARE)
<< TYPE(I_TRNBSN) << SUBTYPE(MARKUL, 3) << TYPE(CONZNE);
} }
void Style::lineStyle(qreal ratio) void Style::lineStyle(qreal ratio)
@ -152,7 +183,7 @@ void Style::lineStyle(qreal ratio)
_lines[TYPE(CBLSUB)].setTextFontSize(Small); _lines[TYPE(CBLSUB)].setTextFontSize(Small);
_lines[TYPE(PIPSOL)] = Line(QImage(":/marine/pipeline.png")); _lines[TYPE(PIPSOL)] = Line(QImage(":/marine/pipeline.png"));
_lines[TYPE(PIPSOL)].setTextFontSize(Small); _lines[TYPE(PIPSOL)].setTextFontSize(Small);
_lines[TYPE(NAVLNE)] = Line(QPen(QColor(0xeb, 0x49, 0xeb), 1, Qt::DashLine)); _lines[TYPE(NAVLNE)] = Line(QPen(QColor(0, 0, 0), 1, Qt::DashLine));
_lines[TYPE(COALNE)] = Line(QPen(QColor(0, 0, 0), 1, Qt::SolidLine)); _lines[TYPE(COALNE)] = Line(QPen(QColor(0, 0, 0), 1, Qt::SolidLine));
_lines[TYPE(SLCONS)] = Line(QPen(QColor(0, 0, 0), 2, Qt::SolidLine)); _lines[TYPE(SLCONS)] = Line(QPen(QColor(0, 0, 0), 2, Qt::SolidLine));
_lines[TYPE(I_SLCONS)] = Line(QPen(QColor(0, 0, 0), 2, Qt::SolidLine)); _lines[TYPE(I_SLCONS)] = Line(QPen(QColor(0, 0, 0), 2, Qt::SolidLine));
@ -235,6 +266,7 @@ void Style::pointStyle(qreal ratio)
_points[SUBTYPE(LNDMRK, 7)] = Point(QImage(":/marine/pylon.png"), Small); _points[SUBTYPE(LNDMRK, 7)] = Point(QImage(":/marine/pylon.png"), Small);
_points[SUBTYPE(LNDMRK, 9)] = Point(QImage(":/marine/monument.png"), Small, _points[SUBTYPE(LNDMRK, 9)] = Point(QImage(":/marine/monument.png"), Small,
QPoint(0, -7)); QPoint(0, -7));
_points[SUBTYPE(LNDMRK, 10)] = Point(QImage(":/marine/pylon.png"), Small);
_points[SUBTYPE(LNDMRK, 15)] = Point(QImage(":/marine/dome.png"), Small, _points[SUBTYPE(LNDMRK, 15)] = Point(QImage(":/marine/dome.png"), Small,
QPoint(0, -5)); QPoint(0, -5));
_points[SUBTYPE(LNDMRK, 17)] = Point(QImage(":/marine/tower.png"), Small, _points[SUBTYPE(LNDMRK, 17)] = Point(QImage(":/marine/tower.png"), Small,
@ -323,7 +355,8 @@ void Style::pointStyle(qreal ratio)
_points[SUBTYPE(I_RDOCAL, 3)].setTextColor(QColor(0xeb, 0x49, 0xeb)); _points[SUBTYPE(I_RDOCAL, 3)].setTextColor(QColor(0xeb, 0x49, 0xeb));
_points[SUBTYPE(I_RDOCAL, 4)].setTextColor(QColor(0xeb, 0x49, 0xeb)); _points[SUBTYPE(I_RDOCAL, 4)].setTextColor(QColor(0xeb, 0x49, 0xeb));
_points[TYPE(PYLONS)] = Point(QImage(":/marine/pylon.png")); _points[TYPE(PYLONS)] = Point(QImage(":/marine/pylon.png"));
_points[SUBTYPE(I_BERTHS, 6)] = Point(QImage(":/marine/fleeting-area.png")); _points[SUBTYPE(I_BERTHS, 6)] = Point(QImage(":/marine/fleeting-area.png"),
Small);
_points[SUBTYPE(WATTUR, 1)] = Point(QImage(":/marine/breakers.png")); _points[SUBTYPE(WATTUR, 1)] = Point(QImage(":/marine/breakers.png"));
_points[SUBTYPE(WATTUR, 2)] = Point(QImage(":/marine/eddies.png")); _points[SUBTYPE(WATTUR, 2)] = Point(QImage(":/marine/eddies.png"));
_points[SUBTYPE(WATTUR, 3)] = Point(QImage(":/marine/overfalls.png")); _points[SUBTYPE(WATTUR, 3)] = Point(QImage(":/marine/overfalls.png"));
@ -335,6 +368,7 @@ void Style::pointStyle(qreal ratio)
_points[SUBTYPE(WEDKLP, 0)] = Point(QImage(":/marine/kelp.png")); _points[SUBTYPE(WEDKLP, 0)] = Point(QImage(":/marine/kelp.png"));
_points[SUBTYPE(WEDKLP, 1)] = Point(QImage(":/marine/kelp.png")); _points[SUBTYPE(WEDKLP, 1)] = Point(QImage(":/marine/kelp.png"));
_points[TYPE(SEAARE)].setHaloColor(QColor()); _points[TYPE(SEAARE)].setHaloColor(QColor());
_points[TYPE(RADRFL)] = Point(QImage(":/marine/radar-reflector.png"));
_points[SUBTYPE(SMCFAC, 7)] = Point(svg2img(":/POI/restaurant-11.svg", _points[SUBTYPE(SMCFAC, 7)] = Point(svg2img(":/POI/restaurant-11.svg",
ratio), Small); ratio), Small);

View File

@ -146,7 +146,7 @@ int DEMFile::level(const Zoom &zoom) const
} }
MapData::Elevation *DEMFile::elevations(Handle &hdl, int level, MapData::Elevation *DEMFile::elevations(Handle &hdl, int level,
const DEMTile *tile) const DEMTile *tile) const
{ {
const Level &l = _levels.at(level); const Level &l = _levels.at(level);
MapData::Elevation *ele = new MapData::Elevation(); MapData::Elevation *ele = new MapData::Elevation();

View File

@ -16,7 +16,8 @@ public:
bool load(Handle &hdl); bool load(Handle &hdl);
void clear(); void clear();
MapData::Elevation *elevations(Handle &hdl, int level, const DEMTile *tile); MapData::Elevation *elevations(Handle &hdl, int level,
const DEMTile *tile) const;
int level(const Zoom &zoom) const; int level(const Zoom &zoom) const;
QList<const DEMTile *> tiles(const RectC &rect, int level) const; QList<const DEMTile *> tiles(const RectC &rect, int level) const;
@ -44,7 +45,7 @@ private:
QList<DEMTile> tiles; QList<DEMTile> tiles;
}; };
qint16 meters(qint16 val) qint16 meters(qint16 val) const
{ {
return (_flags & 1) ? (qint16)qRound(val * 0.3048) : val; return (_flags & 1) ? (qint16)qRound(val * 0.3048) : val;
} }

View File

@ -92,7 +92,7 @@ bool GMAPData::loadTile(const QDir &dir)
} }
} }
if (!tile->init()) { if (!tile->init(0)) {
qWarning("%s: Invalid map tile", qPrintable(dir.path())); qWarning("%s: Invalid map tile", qPrintable(dir.path()));
delete tile; delete tile;
return false; return false;

View File

@ -29,11 +29,11 @@ static SubFile::Type tileType(const char str[3])
return SubFile::Unknown; return SubFile::Unknown;
} }
bool IMGData::readSubFileBlocks(QFile &file, quint64 offset, SubFile *subFile) bool IMGData::readSubFileBlocks(QFile *file, quint64 offset, SubFile *subFile)
{ {
quint16 block; quint16 block;
if (!file.seek(offset + 0x20)) if (!file->seek(offset + 0x20))
return false; return false;
for (int i = 0; i < 240; i++) { for (int i = 0; i < 240; i++) {
if (!readValue(file, block)) if (!readValue(file, block))
@ -46,11 +46,11 @@ bool IMGData::readSubFileBlocks(QFile &file, quint64 offset, SubFile *subFile)
return true; return true;
} }
bool IMGData::readIMGHeader(QFile &file) bool IMGData::readIMGHeader(QFile *file)
{ {
char signature[7], identifier[7]; char signature[7], identifier[7];
if (!(file.read((char*)&_key, 1) && file.seek(0x10) if (!(file->read((char*)&_key, 1) && file->seek(0x10)
&& read(file, signature, sizeof(signature)) && file.seek(0x41) && read(file, signature, sizeof(signature)) && file->seek(0x41)
&& read(file, identifier, sizeof(identifier))) && read(file, identifier, sizeof(identifier)))
|| memcmp(signature, "DSKIMG", sizeof(signature)) || memcmp(signature, "DSKIMG", sizeof(signature))
|| memcmp(identifier, "GARMIN", sizeof(identifier))) { || memcmp(identifier, "GARMIN", sizeof(identifier))) {
@ -60,8 +60,8 @@ bool IMGData::readIMGHeader(QFile &file)
char d1[20], d2[31]; char d1[20], d2[31];
quint8 e1, e2; quint8 e1, e2;
if (!(file.seek(0x49) && read(file, d1, sizeof(d1)) && file.seek(0x61) if (!(file->seek(0x49) && read(file, d1, sizeof(d1)) && file->seek(0x61)
&& readValue(file, e1) && readValue(file, e2) && file.seek(0x65) && readValue(file, e1) && readValue(file, e2) && file->seek(0x65)
&& read(file, d2, sizeof(d2)))) { && read(file, d2, sizeof(d2)))) {
_errorString = "Error reading IMG header"; _errorString = "Error reading IMG header";
return false; return false;
@ -74,7 +74,7 @@ bool IMGData::readIMGHeader(QFile &file)
return true; return true;
} }
bool IMGData::readFAT(QFile &file, TileMap &tileMap) bool IMGData::readFAT(QFile *file, TileMap &tileMap)
{ {
QByteArray typFile; QByteArray typFile;
quint8 flag; quint8 flag;
@ -82,7 +82,7 @@ bool IMGData::readFAT(QFile &file, TileMap &tileMap)
// Skip unused FAT blocks if any // Skip unused FAT blocks if any
while (true) { while (true) {
if (!(file.seek(offset) && readValue(file, flag))) if (!(file->seek(offset) && readValue(file, flag)))
return false; return false;
if (flag) if (flag)
break; break;
@ -93,14 +93,14 @@ bool IMGData::readFAT(QFile &file, TileMap &tileMap)
char name[8], type[3]; char name[8], type[3];
quint32 size; quint32 size;
quint16 part; quint16 part;
if (!(file.seek(offset + 12) && readValue(file, size))) if (!(file->seek(offset + 12) && readValue(file, size)))
return false; return false;
offset += 512; offset += 512;
int cnt = (size - offset) / 512; int cnt = (size - offset) / 512;
// Read FAT blocks describing the IMG sub-files // Read FAT blocks describing the IMG sub-files
for (int i = 0; i < cnt; i++) { for (int i = 0; i < cnt; i++) {
if (!(file.seek(offset) && readValue(file, flag) if (!(file->seek(offset) && readValue(file, flag)
&& read(file, name, sizeof(name)) && read(file, name, sizeof(name))
&& read(file, type, sizeof(type)) && readValue(file, size) && read(file, type, sizeof(type)) && readValue(file, size)
&& readValue(file, part))) && readValue(file, part)))
@ -140,13 +140,13 @@ bool IMGData::readFAT(QFile &file, TileMap &tileMap)
return true; return true;
} }
bool IMGData::createTileTree(const TileMap &tileMap) bool IMGData::createTileTree(QFile *file, const TileMap &tileMap)
{ {
for (TileMap::const_iterator it = tileMap.constBegin(); for (TileMap::const_iterator it = tileMap.constBegin();
it != tileMap.constEnd(); ++it) { it != tileMap.constEnd(); ++it) {
VectorTile *tile = it.value(); VectorTile *tile = it.value();
if (!tile->init()) { if (!tile->init(file)) {
qWarning("%s: %s: Invalid map tile", qPrintable(_fileName), qWarning("%s: %s: Invalid map tile", qPrintable(_fileName),
qPrintable(it.key())); qPrintable(it.key()));
delete tile; delete tile;
@ -177,14 +177,14 @@ IMGData::IMGData(const QString &fileName) : MapData(fileName)
return; return;
} }
if (!readIMGHeader(file)) if (!readIMGHeader(&file))
return; return;
if (!readFAT(file, tileMap)) { if (!readFAT(&file, tileMap)) {
_errorString = "Error reading FAT data"; _errorString = "Error reading FAT data";
qDeleteAll(tileMap); qDeleteAll(tileMap);
return; return;
} }
if (!createTileTree(tileMap)) { if (!createTileTree(&file, tileMap)) {
_errorString = "No usable map tile found"; _errorString = "No usable map tile found";
return; return;
} }
@ -194,16 +194,16 @@ IMGData::IMGData(const QString &fileName) : MapData(fileName)
_valid = true; _valid = true;
} }
qint64 IMGData::read(QFile &file, char *data, qint64 maxSize) const qint64 IMGData::read(QFile *file, char *data, qint64 maxSize) const
{ {
qint64 ret = file.read(data, maxSize); qint64 ret = file->read(data, maxSize);
if (_key) if (_key)
for (int i = 0; i < ret; i++) for (int i = 0; i < ret; i++)
data[i] ^= _key; data[i] ^= _key;
return ret; return ret;
} }
template<class T> bool IMGData::readValue(QFile &file, T &val) const template<class T> bool IMGData::readValue(QFile *file, T &val) const
{ {
T data; T data;
@ -215,9 +215,9 @@ template<class T> bool IMGData::readValue(QFile &file, T &val) const
return true; return true;
} }
bool IMGData::readBlock(QFile &file, int blockNum, char *data) const bool IMGData::readBlock(QFile *file, int blockNum, char *data) const
{ {
if (!file.seek((quint64)blockNum << _blockBits)) if (!file->seek((quint64)blockNum << _blockBits))
return false; return false;
if (read(file, data, 1ULL<<_blockBits) < (qint64)(1ULL<<_blockBits)) if (read(file, data, 1ULL<<_blockBits) < (qint64)(1ULL<<_blockBits))
return false; return false;

View File

@ -13,17 +13,17 @@ public:
IMGData(const QString &fileName); IMGData(const QString &fileName);
unsigned blockBits() const {return _blockBits;} unsigned blockBits() const {return _blockBits;}
bool readBlock(QFile &file, int blockNum, char *data) const; bool readBlock(QFile *file, int blockNum, char *data) const;
private: private:
typedef QMap<QByteArray, VectorTile*> TileMap; typedef QMap<QByteArray, VectorTile*> TileMap;
qint64 read(QFile &file, char *data, qint64 maxSize) const; qint64 read(QFile *file, char *data, qint64 maxSize) const;
template<class T> bool readValue(QFile &file, T &val) const; template<class T> bool readValue(QFile *file, T &val) const;
bool readSubFileBlocks(QFile &file, quint64 offset, SubFile *subFile); bool readSubFileBlocks(QFile *file, quint64 offset, SubFile *subFile);
bool readFAT(QFile &file, TileMap &tileMap); bool readFAT(QFile *file, TileMap &tileMap);
bool readIMGHeader(QFile &file); bool readIMGHeader(QFile *file);
bool createTileTree(const TileMap &tileMap); bool createTileTree(QFile *file, const TileMap &tileMap);
quint8 _key; quint8 _key;
unsigned _blockBits; unsigned _blockBits;

View File

@ -32,7 +32,8 @@ JLS::JLS(quint16 maxval, quint16 near)
_limit = LIMIT - _qbpp - 1; _limit = LIMIT - _qbpp - 1;
} }
bool JLS::processRunMode(BitStream &bs, quint16 col, quint16 &samples) bool JLS::processRunMode(BitStream &bs, Context &ctx, quint16 col,
quint16 &samples) const
{ {
quint8 z; quint8 z;
quint16 cnt = 0; quint16 cnt = 0;
@ -42,12 +43,12 @@ bool JLS::processRunMode(BitStream &bs, quint16 col, quint16 &samples)
z = Z[(bs.value() >> 0x18) ^ 0xff]; z = Z[(bs.value() >> 0x18) ^ 0xff];
for (quint8 i = 0; i < z; i++) { for (quint8 i = 0; i < z; i++) {
cnt = cnt + _rg; cnt = cnt + ctx.rg;
if (cnt <= col && _runIndex < 31) { if (cnt <= col && ctx.runIndex < 31) {
_runIndex++; ctx.runIndex++;
_rk = J[_runIndex]; ctx.rk = J[ctx.runIndex];
_rg = 1U << _rk; ctx.rg = 1U << ctx.rk;
} }
if (cnt >= col) { if (cnt >= col) {
@ -65,18 +66,18 @@ bool JLS::processRunMode(BitStream &bs, quint16 col, quint16 &samples)
if (!bs.read(z + 1)) if (!bs.read(z + 1))
return false; return false;
if (_rk) { if (ctx.rk) {
samples = (bs.value() >> (32 - _rk)) + cnt; samples = (bs.value() >> (32 - ctx.rk)) + cnt;
if (!bs.read(_rk)) if (!bs.read(ctx.rk))
return false; return false;
} else } else
samples = cnt; samples = cnt;
_lrk = _rk + 1; ctx.lrk = ctx.rk + 1;
if (_runIndex != 0) { if (ctx.runIndex != 0) {
_runIndex--; ctx.runIndex--;
_rk = J[_runIndex]; ctx.rk = J[ctx.runIndex];
_rg = 1U << _rk; ctx.rg = 1U << ctx.rk;
} }
return true; return true;
@ -87,7 +88,8 @@ bool JLS::processRunMode(BitStream &bs, quint16 col, quint16 &samples)
} }
} }
bool JLS::decodeError(BitStream &bs, quint8 limit, quint8 k, uint &MErrval) bool JLS::decodeError(BitStream &bs, quint8 limit, quint8 k,
uint &MErrval) const
{ {
quint8 cnt = 0; quint8 cnt = 0;
MErrval = 0; MErrval = 0;
@ -122,19 +124,19 @@ bool JLS::decodeError(BitStream &bs, quint8 limit, quint8 k, uint &MErrval)
return true; return true;
} }
bool JLS::readLine(BitStream &bs) bool JLS::readLine(BitStream &bs, Context &ctx) const
{ {
quint8 ictx, rctx; quint8 ictx, rctx;
quint8 k; quint8 k;
uint MErrval; uint MErrval;
int Errval; int Errval;
int Rx; int Rx;
int Ra = _last[1]; int Ra = ctx.last[1];
int Rb = _last[1]; int Rb = ctx.last[1];
int Rc = _last[0]; int Rc = ctx.last[0];
uint col = 1; uint col = 1;
*_current = _last[1]; *ctx.current = ctx.last[1];
do { do {
if (abs(Rb - Ra) > _near) { if (abs(Rb - Ra) > _near) {
@ -144,7 +146,7 @@ bool JLS::readLine(BitStream &bs)
else if (Px > _maxval) else if (Px > _maxval)
Px = _maxval; Px = _maxval;
for (k = 0; _n[1] << k < _a[1]; k++) for (k = 0; ctx.n[1] << k < ctx.a[1]; k++)
; ;
if (!decodeError(bs, _limit, k, MErrval)) if (!decodeError(bs, _limit, k, MErrval))
@ -158,7 +160,7 @@ bool JLS::readLine(BitStream &bs)
meh = MErrval >> 1; meh = MErrval >> 1;
mes = meh; mes = meh;
} }
if ((_near == 0) && (k == 0) && (_b[1] * 2 <= -_n[1])) { if ((_near == 0) && (k == 0) && (ctx.b[1] * 2 <= -ctx.n[1])) {
meh = mes + 1; meh = mes + 1;
mes = -mes - 1; mes = -mes - 1;
if (MErrval & 1) if (MErrval & 1)
@ -179,67 +181,67 @@ bool JLS::readLine(BitStream &bs)
if (Rx > _maxval) if (Rx > _maxval)
Rx = _maxval; Rx = _maxval;
_a[1] = _a[1] + meh; ctx.a[1] = ctx.a[1] + meh;
_b[1] = _b[1] + mes; ctx.b[1] = ctx.b[1] + mes;
if (_n[1] == 0x40) { if (ctx.n[1] == 0x40) {
_a[1] = _a[1] >> 1; ctx.a[1] = ctx.a[1] >> 1;
if (_b[1] >= 0) if (ctx.b[1] >= 0)
_b[1] = _b[1] >> 1; ctx.b[1] = ctx.b[1] >> 1;
else else
_b[1] = -((1 - _b[1]) >> 1); ctx.b[1] = -((1 - ctx.b[1]) >> 1);
_n[1] = 0x21; ctx.n[1] = 0x21;
} else } else
_n[1] = _n[1] + 1; ctx.n[1] = ctx.n[1] + 1;
if (_b[1] <= -_n[1]) { if (ctx.b[1] <= -ctx.n[1]) {
_b[1] = _b[1] + _n[1]; ctx.b[1] = ctx.b[1] + ctx.n[1];
if (_b[1] <= -_n[1]) if (ctx.b[1] <= -ctx.n[1])
_b[1] = 1 - _n[1]; ctx.b[1] = 1 - ctx.n[1];
} else if (_b[1] > 0) { } else if (ctx.b[1] > 0) {
_b[1] = _b[1] - _n[1]; ctx.b[1] = ctx.b[1] - ctx.n[1];
if (_b[1] > 0) if (ctx.b[1] > 0)
_b[1] = 0; ctx.b[1] = 0;
} }
Rc = Rb; Rc = Rb;
Rb = _last[col + 1]; Rb = ctx.last[col + 1];
} else { } else {
quint16 samples; quint16 samples;
if (!processRunMode(bs, _w - col + 1, samples)) if (!processRunMode(bs, ctx, ctx.w - col + 1, samples))
return false; return false;
if (samples != 0) { if (samples != 0) {
for (int i = 0; i < samples; i++) { for (int i = 0; i < samples; i++) {
if (col > _w) if (col > ctx.w)
return false; return false;
_current[col] = Ra; ctx.current[col] = Ra;
col++; col++;
} }
if (col > _w) if (col > ctx.w)
break; break;
Rc = _last[col]; Rc = ctx.last[col];
Rb = _last[col + 1]; Rb = ctx.last[col + 1];
} else { } else {
Rc = Rb; Rc = Rb;
Rb = _last[col + 1]; Rb = ctx.last[col + 1];
} }
rctx = (abs(Rc - Ra) <= _near); rctx = (abs(Rc - Ra) <= _near);
quint16 TEMP = _a[rctx + 2]; quint16 TEMP = ctx.a[rctx + 2];
if (rctx) if (rctx)
TEMP += _n[rctx + 2] >> 1; TEMP += ctx.n[rctx + 2] >> 1;
ictx = rctx | 2; ictx = rctx | 2;
for (k = 0; _n[rctx + 2] << k < TEMP; k++) for (k = 0; ctx.n[rctx + 2] << k < TEMP; k++)
; ;
if (!decodeError(bs, _limit - _lrk, k, MErrval)) if (!decodeError(bs, _limit - ctx.lrk, k, MErrval))
return false; return false;
quint16 s = ((k == 0) && (rctx || MErrval)) ? quint16 s = ((k == 0) && (rctx || MErrval)) ?
(_b[ictx] * 2 < _n[ictx]) : 0; (ctx.b[ictx] * 2 < ctx.n[ictx]) : 0;
Errval = MErrval + rctx + s; Errval = MErrval + rctx + s;
int evh; int evh;
@ -249,7 +251,7 @@ bool JLS::readLine(BitStream &bs)
} else { } else {
Errval = s - ((Errval + 1) >> 1); Errval = s - ((Errval + 1) >> 1);
evh = -Errval; evh = -Errval;
_b[ictx] = _b[ictx] + 1; ctx.b[ictx] = ctx.b[ictx] + 1;
} }
Errval *= (_near * 2 + 1); Errval *= (_near * 2 + 1);
@ -274,59 +276,45 @@ bool JLS::readLine(BitStream &bs)
if (Rx > _maxval) if (Rx > _maxval)
Rx = _maxval; Rx = _maxval;
_a[ictx] = _a[ictx] + (evh - rctx); ctx.a[ictx] = ctx.a[ictx] + (evh - rctx);
if (_n[ictx] == 0x40) { if (ctx.n[ictx] == 0x40) {
_a[ictx] = _a[ictx] >> 1; ctx.a[ictx] = ctx.a[ictx] >> 1;
if (_b[ictx] >= 0) if (ctx.b[ictx] >= 0)
_b[ictx] = _b[ictx] >> 1; ctx.b[ictx] = ctx.b[ictx] >> 1;
else else
_b[ictx] = -((1 - _b[ictx]) >> 1); ctx.b[ictx] = -((1 - ctx.b[ictx]) >> 1);
_n[ictx] = 0x21; ctx.n[ictx] = 0x21;
} else } else
_n[ictx] = _n[ictx] + 1; ctx.n[ictx] = ctx.n[ictx] + 1;
} }
_current[col] = Rx; ctx.current[col] = Rx;
Ra = Rx; Ra = Rx;
col = col + 1; col = col + 1;
} while (col <= _w); } while (col <= ctx.w);
return true; return true;
} }
bool JLS::decode(const SubFile *file, SubFile::Handle &hdl, Matrix<qint16> &img) bool JLS::decode(const SubFile *file, SubFile::Handle &hdl,
Matrix<qint16> &img) const
{ {
Context ctx(img.w(), _range);
BitStream bs(file, hdl); BitStream bs(file, hdl);
if (!bs.init()) if (!bs.init())
return false; return false;
_w = img.w();
_data = QVector<quint16>((_w + 3) * 2);
_last = _data.data();
_current = _data.data() + (_w + 3);
_runIndex = 0;
_rk = 0;
_rg = 1;
_lrk = 0;
quint16 A = qMax(2, (_range + 32) / 64);
for (int i = 0; i < 4; i++) {
_a[i] = A;
_b[i] = 0;
_n[i] = 1;
}
for (int i = 0; i < img.h(); i++) { for (int i = 0; i < img.h(); i++) {
if (!readLine(bs)) if (!readLine(bs, ctx))
return false; return false;
memcpy(img.row(i), _current + 1, _w * sizeof(quint16)); memcpy(img.row(i), ctx.current + 1, img.w() * sizeof(quint16));
quint16 *tmp = _last; quint16 *tmp = ctx.last;
_last = _current; ctx.last = ctx.current;
_current = tmp; ctx.current = tmp;
} }
return true; return true;

View File

@ -12,7 +12,8 @@ class JLS
public: public:
JLS(quint16 maxval, quint16 near); JLS(quint16 maxval, quint16 near);
bool decode(const SubFile *file, SubFile::Handle &hdl, Matrix<qint16> &img); bool decode(const SubFile *file, SubFile::Handle &hdl,
Matrix<qint16> &img) const;
private: private:
class BitStream class BitStream
@ -56,28 +57,48 @@ private:
qint8 _shift; qint8 _shift;
}; };
bool readLine(BitStream &bs); struct Context
bool processRunMode(BitStream &bs, quint16 col, quint16 &samples); {
bool decodeError(BitStream &bs, quint8 limit, quint8 k, uint &MErrval); Context(quint16 width, quint16 range)
: data(QVector<quint16>((width + 3) * 2)), w(width), rg(1),
runIndex(0), rk(0), lrk(0)
{
quint16 A = qMax(2, (range + 32) / 64);
last = data.data();
current = data.data() + (w + 3);
for (int i = 0; i < 4; i++) {
a[i] = A;
b[i] = 0;
n[i] = 1;
}
}
QVector<quint16> data;
quint16 *current;
quint16 *last;
quint16 w;
quint16 rg;
quint16 n[4];
quint16 a[4];
qint16 b[4];
quint8 runIndex;
quint8 rk;
quint8 lrk;
};
bool readLine(BitStream &bs, Context &ctx) const;
bool processRunMode(BitStream &bs, Context &ctx, quint16 col,
quint16 &samples) const;
bool decodeError(BitStream &bs, quint8 limit, quint8 k,
uint &MErrval) const;
quint16 _maxval; quint16 _maxval;
quint16 _near; quint16 _near;
quint16 _range; quint16 _range;
quint8 _qbpp; quint8 _qbpp;
quint8 _limit; quint8 _limit;
quint8 _runIndex;
quint8 _rk;
quint16 _rg;
quint16 _n[4];
quint16 _a[4];
qint16 _b[4];
quint8 _lrk;
quint16 _w;
QVector<quint16> _data;
quint16 *_current;
quint16 *_last;
}; };
} }

View File

@ -13,7 +13,7 @@ using namespace IMG;
bool MapData::polyCb(VectorTile *tile, void *context) bool MapData::polyCb(VectorTile *tile, void *context)
{ {
PolyCTX *ctx = (PolyCTX*)context; PolyCTX *ctx = (PolyCTX*)context;
tile->polys(ctx->rect, ctx->zoom, ctx->polygons, ctx->lines, tile->polys(ctx->file, ctx->rect, ctx->zoom, ctx->polygons, ctx->lines,
ctx->cache, ctx->lock); ctx->cache, ctx->lock);
return true; return true;
} }
@ -21,14 +21,16 @@ bool MapData::polyCb(VectorTile *tile, void *context)
bool MapData::pointCb(VectorTile *tile, void *context) bool MapData::pointCb(VectorTile *tile, void *context)
{ {
PointCTX *ctx = (PointCTX*)context; PointCTX *ctx = (PointCTX*)context;
tile->points(ctx->rect, ctx->zoom, ctx->points, ctx->cache, ctx->lock); tile->points(ctx->file, ctx->rect, ctx->zoom, ctx->points, ctx->cache,
ctx->lock);
return true; return true;
} }
bool MapData::elevationCb(VectorTile *tile, void *context) bool MapData::elevationCb(VectorTile *tile, void *context)
{ {
ElevationCTX *ctx = (ElevationCTX*)context; ElevationCTX *ctx = (ElevationCTX*)context;
tile->elevations(ctx->rect, ctx->zoom, ctx->elevations, ctx->cache, ctx->lock); tile->elevations(ctx->file, ctx->rect, ctx->zoom, ctx->elevations,
ctx->cache, ctx->lock);
return true; return true;
} }
@ -50,10 +52,10 @@ MapData::~MapData()
delete _style; delete _style;
} }
void MapData::polys(const RectC &rect, int bits, QList<Poly> *polygons, void MapData::polys(QFile *file, const RectC &rect, int bits,
QList<Poly> *lines) QList<Poly> *polygons, QList<Poly> *lines)
{ {
PolyCTX ctx(rect, zoom(bits), polygons, lines, &_polyCache, &_lock); PolyCTX ctx(file, rect, zoom(bits), polygons, lines, &_polyCache, &_lock);
double min[2], max[2]; double min[2], max[2];
min[0] = rect.left(); min[0] = rect.left();
@ -64,9 +66,10 @@ void MapData::polys(const RectC &rect, int bits, QList<Poly> *polygons,
_tileTree.Search(min, max, polyCb, &ctx); _tileTree.Search(min, max, polyCb, &ctx);
} }
void MapData::points(const RectC &rect, int bits, QList<Point> *points) void MapData::points(QFile *file, const RectC &rect, int bits,
QList<Point> *points)
{ {
PointCTX ctx(rect, zoom(bits), points, &_pointCache, &_lock); PointCTX ctx(file, rect, zoom(bits), points, &_pointCache, &_lock);
double min[2], max[2]; double min[2], max[2];
min[0] = rect.left(); min[0] = rect.left();
@ -77,9 +80,10 @@ void MapData::points(const RectC &rect, int bits, QList<Point> *points)
_tileTree.Search(min, max, pointCb, &ctx); _tileTree.Search(min, max, pointCb, &ctx);
} }
void MapData::elevations(const RectC &rect, int bits, QList<Elevation> *elevations) void MapData::elevations(QFile *file, const RectC &rect, int bits,
QList<Elevation> *elevations)
{ {
ElevationCTX ctx(rect, zoom(bits), elevations, &_demCache, &_demLock); ElevationCTX ctx(file, rect, zoom(bits), elevations, &_demCache, &_demLock);
double min[2], max[2]; double min[2], max[2];
min[0] = rect.left(); min[0] = rect.left();
@ -95,14 +99,14 @@ void MapData::load(qreal ratio)
Q_ASSERT(!_style); Q_ASSERT(!_style);
if (_typ) if (_typ)
_style = new Style(ratio, _typ); _style = new Style(0, ratio, _typ);
else { else {
QString typFile(ProgramPaths::typFile()); QString typFile(ProgramPaths::typFile());
if (QFileInfo::exists(typFile)) { if (QFileInfo::exists(typFile)) {
SubFile typ(&typFile); SubFile typ(&typFile);
_style = new Style(ratio, &typ); _style = new Style(0, ratio, &typ);
} else } else
_style = new Style(ratio); _style = new Style(0, ratio);
} }
} }

View File

@ -5,6 +5,7 @@
#include <QPointF> #include <QPointF>
#include <QCache> #include <QCache>
#include <QMutex> #include <QMutex>
#include <QFile>
#include <QDebug> #include <QDebug>
#include "common/rectc.h" #include "common/rectc.h"
#include "common/rtree.h" #include "common/rtree.h"
@ -77,10 +78,11 @@ public:
const RectC &bounds() const {return _bounds;} const RectC &bounds() const {return _bounds;}
const Range &zooms() const {return _zoomLevels;} const Range &zooms() const {return _zoomLevels;}
const Style *style() const {return _style;} const Style *style() const {return _style;}
void polys(const RectC &rect, int bits, QList<Poly> *polygons, void polys(QFile *file, const RectC &rect, int bits, QList<Poly> *polygons,
QList<Poly> *lines); QList<Poly> *lines);
void points(const RectC &rect, int bits, QList<Point> *points); void points(QFile *file, const RectC &rect, int bits, QList<Point> *points);
void elevations(const RectC &rect, int bits, QList<Elevation> *elevations); void elevations(QFile *file, const RectC &rect, int bits,
QList<Elevation> *elevations);
void load(qreal ratio); void load(qreal ratio);
void clear(); void clear();
@ -122,12 +124,13 @@ private:
struct PolyCTX struct PolyCTX
{ {
PolyCTX(const RectC &rect, const Zoom &zoom, PolyCTX(QFile *file, const RectC &rect, const Zoom &zoom,
QList<MapData::Poly> *polygons, QList<MapData::Poly> *lines, QList<MapData::Poly> *polygons, QList<MapData::Poly> *lines,
PolyCache *cache, QMutex *lock) PolyCache *cache, QMutex *lock)
: rect(rect), zoom(zoom), polygons(polygons), lines(lines), : file(file), rect(rect), zoom(zoom), polygons(polygons),
cache(cache), lock(lock) {} lines(lines), cache(cache), lock(lock) {}
QFile *file;
const RectC &rect; const RectC &rect;
const Zoom &zoom; const Zoom &zoom;
QList<MapData::Poly> *polygons; QList<MapData::Poly> *polygons;
@ -138,10 +141,12 @@ private:
struct PointCTX struct PointCTX
{ {
PointCTX(const RectC &rect, const Zoom &zoom, PointCTX(QFile *file, const RectC &rect, const Zoom &zoom,
QList<MapData::Point> *points, PointCache *cache, QMutex *lock) QList<MapData::Point> *points, PointCache *cache, QMutex *lock)
: rect(rect), zoom(zoom), points(points), cache(cache), lock(lock) {} : file(file), rect(rect), zoom(zoom), points(points), cache(cache),
lock(lock) {}
QFile *file;
const RectC &rect; const RectC &rect;
const Zoom &zoom; const Zoom &zoom;
QList<MapData::Point> *points; QList<MapData::Point> *points;
@ -151,11 +156,12 @@ private:
struct ElevationCTX struct ElevationCTX
{ {
ElevationCTX(const RectC &rect, const Zoom &zoom, ElevationCTX(QFile *file, const RectC &rect, const Zoom &zoom,
QList<Elevation> *elevations, ElevationCache *cache, QMutex *lock) QList<Elevation> *elevations, ElevationCache *cache, QMutex *lock)
: rect(rect), zoom(zoom), elevations(elevations), cache(cache), : file(file), rect(rect), zoom(zoom), elevations(elevations),
lock(lock) {} cache(cache), lock(lock) {}
QFile *file;
const RectC &rect; const RectC &rect;
const Zoom &zoom; const Zoom &zoom;
QList<Elevation> *elevations; QList<Elevation> *elevations;

View File

@ -152,7 +152,7 @@ void RasterTile::drawPolygons(QPainter *painter,
bool insert = false; bool insert = false;
SubFile::Handle *hdl = hc.object(poly.raster.lbl()); SubFile::Handle *hdl = hc.object(poly.raster.lbl());
if (!hdl) { if (!hdl) {
hdl = new SubFile::Handle(poly.raster.lbl()); hdl = new SubFile::Handle(_file, poly.raster.lbl());
insert = true; insert = true;
} }
QPixmap pm(poly.raster.lbl()->image(*hdl, poly.raster.id())); QPixmap pm(poly.raster.lbl()->image(*hdl, poly.raster.id()));
@ -217,8 +217,13 @@ void RasterTile::drawLines(QPainter *painter,
void RasterTile::drawTextItems(QPainter *painter, void RasterTile::drawTextItems(QPainter *painter,
const QList<TextItem*> &textItems) const const QList<TextItem*> &textItems) const
{ {
for (int i = 0; i < textItems.size(); i++) QRectF rect(_rect);
textItems.at(i)->paint(painter);
for (int i = 0; i < textItems.size(); i++) {
const TextItem *ti = textItems.at(i);
if (rect.intersects(ti->boundingRect()))
ti->paint(painter);
}
} }
static void removeDuplicitLabel(QList<TextItem *> &labels, const QString &text, static void removeDuplicitLabel(QList<TextItem *> &labels, const QString &text,
@ -438,11 +443,16 @@ void RasterTile::fetchData(QList<MapData::Poly> &polygons,
{ {
QPoint ttl(_rect.topLeft()); QPoint ttl(_rect.topLeft());
if (dynamic_cast<IMGData*>(_data)) {
_file = new QFile(_data->fileName());
_file->open(QIODevice::ReadOnly | QIODevice::Unbuffered);
}
QRectF polyRect(ttl, QPointF(ttl.x() + _rect.width(), ttl.y() QRectF polyRect(ttl, QPointF(ttl.x() + _rect.width(), ttl.y()
+ _rect.height())); + _rect.height()));
RectD polyRectD(_transform.img2proj(polyRect.topLeft()), RectD polyRectD(_transform.img2proj(polyRect.topLeft()),
_transform.img2proj(polyRect.bottomRight())); _transform.img2proj(polyRect.bottomRight()));
_data->polys(polyRectD.toRectC(_proj, 20), _zoom, _data->polys(_file, polyRectD.toRectC(_proj, 20), _zoom,
&polygons, _vectors ? &lines : 0); &polygons, _vectors ? &lines : 0);
if (_vectors) { if (_vectors) {
@ -451,7 +461,7 @@ void RasterTile::fetchData(QList<MapData::Poly> &polygons,
+ TEXT_EXTENT)); + TEXT_EXTENT));
RectD pointRectD(_transform.img2proj(pointRect.topLeft()), RectD pointRectD(_transform.img2proj(pointRect.topLeft()),
_transform.img2proj(pointRect.bottomRight())); _transform.img2proj(pointRect.bottomRight()));
_data->points(pointRectD.toRectC(_proj, 20), _zoom, &points); _data->points(_file, pointRectD.toRectC(_proj, 20), _zoom, &points);
} }
} }
@ -476,7 +486,7 @@ MatrixD RasterTile::elevation(int extend) const
// Extra margin for always including the next DEM tile on the map tile // Extra margin for always including the next DEM tile on the map tile
// edges (the DEM tile resolution is usally 0.5-15% of the map tile) // edges (the DEM tile resolution is usally 0.5-15% of the map tile)
double factor = 6 - (_zoom - 24) * 1.7; double factor = 6 - (_zoom - 24) * 1.7;
_data->elevations(rect.adjusted(0, 0, rect.width() / factor, _data->elevations(_file, rect.adjusted(0, 0, rect.width() / factor,
-rect.height() / factor), _zoom, &tiles); -rect.height() / factor), _zoom, &tiles);
DEMTree tree(tiles); DEMTree tree(tiles);

View File

@ -22,7 +22,8 @@ public:
bool hillShading, bool rasters, bool vectors) bool hillShading, bool rasters, bool vectors)
: _proj(proj), _transform(transform), _data(data), _zoom(zoom), : _proj(proj), _transform(transform), _data(data), _zoom(zoom),
_rect(rect), _ratio(ratio), _key(key), _hillShading(hillShading), _rect(rect), _ratio(ratio), _key(key), _hillShading(hillShading),
_rasters(rasters), _vectors(vectors) {} _rasters(rasters), _vectors(vectors), _file(0) {}
~RasterTile() {delete _file;}
const QString &key() const {return _key;} const QString &key() const {return _key;}
QPoint xy() const {return _rect.topLeft();} QPoint xy() const {return _rect.topLeft();}
@ -88,6 +89,7 @@ private:
QPixmap _pixmap; QPixmap _pixmap;
bool _hillShading; bool _hillShading;
bool _rasters, _vectors; bool _rasters, _vectors;
QFile *_file;
}; };
} }

View File

@ -1268,50 +1268,50 @@ bool Style::parseDrawOrder(SubFile *file, SubFile::Handle &hdl,
return true; return true;
} }
bool Style::parseTYPFile(SubFile *file) bool Style::parseTYPFile(QFile *file, SubFile *typ)
{ {
SubFile::Handle hdl(file); SubFile::Handle hdl(file, typ);
Section points, lines, polygons, order; Section points, lines, polygons, order;
quint16 tmp16, codepage; quint16 tmp16, codepage;
if (!(file->seek(hdl, 0x15) && file->readUInt16(hdl, codepage) if (!(typ->seek(hdl, 0x15) && typ->readUInt16(hdl, codepage)
&& file->readUInt32(hdl, points.offset) && typ->readUInt32(hdl, points.offset)
&& file->readUInt32(hdl, points.size) && typ->readUInt32(hdl, points.size)
&& file->readUInt32(hdl, lines.offset) && typ->readUInt32(hdl, lines.offset)
&& file->readUInt32(hdl, lines.size) && typ->readUInt32(hdl, lines.size)
&& file->readUInt32(hdl, polygons.offset) && typ->readUInt32(hdl, polygons.offset)
&& file->readUInt32(hdl, polygons.size))) && typ->readUInt32(hdl, polygons.size)))
return false; return false;
if (!(file->readUInt16(hdl, tmp16) && file->readUInt16(hdl, tmp16))) if (!(typ->readUInt16(hdl, tmp16) && typ->readUInt16(hdl, tmp16)))
return false; return false;
if (!(file->readUInt32(hdl, points.arrayOffset) if (!(typ->readUInt32(hdl, points.arrayOffset)
&& file->readUInt16(hdl, points.arrayItemSize) && typ->readUInt16(hdl, points.arrayItemSize)
&& file->readUInt32(hdl, points.arraySize) && typ->readUInt32(hdl, points.arraySize)
&& file->readUInt32(hdl, lines.arrayOffset) && typ->readUInt32(hdl, lines.arrayOffset)
&& file->readUInt16(hdl, lines.arrayItemSize) && typ->readUInt16(hdl, lines.arrayItemSize)
&& file->readUInt32(hdl, lines.arraySize) && typ->readUInt32(hdl, lines.arraySize)
&& file->readUInt32(hdl, polygons.arrayOffset) && typ->readUInt32(hdl, polygons.arrayOffset)
&& file->readUInt16(hdl, polygons.arrayItemSize) && typ->readUInt16(hdl, polygons.arrayItemSize)
&& file->readUInt32(hdl, polygons.arraySize) && typ->readUInt32(hdl, polygons.arraySize)
&& file->readUInt32(hdl, order.arrayOffset) && typ->readUInt32(hdl, order.arrayOffset)
&& file->readUInt16(hdl, order.arrayItemSize) && typ->readUInt16(hdl, order.arrayItemSize)
&& file->readUInt32(hdl, order.arraySize))) && typ->readUInt32(hdl, order.arraySize)))
return false; return false;
if (!(parsePoints(file, hdl, points) && parseLines(file, hdl, lines) if (!(parsePoints(typ, hdl, points) && parseLines(typ, hdl, lines)
&& parsePolygons(file, hdl, polygons) && parsePolygons(typ, hdl, polygons)
&& parseDrawOrder(file, hdl, order))) { && parseDrawOrder(typ, hdl, order))) {
qWarning("%s: Invalid TYP file, using default style", qWarning("%s: Invalid TYP file, using default style",
qPrintable(file->fileName())); qPrintable(typ->fileName()));
return false; return false;
} }
return true; return true;
} }
Style::Style(qreal ratio, SubFile *typ) Style::Style(QFile *file, qreal ratio, SubFile *typ)
{ {
_large = pixelSizeFont(16); _large = pixelSizeFont(16);
_normal = pixelSizeFont(14); _normal = pixelSizeFont(14);
@ -1326,7 +1326,7 @@ Style::Style(qreal ratio, SubFile *typ)
defaultPointStyle(ratio); defaultPointStyle(ratio);
if (typ) if (typ)
parseTYPFile(typ); parseTYPFile(file, typ);
} }
const Style::Line &Style::line(quint32 type) const const Style::Line &Style::line(quint32 type) const

View File

@ -104,7 +104,7 @@ public:
}; };
Style(qreal ratio, SubFile *typ = 0); Style(QFile *file, qreal ratio, SubFile *typ = 0);
const Line &line(quint32 type) const; const Line &line(quint32 type) const;
const Polygon &polygon(quint32 type) const; const Polygon &polygon(quint32 type) const;
@ -171,7 +171,7 @@ private:
bool extended; bool extended;
}; };
bool parseTYPFile(SubFile *file); bool parseTYPFile(QFile *file, SubFile *typ);
bool parsePoints(SubFile *file, SubFile::Handle &hdl, bool parsePoints(SubFile *file, SubFile::Handle &hdl,
const Section &section); const Section &section);
bool parsePoint(SubFile *file, SubFile::Handle &hdl, bool parsePoint(SubFile *file, SubFile::Handle &hdl,

View File

@ -27,9 +27,9 @@ bool SubFile::seek(Handle &handle, quint32 pos) const
int blockNum = pos >> BLOCK_BITS; int blockNum = pos >> BLOCK_BITS;
if (handle._blockNum != blockNum) { if (handle._blockNum != blockNum) {
if (!handle._file.seek((quint64)blockNum << BLOCK_BITS)) if (!handle._file->seek((quint64)blockNum << BLOCK_BITS))
return false; return false;
if (handle._file.read(handle._data.data(), (1<<BLOCK_BITS)) < 0) if (handle._file->read(handle._data.data(), (1<<BLOCK_BITS)) < 0)
return false; return false;
handle._blockNum = blockNum; handle._blockNum = blockNum;
} }

View File

@ -18,25 +18,34 @@ public:
class Handle class Handle
{ {
public: public:
Handle(const SubFile *subFile) Handle(QFile *file, const SubFile *subFile)
: _blockNum(-1), _blockPos(-1), _pos(-1) : _file(file), _blockNum(-1), _blockPos(-1), _pos(-1), _delete(false)
{ {
if (!subFile) if (!subFile)
return; return;
if (!_file) {
_file = new QFile(subFile->fileName());
_file->open(QIODevice::ReadOnly | QIODevice::Unbuffered);
_delete = true;
}
_data.resize(subFile->blockSize()); _data.resize(subFile->blockSize());
_file.setFileName(subFile->fileName()); }
_file.open(QIODevice::ReadOnly | QIODevice::Unbuffered); ~Handle()
{
if (_delete)
delete _file;
} }
private: private:
friend class SubFile; friend class SubFile;
QFile _file; QFile *_file;
QByteArray _data; QByteArray _data;
int _blockNum; int _blockNum;
int _blockPos; int _blockPos;
int _pos; int _pos;
bool _delete;
}; };
SubFile(const IMGData *img) SubFile(const IMGData *img)

View File

@ -49,9 +49,9 @@ TREFile::~TREFile()
clear(); clear();
} }
bool TREFile::init() bool TREFile::init(QFile *file)
{ {
Handle hdl(this); Handle hdl(file, this);
quint8 locked, levels[64]; quint8 locked, levels[64];
quint16 hdrLen; quint16 hdrLen;
qint32 north, east, south, west; qint32 north, east, south, west;
@ -154,9 +154,9 @@ int TREFile::readExtEntry(Handle &hdl, quint32 &polygons, quint32 &lines,
return rb; return rb;
} }
bool TREFile::load(int idx) bool TREFile::load(QFile *file, int idx)
{ {
Handle hdl(this); Handle hdl(file, this);
QList<SubDiv*> sl; QList<SubDiv*> sl;
SubDiv *s = 0; SubDiv *s = 0;
SubDivTree *tree = new SubDivTree(); SubDivTree *tree = new SubDivTree();
@ -282,7 +282,7 @@ void TREFile::clear()
_subdivs.clear(); _subdivs.clear();
} }
const TREFile::SubDivTree *TREFile::subdivs(const Zoom &zoom) const TREFile::SubDivTree *TREFile::subdivs(QFile *file, const Zoom &zoom)
{ {
int idx = -1; int idx = -1;
@ -296,7 +296,7 @@ const TREFile::SubDivTree *TREFile::subdivs(const Zoom &zoom)
if (idx < 0) if (idx < 0)
return 0; return 0;
if (!_subdivs.contains(_levels.at(idx).level) && !load(idx)) if (!_subdivs.contains(_levels.at(idx).level) && !load(file, idx))
return 0; return 0;
return _subdivs.value(_levels.at(idx).level); return _subdivs.value(_levels.at(idx).level);
@ -309,10 +309,10 @@ static bool cb(SubDiv *subdiv, void *context)
return true; return true;
} }
QList<SubDiv*> TREFile::subdivs(const RectC &rect, const Zoom &zoom) QList<SubDiv*> TREFile::subdivs(QFile *file, const RectC &rect, const Zoom &zoom)
{ {
QList<SubDiv*> list; QList<SubDiv*> list;
const SubDivTree *tree = subdivs(zoom); const SubDivTree *tree = subdivs(file, zoom);
double min[2], max[2]; double min[2], max[2];
min[0] = rect.left(); min[0] = rect.left();

View File

@ -24,11 +24,11 @@ public:
: SubFile(gmp, offset), _flags(0), _extItemSize(0) {} : SubFile(gmp, offset), _flags(0), _extItemSize(0) {}
~TREFile(); ~TREFile();
bool init(); bool init(QFile *file);
void clear(); void clear();
const RectC &bounds() const {return _bounds;} const RectC &bounds() const {return _bounds;}
QList<SubDiv*> subdivs(const RectC &rect, const Zoom &zoom); QList<SubDiv*> subdivs(QFile *file, const RectC &rect, const Zoom &zoom);
quint32 shift(quint8 bits) const quint32 shift(quint8 bits) const
{return (bits == _levels.last().bits) ? (_flags >> 0xb) & 7 : 0;} {return (bits == _levels.last().bits) ? (_flags >> 0xb) & 7 : 0;}
QVector<Zoom> zooms() const; QVector<Zoom> zooms() const;
@ -41,8 +41,8 @@ private:
}; };
typedef RTree<SubDiv*, double, 2> SubDivTree; typedef RTree<SubDiv*, double, 2> SubDivTree;
bool load(int idx); bool load(QFile *file, int idx);
const SubDivTree *subdivs(const Zoom &zoom); const SubDivTree *subdivs(QFile *file, const Zoom &zoom);
int readExtEntry(Handle &hdl, quint32 &polygons, quint32 &lines, int readExtEntry(Handle &hdl, quint32 &polygons, quint32 &lines,
quint32 &points); quint32 &points);

View File

@ -40,20 +40,20 @@ SubFile *VectorTile::file(SubFile::Type type)
} }
} }
bool VectorTile::init() bool VectorTile::init(QFile *file)
{ {
if (_gmp && !initGMP()) if (_gmp && !initGMP(file))
return false; return false;
if (!(_tre && _tre->init() && _rgn)) if (!(_tre && _tre->init(file) && _rgn))
return false; return false;
return true; return true;
} }
bool VectorTile::initGMP() bool VectorTile::initGMP(QFile *file)
{ {
SubFile::Handle hdl(_gmp); SubFile::Handle hdl(file, _gmp);
quint32 tre, rgn, lbl, net, nod, dem; quint32 tre, rgn, lbl, net, nod, dem;
if (!(_gmp->seek(hdl, 0x19) && _gmp->readUInt32(hdl, tre) if (!(_gmp->seek(hdl, 0x19) && _gmp->readUInt32(hdl, tre)
@ -118,49 +118,56 @@ void VectorTile::clear()
_demLoaded = 0; _demLoaded = 0;
} }
void VectorTile::polys(const RectC &rect, const Zoom &zoom, void VectorTile::polys(QFile *file, const RectC &rect, const Zoom &zoom,
QList<MapData::Poly> *polygons, QList<MapData::Poly> *lines, QList<MapData::Poly> *polygons, QList<MapData::Poly> *lines,
MapData::PolyCache *cache, QMutex *lock) MapData::PolyCache *cache, QMutex *cacheLock)
{ {
SubFile::Handle *rgnHdl = 0, *lblHdl = 0, *netHdl = 0, *nodHdl = 0, SubFile::Handle *rgnHdl = 0, *lblHdl = 0, *netHdl = 0, *nodHdl = 0,
*nodHdl2 = 0; *nodHdl2 = 0;
lock->lock(); _lock.lock();
if (_loaded < 0) { if (_loaded < 0) {
lock->unlock(); _lock.unlock();
return; return;
} }
if (!_loaded) { if (!_loaded) {
rgnHdl = new SubFile::Handle(_rgn); rgnHdl = new SubFile::Handle(file, _rgn);
lblHdl = new SubFile::Handle(_lbl); lblHdl = new SubFile::Handle(file, _lbl);
netHdl = new SubFile::Handle(_net); netHdl = new SubFile::Handle(file, _net);
nodHdl = new SubFile::Handle(_nod); nodHdl = new SubFile::Handle(file, _nod);
if (!load(*rgnHdl, *lblHdl, *netHdl, *nodHdl)) { if (!load(*rgnHdl, *lblHdl, *netHdl, *nodHdl)) {
lock->unlock(); _lock.unlock();
delete rgnHdl; delete lblHdl; delete netHdl; delete nodHdl; delete rgnHdl; delete lblHdl; delete netHdl; delete nodHdl;
return; return;
} }
} }
QList<SubDiv*> subdivs = _tre->subdivs(rect, zoom); QList<SubDiv*> subdivs = _tre->subdivs(file, rect, zoom);
cacheLock->lock();
for (int i = 0; i < subdivs.size(); i++) { for (int i = 0; i < subdivs.size(); i++) {
SubDiv *subdiv = subdivs.at(i); SubDiv *subdiv = subdivs.at(i);
MapData::Polys *polys = cache->object(subdiv); MapData::Polys *polys = cache->object(subdiv);
if (!polys) { if (!polys) {
cacheLock->unlock();
quint32 shift = _tre->shift(subdiv->bits()); quint32 shift = _tre->shift(subdiv->bits());
if (!rgnHdl) { if (!rgnHdl) {
rgnHdl = new SubFile::Handle(_rgn); rgnHdl = new SubFile::Handle(file, _rgn);
lblHdl = new SubFile::Handle(_lbl); lblHdl = new SubFile::Handle(file, _lbl);
netHdl = new SubFile::Handle(_net); netHdl = new SubFile::Handle(file, _net);
} }
if (!subdiv->initialized() && !_rgn->subdivInit(*rgnHdl, subdiv)) if (!subdiv->initialized() && !_rgn->subdivInit(*rgnHdl, subdiv)) {
cacheLock->lock();
continue; continue;
}
polys = new MapData::Polys(); polys = new MapData::Polys();
@ -175,9 +182,9 @@ void VectorTile::polys(const RectC &rect, const Zoom &zoom,
if (_net && _net->hasLinks()) { if (_net && _net->hasLinks()) {
if (!nodHdl) if (!nodHdl)
nodHdl = new SubFile::Handle(_nod); nodHdl = new SubFile::Handle(file, _nod);
if (!nodHdl2) if (!nodHdl2)
nodHdl2 = new SubFile::Handle(_nod); nodHdl2 = new SubFile::Handle(file, _nod);
_rgn->links(*rgnHdl, subdiv, shift, _net, *netHdl, _nod, *nodHdl, _rgn->links(*rgnHdl, subdiv, shift, _net, *netHdl, _nod, *nodHdl,
*nodHdl2, _lbl, *lblHdl, &polys->lines); *nodHdl2, _lbl, *lblHdl, &polys->lines);
} }
@ -186,6 +193,7 @@ void VectorTile::polys(const RectC &rect, const Zoom &zoom,
if (lines) if (lines)
copyPolys(rect, &polys->lines, lines); copyPolys(rect, &polys->lines, lines);
cacheLock->lock();
cache->insert(subdiv, polys); cache->insert(subdiv, polys);
} else { } else {
copyPolys(rect, &polys->polygons, polygons); copyPolys(rect, &polys->polygons, polygons);
@ -194,49 +202,57 @@ void VectorTile::polys(const RectC &rect, const Zoom &zoom,
} }
} }
lock->unlock(); cacheLock->unlock();
_lock.unlock();
delete rgnHdl; delete lblHdl; delete netHdl; delete nodHdl; delete nodHdl2; delete rgnHdl; delete lblHdl; delete netHdl; delete nodHdl; delete nodHdl2;
} }
void VectorTile::points(const RectC &rect, const Zoom &zoom, void VectorTile::points(QFile *file, const RectC &rect, const Zoom &zoom,
QList<MapData::Point> *points, MapData::PointCache *cache, QMutex *lock) QList<MapData::Point> *points, MapData::PointCache *cache, QMutex *cacheLock)
{ {
SubFile::Handle *rgnHdl = 0, *lblHdl = 0; SubFile::Handle *rgnHdl = 0, *lblHdl = 0;
lock->lock(); _lock.lock();
if (_loaded < 0) { if (_loaded < 0) {
lock->unlock(); _lock.unlock();
return; return;
} }
if (!_loaded) { if (!_loaded) {
rgnHdl = new SubFile::Handle(_rgn); rgnHdl = new SubFile::Handle(file, _rgn);
lblHdl = new SubFile::Handle(_lbl); lblHdl = new SubFile::Handle(file, _lbl);
SubFile::Handle nodHdl(_nod); SubFile::Handle nodHdl(file, _nod);
SubFile::Handle netHdl(_net); SubFile::Handle netHdl(file, _net);
if (!load(*rgnHdl, *lblHdl, netHdl, nodHdl)) { if (!load(*rgnHdl, *lblHdl, netHdl, nodHdl)) {
lock->unlock(); _lock.unlock();
delete rgnHdl; delete lblHdl; delete rgnHdl; delete lblHdl;
return; return;
} }
} }
QList<SubDiv*> subdivs = _tre->subdivs(rect, zoom); QList<SubDiv*> subdivs = _tre->subdivs(file, rect, zoom);
cacheLock->lock();
for (int i = 0; i < subdivs.size(); i++) { for (int i = 0; i < subdivs.size(); i++) {
SubDiv *subdiv = subdivs.at(i); SubDiv *subdiv = subdivs.at(i);
QList<MapData::Point> *pl = cache->object(subdiv); QList<MapData::Point> *pl = cache->object(subdiv);
if (!pl) { if (!pl) {
cacheLock->unlock();
if (!rgnHdl) { if (!rgnHdl) {
rgnHdl = new SubFile::Handle(_rgn); rgnHdl = new SubFile::Handle(file, _rgn);
lblHdl = new SubFile::Handle(_lbl); lblHdl = new SubFile::Handle(file, _lbl);
} }
if (!subdiv->initialized() && !_rgn->subdivInit(*rgnHdl, subdiv)) if (!subdiv->initialized() && !_rgn->subdivInit(*rgnHdl, subdiv)) {
cacheLock->lock();
continue; continue;
}
pl = new QList<MapData::Point>; pl = new QList<MapData::Point>;
@ -248,34 +264,36 @@ void VectorTile::points(const RectC &rect, const Zoom &zoom,
copyPoints(rect, pl, points); copyPoints(rect, pl, points);
cacheLock->lock();
cache->insert(subdiv, pl); cache->insert(subdiv, pl);
} else } else
copyPoints(rect, pl, points); copyPoints(rect, pl, points);
} }
lock->unlock(); cacheLock->unlock();
_lock.unlock();
delete rgnHdl; delete lblHdl; delete rgnHdl; delete lblHdl;
} }
void VectorTile::elevations(const RectC &rect, const Zoom &zoom, void VectorTile::elevations(QFile *file, const RectC &rect, const Zoom &zoom,
QList<MapData::Elevation> *elevations, MapData::ElevationCache *cache, QList<MapData::Elevation> *elevations, MapData::ElevationCache *cache,
QMutex *lock) QMutex *cacheLock)
{ {
SubFile::Handle *hdl = 0; SubFile::Handle *hdl = 0;
lock->lock(); _demLock.lock();
if (_demLoaded < 0) { if (_demLoaded < 0) {
lock->unlock(); _demLock.unlock();
return; return;
} }
if (!_demLoaded) { if (!_demLoaded) {
hdl = new SubFile::Handle(_dem); hdl = new SubFile::Handle(file, _dem);
if (!loadDem(*hdl)) { if (!loadDem(*hdl)) {
lock->unlock(); _demLock.unlock();
delete hdl; delete hdl;
return; return;
} }
@ -285,19 +303,25 @@ void VectorTile::elevations(const RectC &rect, const Zoom &zoom,
// the given zoom (we prefer rendering quality rather than speed). For // the given zoom (we prefer rendering quality rather than speed). For
// maps with a single level this has no effect. // maps with a single level this has no effect.
int level = qMax(0, _dem->level(zoom) - 1); int level = qMax(0, _dem->level(zoom) - 1);
QList<const DEMTile*> tiles(_dem->tiles(rect, level)); QList<const DEMTile*> tiles(_dem->tiles(rect, level));
cacheLock->lock();
for (int i = 0; i < tiles.size(); i++) { for (int i = 0; i < tiles.size(); i++) {
const DEMTile *tile = tiles.at(i); const DEMTile *tile = tiles.at(i);
MapData::Elevation *el = cache->object(tile);
MapData::Elevation *el = cache->object(tile);
if (!el) { if (!el) {
cacheLock->unlock();
if (!hdl) if (!hdl)
hdl = new SubFile::Handle(_dem); hdl = new SubFile::Handle(file, _dem);
el = _dem->elevations(*hdl, level, tile); el = _dem->elevations(*hdl, level, tile);
if (!el->m.isNull()) if (!el->m.isNull())
elevations->append(*el); elevations->append(*el);
cacheLock->lock();
cache->insert(tile, el); cache->insert(tile, el);
} else { } else {
if (!el->m.isNull()) if (!el->m.isNull())
@ -305,7 +329,8 @@ void VectorTile::elevations(const RectC &rect, const Zoom &zoom,
} }
} }
lock->unlock(); cacheLock->unlock();
_demLock.unlock();
delete hdl; delete hdl;
} }

View File

@ -21,7 +21,7 @@ public:
delete _dem; delete _gmp; delete _dem; delete _gmp;
} }
bool init(); bool init(QFile *file);
void clear(); void clear();
const RectC &bounds() const {return _tre->bounds();} const RectC &bounds() const {return _tre->bounds();}
@ -30,14 +30,15 @@ public:
SubFile *file(SubFile::Type type); SubFile *file(SubFile::Type type);
void polys(const RectC &rect, const Zoom &zoom, void polys(QFile *file, const RectC &rect, const Zoom &zoom,
QList<MapData::Poly> *polygons, QList<MapData::Poly> *lines, QList<MapData::Poly> *polygons, QList<MapData::Poly> *lines,
MapData::PolyCache *cache, QMutex *lock); MapData::PolyCache *cache, QMutex *cacheLock);
void points(const RectC &rect, const Zoom &zoom, void points(QFile *file, const RectC &rect, const Zoom &zoom,
QList<MapData::Point> *points, MapData::PointCache *cache, QMutex *lock); QList<MapData::Point> *points, MapData::PointCache *cache,
void elevations(const RectC &rect, const Zoom &zoom, QMutex *cacheLock);
void elevations(QFile *file, const RectC &rect, const Zoom &zoom,
QList<MapData::Elevation> *elevations, MapData::ElevationCache *cache, QList<MapData::Elevation> *elevations, MapData::ElevationCache *cache,
QMutex *lock); QMutex *cacheLock);
static bool isTileFile(SubFile::Type type) static bool isTileFile(SubFile::Type type)
{ {
@ -78,7 +79,7 @@ public:
} }
private: private:
bool initGMP(); bool initGMP(QFile *file);
bool load(SubFile::Handle &rgnHdl, SubFile::Handle &lblHdl, bool load(SubFile::Handle &rgnHdl, SubFile::Handle &lblHdl,
SubFile::Handle &netHdl, SubFile::Handle &nodHdl); SubFile::Handle &netHdl, SubFile::Handle &nodHdl);
bool loadDem(SubFile::Handle &demHdl); bool loadDem(SubFile::Handle &demHdl);
@ -92,6 +93,7 @@ private:
SubFile *_gmp; SubFile *_gmp;
int _loaded, _demLoaded; int _loaded, _demLoaded;
QMutex _lock, _demLock;
}; };
} }

View File

@ -276,7 +276,7 @@ double IMGMap::elevation(const Coordinates &c)
if (d->hasDEM()) { if (d->hasDEM()) {
QList<MapData::Elevation> tiles; QList<MapData::Elevation> tiles;
d->elevations(RectC(c, Coordinates(c.lon() + DELTA, c.lat() - DELTA)), d->elevations(0, RectC(c, Coordinates(c.lon() + DELTA, c.lat() - DELTA)),
d->zooms().max(), &tiles); d->zooms().max(), &tiles);
DEMTree tree(tiles); DEMTree tree(tiles);

View File

@ -219,10 +219,9 @@ bool MapData::readTags(SubFile &subfile, int count,
return true; return true;
} }
bool MapData::readSubFiles() bool MapData::readSubFiles(QFile &file)
{ {
/* both _pointFile and _pathFile can be used here */ QDataStream stream(&file);
QDataStream stream(&_pointFile);
for (int i = 0; i < _subFiles.size(); i++) { for (int i = 0; i < _subFiles.size(); i++) {
const SubFileInfo &f = _subFiles.at(i); const SubFileInfo &f = _subFiles.at(i);
@ -422,8 +421,7 @@ bool MapData::readHeader(QFile &file)
return true; return true;
} }
MapData::MapData(const QString &fileName) MapData::MapData(const QString &fileName) : _fileName(fileName), _valid(false)
: _pointFile(fileName), _pathFile(fileName), _valid(false)
{ {
QFile file(fileName); QFile file(fileName);
@ -435,8 +433,8 @@ MapData::MapData(const QString &fileName)
if (!readHeader(file)) if (!readHeader(file))
return; return;
_pathCache.setMaxCost(1024); _pathCache.setMaxCost(2048);
_pointCache.setMaxCost(1024); _pointCache.setMaxCost(2048);
_valid = true; _valid = true;
} }
@ -460,17 +458,13 @@ RectC MapData::bounds() const
void MapData::load() void MapData::load()
{ {
_pointFile.open(QIODevice::ReadOnly | QIODevice::Unbuffered); QFile file(_fileName);
_pathFile.open(QIODevice::ReadOnly | QIODevice::Unbuffered); if (file.open(QIODevice::ReadOnly | QIODevice::Unbuffered))
readSubFiles(file);
readSubFiles();
} }
void MapData::clear() void MapData::clear()
{ {
_pointFile.close();
_pathFile.close();
_pathCache.clear(); _pathCache.clear();
_pointCache.clear(); _pointCache.clear();
@ -494,14 +488,14 @@ void MapData::clearTiles()
bool MapData::pathCb(VectorTile *tile, void *context) bool MapData::pathCb(VectorTile *tile, void *context)
{ {
PathCTX *ctx = (PathCTX*)context; PathCTX *ctx = (PathCTX*)context;
ctx->data->paths(tile, ctx->rect, ctx->zoom, ctx->list); ctx->data->paths(ctx->file, tile, ctx->rect, ctx->zoom, ctx->list);
return true; return true;
} }
bool MapData::pointCb(VectorTile *tile, void *context) bool MapData::pointCb(VectorTile *tile, void *context)
{ {
PointCTX *ctx = (PointCTX*)context; PointCTX *ctx = (PointCTX*)context;
ctx->data->points(tile, ctx->rect, ctx->zoom, ctx->list); ctx->data->points(ctx->file, tile, ctx->rect, ctx->zoom, ctx->list);
return true; return true;
} }
@ -514,13 +508,14 @@ int MapData::level(int zoom) const
return _subFiles.size() - 1; return _subFiles.size() - 1;
} }
void MapData::points(const RectC &rect, int zoom, QList<Point> *list) void MapData::points(QFile &file, const RectC &rect, int zoom,
QList<Point> *list)
{ {
if (!rect.isValid()) if (!rect.isValid())
return; return;
int l(level(zoom)); int l(level(zoom));
PointCTX ctx(this, rect, zoom, list); PointCTX ctx(file, this, rect, zoom, list);
double min[2], max[2]; double min[2], max[2];
min[0] = rect.left(); min[0] = rect.left();
@ -531,53 +526,58 @@ void MapData::points(const RectC &rect, int zoom, QList<Point> *list)
_tiles.at(l)->Search(min, max, pointCb, &ctx); _tiles.at(l)->Search(min, max, pointCb, &ctx);
} }
void MapData::points(const VectorTile *tile, const RectC &rect, int zoom, void MapData::points(QFile &file, VectorTile *tile, const RectC &rect,
QList<Point> *list) int zoom, QList<Point> *list)
{ {
Key key(tile, zoom); Key key(tile, zoom);
_pointLock.lock(); tile->lock.lock();
_pointCacheLock.lock();
QList<Point> *tilePoints = _pointCache.object(key); QList<Point> *tilePoints = _pointCache.object(key);
if (!tilePoints) { if (!tilePoints) {
_pointCacheLock.unlock();
QList<Point> *p = new QList<Point>(); QList<Point> *p = new QList<Point>();
if (readPoints(tile, zoom, p)) { if (readPoints(file, tile, zoom, p)) {
copyPoints(rect, p, list); copyPoints(rect, p, list);
_pointCacheLock.lock();
_pointCache.insert(key, p); _pointCache.insert(key, p);
_pointCacheLock.unlock();
} else } else
delete p; delete p;
} else } else {
copyPoints(rect, tilePoints, list); copyPoints(rect, tilePoints, list);
_pointCacheLock.unlock();
}
_pointLock.unlock(); _pathCacheLock.lock();
_pathLock.lock();
QList<Path> *tilePaths = _pathCache.object(key); QList<Path> *tilePaths = _pathCache.object(key);
if (!tilePaths) { if (!tilePaths) {
_pathCacheLock.unlock();
QList<Path> *p = new QList<Path>(); QList<Path> *p = new QList<Path>();
if (readPaths(tile, zoom, p)) { if (readPaths(file, tile, zoom, p)) {
copyPoints(rect, p, list); copyPoints(rect, p, list);
_pathCacheLock.lock();
_pathCache.insert(key, p); _pathCache.insert(key, p);
_pathCacheLock.unlock();
} else } else
delete p; delete p;
} else } else {
copyPoints(rect, tilePaths, list); copyPoints(rect, tilePaths, list);
_pathCacheLock.unlock();
}
_pathLock.unlock(); tile->lock.unlock();
} }
void MapData::paths(const RectC &searchRect, const RectC &boundsRect, int zoom, void MapData::paths(QFile &file, const RectC &searchRect,
QList<Path> *list) const RectC &boundsRect, int zoom, QList<Path> *list)
{ {
if (!searchRect.isValid()) if (!searchRect.isValid())
return; return;
int l(level(zoom)); int l(level(zoom));
PathCTX ctx(this, boundsRect, zoom, list); PathCTX ctx(file, this, boundsRect, zoom, list);
double min[2], max[2]; double min[2], max[2];
min[0] = searchRect.left(); min[0] = searchRect.left();
@ -588,32 +588,38 @@ void MapData::paths(const RectC &searchRect, const RectC &boundsRect, int zoom,
_tiles.at(l)->Search(min, max, pathCb, &ctx); _tiles.at(l)->Search(min, max, pathCb, &ctx);
} }
void MapData::paths(const VectorTile *tile, const RectC &rect, int zoom, void MapData::paths(QFile &file, VectorTile *tile, const RectC &rect, int zoom,
QList<Path> *list) QList<Path> *list)
{ {
Key key(tile, zoom); Key key(tile, zoom);
_pathLock.lock(); tile->lock.lock();
_pathCacheLock.lock();
QList<Path> *cached = _pathCache.object(key); QList<Path> *cached = _pathCache.object(key);
if (!cached) { if (!cached) {
_pathCacheLock.unlock();
QList<Path> *p = new QList<Path>(); QList<Path> *p = new QList<Path>();
if (readPaths(tile, zoom, p)) { if (readPaths(file, tile, zoom, p)) {
copyPaths(rect, p, list); copyPaths(rect, p, list);
_pathCacheLock.lock();
_pathCache.insert(key, p); _pathCache.insert(key, p);
_pathCacheLock.unlock();
} else } else
delete p; delete p;
} else } else {
copyPaths(rect, cached, list); copyPaths(rect, cached, list);
_pathCacheLock.unlock();
}
_pathLock.unlock(); tile->lock.unlock();
} }
bool MapData::readPaths(const VectorTile *tile, int zoom, QList<Path> *list) bool MapData::readPaths(QFile &file, const VectorTile *tile, int zoom,
QList<Path> *list)
{ {
const SubFileInfo &info = _subFiles.at(level(zoom)); const SubFileInfo &info = _subFiles.at(level(zoom));
SubFile subfile(_pathFile, info.offset, info.size); SubFile subfile(file, info.offset, info.size);
int rows = info.max - info.min + 1; int rows = info.max - info.min + 1;
QVector<unsigned> paths(rows); QVector<unsigned> paths(rows);
quint32 blocks, unused, val, cnt = 0; quint32 blocks, unused, val, cnt = 0;
@ -698,10 +704,11 @@ bool MapData::readPaths(const VectorTile *tile, int zoom, QList<Path> *list)
return true; return true;
} }
bool MapData::readPoints(const VectorTile *tile, int zoom, QList<Point> *list) bool MapData::readPoints(QFile &file, const VectorTile *tile, int zoom,
QList<Point> *list)
{ {
const SubFileInfo &info = _subFiles.at(level(zoom)); const SubFileInfo &info = _subFiles.at(level(zoom));
SubFile subfile(_pointFile, info.offset, info.size); SubFile subfile(file, info.offset, info.size);
int rows = info.max - info.min + 1; int rows = info.max - info.min + 1;
QVector<unsigned> points(rows); QVector<unsigned> points(rows);
quint32 val, unused, cnt = 0; quint32 val, unused, cnt = 0;

View File

@ -58,14 +58,15 @@ public:
{return point.layer < other.point.layer;} {return point.layer < other.point.layer;}
}; };
const QString &fileName() const {return _fileName;}
RectC bounds() const; RectC bounds() const;
Range zooms() const Range zooms() const
{return Range(_subFiles.first().min, _subFiles.last().max);} {return Range(_subFiles.first().min, _subFiles.last().max);}
int tileSize() const {return _tileSize;} int tileSize() const {return _tileSize;}
void points(const RectC &rect, int zoom, QList<Point> *list); void points(QFile &file, const RectC &rect, int zoom, QList<Point> *list);
void paths(const RectC &searchRect, const RectC &boundsRect, int zoom, void paths(QFile &file, const RectC &searchRect, const RectC &boundsRect,
QList<Path> *set); int zoom, QList<Path> *set);
unsigned tagId(const QByteArray &name) const {return _keys.value(name);} unsigned tagId(const QByteArray &name) const {return _keys.value(name);}
void load(); void load();
@ -89,12 +90,15 @@ private:
size_t offset; size_t offset;
Coordinates pos; Coordinates pos;
QMutex lock;
}; };
struct PathCTX { struct PathCTX {
PathCTX(MapData *data, const RectC &rect, int zoom, QList<Path> *list) PathCTX(QFile &file, MapData *data, const RectC &rect, int zoom,
: data(data), rect(rect), zoom(zoom), list(list) {} QList<Path> *list)
: file(file), data(data), rect(rect), zoom(zoom), list(list) {}
QFile &file;
MapData *data; MapData *data;
const RectC &rect; const RectC &rect;
int zoom; int zoom;
@ -102,9 +106,11 @@ private:
}; };
struct PointCTX { struct PointCTX {
PointCTX(MapData *data, const RectC &rect, int zoom, QList<Point> *list) PointCTX(QFile &file, MapData *data, const RectC &rect, int zoom,
: data(data), rect(rect), zoom(zoom), list(list) {} QList<Point> *list)
: file(file), data(data), rect(rect), zoom(zoom), list(list) {}
QFile &file;
MapData *data; MapData *data;
const RectC &rect; const RectC &rect;
int zoom; int zoom;
@ -143,16 +149,18 @@ private:
bool readTagInfo(SubFile &hdr, QVector<TagSource> &tags); bool readTagInfo(SubFile &hdr, QVector<TagSource> &tags);
bool readMapInfo(SubFile &hdr, QByteArray &projection, bool &debugMap); bool readMapInfo(SubFile &hdr, QByteArray &projection, bool &debugMap);
bool readHeader(QFile &file); bool readHeader(QFile &file);
bool readSubFiles(); bool readSubFiles(QFile &file);
void clearTiles(); void clearTiles();
int level(int zoom) const; int level(int zoom) const;
void paths(const VectorTile *tile, const RectC &rect, int zoom, void paths(QFile &file, VectorTile *tile, const RectC &rect, int zoom,
QList<Path> *list); QList<Path> *list);
void points(const VectorTile *tile, const RectC &rect, int zoom, void points(QFile &file, VectorTile *tile, const RectC &rect, int zoom,
QList<Point> *list);
bool readPaths(QFile &file, const VectorTile *tile, int zoom,
QList<Path> *list);
bool readPoints(QFile &file, const VectorTile *tile, int zoom,
QList<Point> *list); QList<Point> *list);
bool readPaths(const VectorTile *tile, int zoom, QList<Path> *list);
bool readPoints(const VectorTile *tile, int zoom, QList<Point> *list);
static bool readTags(SubFile &subfile, int count, static bool readTags(SubFile &subfile, int count,
const QVector<TagSource> &tags, QVector<Tag> &list); const QVector<TagSource> &tags, QVector<Tag> &list);
@ -161,7 +169,7 @@ private:
friend HASH_T qHash(const MapData::Key &key); friend HASH_T qHash(const MapData::Key &key);
QFile _pointFile, _pathFile; QString _fileName;
RectC _bounds; RectC _bounds;
quint16 _tileSize; quint16 _tileSize;
QVector<SubFileInfo> _subFiles; QVector<SubFileInfo> _subFiles;
@ -171,7 +179,7 @@ private:
QCache<Key, QList<Path> > _pathCache; QCache<Key, QList<Path> > _pathCache;
QCache<Key, QList<Point> > _pointCache; QCache<Key, QList<Point> > _pointCache;
QMutex _pathLock, _pointLock; QMutex _pathCacheLock, _pointCacheLock;
bool _valid; bool _valid;
QString _errorString; QString _errorString;

View File

@ -85,7 +85,7 @@ void RasterTile::processLabels(const QList<MapData::Point> &points,
const MapData::Point &point = points.at(i); const MapData::Point &point = points.at(i);
const Style::TextRender *ti = 0; const Style::TextRender *ti = 0;
const Style::Symbol *si = 0; const Style::Symbol *si = 0;
const QByteArray *lbl = 0; QList<const QByteArray *> ll;
for (int j = 0; j < symbols.size(); j++) { for (int j = 0; j < symbols.size(); j++) {
const Style::Symbol *ri = symbols.at(j); const Style::Symbol *ri = symbols.at(j);
@ -98,17 +98,23 @@ void RasterTile::processLabels(const QList<MapData::Point> &points,
for (int j = 0; j < labels.size(); j++) { for (int j = 0; j < labels.size(); j++) {
const Style::TextRender *ri = labels.at(j); const Style::TextRender *ri = labels.at(j);
if (ri->rule().match(point.center(), point.tags)) { if (ri->rule().match(point.center(), point.tags)) {
if ((lbl = label(ri->key(), point.tags))) { const QByteArray *lbl = label(ri->key(), point.tags);
if (!si || si->id() == ri->symbolId()) { if (lbl) {
if (!si) {
ti = ri; ti = ri;
ll.append(lbl);
break; break;
} else if (si->id() == ri->symbolId()) {
if (!ti)
ti = ri;
ll.append(lbl);
} }
} }
} }
} }
if (ti || si) if (ti || si)
items.append(Label(&point, lbl, si, ti)); items.append(Label(&point, ll, si, ti));
} }
std::sort(items.begin(), items.end()); std::sort(items.begin(), items.end());
@ -231,8 +237,13 @@ void RasterTile::processLineLabels(const QVector<PainterPath> &paths,
void RasterTile::drawTextItems(QPainter *painter, void RasterTile::drawTextItems(QPainter *painter,
const QList<TextItem*> &textItems) const QList<TextItem*> &textItems)
{ {
for (int i = 0; i < textItems.size(); i++) QRectF rect(_rect);
textItems.at(i)->paint(painter);
for (int i = 0; i < textItems.size(); i++) {
const TextItem *ti = textItems.at(i);
if (rect.intersects(ti->boundingRect()))
ti->paint(painter);
}
} }
QPainterPath RasterTile::painterPath(const Polygon &polygon, bool curve) const QPainterPath RasterTile::painterPath(const Polygon &polygon, bool curve) const
@ -397,6 +408,10 @@ void RasterTile::fetchData(QList<MapData::Path> &paths,
QList<MapData::Point> &points) const QList<MapData::Point> &points) const
{ {
QPoint ttl(_rect.topLeft()); QPoint ttl(_rect.topLeft());
QFile file(_data->fileName());
if (!file.open(QIODevice::ReadOnly | QIODevice::Unbuffered))
return;
QRectF pathRect(QPointF(ttl.x() - PATHS_EXTENT, ttl.y() - PATHS_EXTENT), QRectF pathRect(QPointF(ttl.x() - PATHS_EXTENT, ttl.y() - PATHS_EXTENT),
QPointF(ttl.x() + _rect.width() + PATHS_EXTENT, ttl.y() + _rect.height() QPointF(ttl.x() + _rect.width() + PATHS_EXTENT, ttl.y() + _rect.height()
@ -408,15 +423,15 @@ void RasterTile::fetchData(QList<MapData::Path> &paths,
_transform.img2proj(pathRect.bottomRight())); _transform.img2proj(pathRect.bottomRight()));
RectD searchRectD(_transform.img2proj(searchRect.topLeft()), RectD searchRectD(_transform.img2proj(searchRect.topLeft()),
_transform.img2proj(searchRect.bottomRight())); _transform.img2proj(searchRect.bottomRight()));
_data->paths(searchRectD.toRectC(_proj, 20), pathRectD.toRectC(_proj, 20), _data->paths(file, searchRectD.toRectC(_proj, 20),
_zoom, &paths); pathRectD.toRectC(_proj, 20), _zoom, &paths);
QRectF pointRect(QPointF(ttl.x() - TEXT_EXTENT, ttl.y() - TEXT_EXTENT), QRectF pointRect(QPointF(ttl.x() - TEXT_EXTENT, ttl.y() - TEXT_EXTENT),
QPointF(ttl.x() + _rect.width() + TEXT_EXTENT, ttl.y() + _rect.height() QPointF(ttl.x() + _rect.width() + TEXT_EXTENT, ttl.y() + _rect.height()
+ TEXT_EXTENT)); + TEXT_EXTENT));
RectD pointRectD(_transform.img2proj(pointRect.topLeft()), RectD pointRectD(_transform.img2proj(pointRect.topLeft()),
_transform.img2proj(pointRect.bottomRight())); _transform.img2proj(pointRect.bottomRight()));
_data->points(pointRectD.toRectC(_proj, 20), _zoom, &points); _data->points(file, pointRectD.toRectC(_proj, 20), _zoom, &points);
} }
MatrixD RasterTile::elevation(int extend) const MatrixD RasterTile::elevation(int extend) const

View File

@ -44,9 +44,9 @@ private:
}; };
struct Label { struct Label {
Label(const MapData::Point *p, const QByteArray *lbl, Label(const MapData::Point *p, const QList<const QByteArray *> lbl,
const Style::Symbol *si, const Style::TextRender *ti) const Style::Symbol *si, const Style::TextRender *ti)
: point(p), lbl(lbl), ti(ti), si(si) : point(p), ti(ti), si(si), lbl(lbl)
{ {
Q_ASSERT(si || ti); Q_ASSERT(si || ti);
} }
@ -61,9 +61,9 @@ private:
int priority() const {return si ? si->priority() : ti->priority();} int priority() const {return si ? si->priority() : ti->priority();}
const MapData::Point *point; const MapData::Point *point;
const QByteArray *lbl;
const Style::TextRender *ti; const Style::TextRender *ti;
const Style::Symbol *si; const Style::Symbol *si;
QList<const QByteArray *> lbl;
}; };
struct LineLabel { struct LineLabel {
@ -170,15 +170,28 @@ private:
class PointItem : public TextPointItem class PointItem : public TextPointItem
{ {
public: public:
PointItem(const QPoint &point, const QByteArray *label, PointItem(const QPoint &point, const QList<const QByteArray *> &lbl,
const QFont *font, const QImage *img, const QColor *color, const QFont *font, const QImage *img, const QColor *color,
const QColor *haloColor) : TextPointItem(point, const QColor *haloColor) : TextPointItem(point, label(lbl),
label ? new QString(*label) : 0, font, img, color, haloColor, 0) {} font, img, color, haloColor, 0) {}
PointItem(const QPoint &point, const QByteArray *label, PointItem(const QPoint &point, const QByteArray *label,
const QFont *font, const QColor *color, const QColor *bgColor) const QFont *font, const QColor *color, const QColor *bgColor)
: TextPointItem(point, label ? new QString(*label) : 0, font, 0, : TextPointItem(point, label ? new QString(*label) : 0, font, 0,
color, 0, bgColor) {} color, 0, bgColor) {}
~PointItem() {delete _text;} ~PointItem() {delete _text;}
private:
static QString *label(const QList<const QByteArray*> &ll)
{
if (ll.isEmpty())
return 0;
QString *ret = new QString(*ll.first());
for (int i = 1; i < ll.size(); i++)
ret->append("\n" + *ll.at(i));
return ret;
}
}; };
class PathItem : public TextPathItem class PathItem : public TextPathItem