Compare commits
28 Commits
Author | SHA1 | Date | |
---|---|---|---|
80a8ac260d | |||
6673281e1c | |||
30157f8e4a | |||
12e3bbc988 | |||
9d5ac81f2f | |||
c0f97ddbd4 | |||
d7d193871a | |||
4b9bb04cec | |||
d3889b6dfe | |||
240ddaf39c | |||
53685253d7 | |||
38486e594b | |||
47dd212f47 | |||
a11ba0487c | |||
c014526bd9 | |||
f620bbc383 | |||
9ac10e2909 | |||
5f623975f9 | |||
bd266ea73c | |||
6774e29d3f | |||
a02f157bd8 | |||
4bad7c9b46 | |||
93402dd4cd | |||
f6dcf43c1a | |||
7452650999 | |||
863f6ac58f | |||
a57b50e07c | |||
450b8aad59 |
@ -1,4 +1,4 @@
|
||||
version: 13.32.{build}
|
||||
version: 13.33.{build}
|
||||
|
||||
configuration:
|
||||
- Release
|
||||
@ -12,7 +12,7 @@ environment:
|
||||
- QTDIR: C:\Qt\5.15\msvc2019_64
|
||||
OPENSSLDIR: C:\OpenSSL-v111-Win64\bin
|
||||
NSISDEF: /DOPENSSL /DANGLE
|
||||
- QTDIR: C:\Qt\6.7\msvc2019_64
|
||||
- QTDIR: C:\Qt\6.8\msvc2019_64
|
||||
OPENSSLDIR: C:\OpenSSL-v33-Win64\bin
|
||||
NSISDEF: /DQT6 /DOPENSSL
|
||||
|
||||
|
@ -21,7 +21,7 @@
|
||||
</rule>
|
||||
|
||||
<rule e="way" closed="yes" k="natural" v="rock|stone|bare_rock|bedrock" zoom-min="14">
|
||||
<area fill="#60000000"/>
|
||||
<area fill="#96968f"/>
|
||||
</rule>
|
||||
<rule e="way" closed="yes" k="natural" v="glacier" zoom-min="10">
|
||||
<area fill="#ddf1fd"/>
|
||||
@ -32,7 +32,7 @@
|
||||
<area fill="#e4efcf"/>
|
||||
</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"/>
|
||||
</rule>
|
||||
<rule e="way" closed="yes" k="landuse" v="allotments" zoom-min="10">
|
||||
@ -173,21 +173,28 @@
|
||||
</rule>
|
||||
<rule e="way" closed="yes" k="amenity" v="parking" zoom-min="10">
|
||||
<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"/>
|
||||
</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 e="way" closed="yes" k="highway" v="pedestrian" zoom-min="10">
|
||||
<area fill="#ffffff"/>
|
||||
</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"/>
|
||||
</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"/>
|
||||
</rule>
|
||||
<rule e="way" k="leisure" v="track" zoom-min="10">
|
||||
<line stroke="#e3edc6" stroke-width="1"/>
|
||||
<rule e="way" closed="yes" k="amenity" v="fountain" zoom-min="12">
|
||||
<area fill="#9fc4e1"/>
|
||||
</rule>
|
||||
|
||||
<!-- Area overlays -->
|
||||
@ -586,14 +593,25 @@
|
||||
<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 -->
|
||||
<rule e="node" k="natural" v="peak" zoom-min="13">
|
||||
<rule e="node" k="name" v="*">
|
||||
<symbol id="peak" src=":/POI/mountain-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 e="node" k="ele" v="*">
|
||||
<rule e="node" k="name" v="*">
|
||||
<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>
|
||||
@ -829,7 +847,7 @@
|
||||
<caption fill="#000000" font-size="10" font-style="italic" k="name" stroke="#FFFFFF" stroke-width="2" symbol-id="post"/>
|
||||
</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"/>
|
||||
<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"/>
|
||||
@ -862,7 +880,7 @@
|
||||
<caption fill="#000000" font-size="10" font-style="italic" k="name" stroke="#FFFFFF" stroke-width="2" symbol-id="townhall"/>
|
||||
</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"/>
|
||||
<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"/>
|
||||
@ -937,6 +955,36 @@
|
||||
<caption fill="#000000" font-size="10" font-style="italic" k="name" stroke="#FFFFFF" stroke-width="2" symbol-id="skateboard"/>
|
||||
</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">
|
||||
<symbol id="restaurant" src=":/POI/restaurant-11.svg" symbol-width="11" priority="-5"/>
|
||||
@ -1047,9 +1095,36 @@
|
||||
</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" priority="-5"/>
|
||||
<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>
|
||||
|
@ -3,7 +3,7 @@ unix:!macx:!android {
|
||||
} else {
|
||||
TARGET = GPXSee
|
||||
}
|
||||
VERSION = 13.32
|
||||
VERSION = 13.33
|
||||
|
||||
|
||||
QT += core \
|
||||
|
11
gpxsee.qrc
@ -8,6 +8,7 @@
|
||||
<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="cross.svg">icons/map/symbols/cross.svg</file>
|
||||
<file alias="exit.svg">icons/map/symbols/exit.svg</file>
|
||||
<file alias="flow.svg">icons/map/symbols/flow.svg</file>
|
||||
<file alias="oneway.svg">icons/map/symbols/oneway.svg</file>
|
||||
@ -24,6 +25,8 @@
|
||||
<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="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="beach-11.svg">icons/map/POI/beach-11.svg</file>
|
||||
<file alias="beer-11.svg">icons/map/POI/beer-11.svg</file>
|
||||
@ -45,9 +48,11 @@
|
||||
<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="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="dam-11.svg">icons/map/POI/dam-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="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>
|
||||
@ -67,6 +72,7 @@
|
||||
<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="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="hot-spring.svg">icons/map/POI/hot-spring.svg</file>
|
||||
<file alias="ice-cream-11.svg">icons/map/POI/ice-cream-11.svg</file>
|
||||
@ -82,6 +88,7 @@
|
||||
<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="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="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>
|
||||
@ -104,6 +111,7 @@
|
||||
<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="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="stadium-11.svg">icons/map/POI/stadium-11.svg</file>
|
||||
<file alias="swimming-11.svg">icons/map/POI/swimming-11.svg</file>
|
||||
@ -112,9 +120,12 @@
|
||||
<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="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="village-11.svg">icons/map/POI/village-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="waterfall-11.svg">icons/map/POI/waterfall-11.svg</file>
|
||||
<file alias="watermill-11.svg">icons/map/POI/watermill-11.svg</file>
|
||||
|
4
icons/map/POI/baseball-11.svg
Normal 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
	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
	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
	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
	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
	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 |
4
icons/map/POI/basketball-11.svg
Normal 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 |
4
icons/map/POI/cricket-11.svg
Normal 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
	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
	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
	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
	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
	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
	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
	C8.9339,8.2391,8.8392,8.0837,8.69,8z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 1.1 KiB |
4
icons/map/POI/defibrillator-11.svg
Normal 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 |
4
icons/map/POI/horse-riding-11.svg
Normal 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 |
4
icons/map/POI/parking-garage-11.svg
Normal 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
	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
	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
	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
	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
	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 |
6
icons/map/POI/slipway-11.svg
Normal 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 |
4
icons/map/POI/triangle-11.svg
Normal 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
	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
	l-4-6.6598C5.8787,1.3386,5.706,1.2375,5.5174,1.2315z"/>
|
||||
</svg>
|
After Width: | Height: | Size: 403 B |
4
icons/map/POI/triangle-stroked-11.svg
Normal 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
	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
	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 |
4
icons/map/POI/volleyball-11.svg
Normal 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 |
4
icons/map/symbols/cross.svg
Normal 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 |
@ -1,7 +1,7 @@
|
||||
<?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">
|
||||
<g>
|
||||
<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 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 "/>
|
||||
</g>
|
||||
<svg width="15" height="11" viewBox="0 0 15 11" version="1.1">
|
||||
<g stroke="none" fill="#000000">
|
||||
<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 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>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.6 KiB |
@ -587,7 +587,7 @@
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="487"/>
|
||||
<source>Show local DEM tiles</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Näytä paikalliset DEM-laatat</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="490"/>
|
||||
@ -699,7 +699,7 @@
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="695"/>
|
||||
<source>Layers</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Kerrokset</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="721"/>
|
||||
@ -850,12 +850,12 @@
|
||||
<message>
|
||||
<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>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>DEM-laattojen latausraja ylitetty. Jos todella tarvitset tietoja niin suurelta alueelta, lataa tiedostot manuaalisesti.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="2014"/>
|
||||
<source>Could not download all required DEM files.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Kaikkia vaadittuja DEM-tiedostoja ei voitu ladata.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="2048"/>
|
||||
@ -898,12 +898,12 @@
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="476"/>
|
||||
<source>Download data DEM</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Lataa data-DEM</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="482"/>
|
||||
<source>Download map DEM</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Lataa kartta-DEM</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="762"/>
|
||||
@ -961,7 +961,7 @@
|
||||
<message>
|
||||
<location filename="../src/GUI/gui.cpp" line="1978"/>
|
||||
<source>Clear "%1" tile cache?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Tyhjennetäänkö "%1" ruutuvälimuisti?</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<location filename="../src/GUI/gui.cpp" line="2001"/>
|
||||
|
@ -37,7 +37,7 @@ Unicode true
|
||||
; The name of the installer
|
||||
Name "GPXSee"
|
||||
; Program version
|
||||
!define VERSION "13.32"
|
||||
!define VERSION "13.33"
|
||||
|
||||
; The file to write
|
||||
OutFile "GPXSee-${VERSION}_x64.exe"
|
||||
|
@ -6,31 +6,23 @@ bool AtlasData::pointCb(MapEntry *map, void *context)
|
||||
{
|
||||
PointCTX *ctx = (PointCTX*)context;
|
||||
|
||||
start:
|
||||
map->lock.lock();
|
||||
|
||||
ctx->cacheLock.lock();
|
||||
|
||||
MapData *cached = ctx->cache.object(map->path);
|
||||
|
||||
if (!cached) {
|
||||
ctx->cacheLock.unlock();
|
||||
|
||||
if (map->lock.tryLock()) {
|
||||
MapData *data = new MapData(map->path);
|
||||
data->points(ctx->rect, ctx->points);
|
||||
MapData *data = new MapData(map->path);
|
||||
data->points(ctx->rect, ctx->points);
|
||||
|
||||
ctx->cacheLock.lock();
|
||||
ctx->cache.insert(map->path, data);
|
||||
|
||||
map->lock.unlock();
|
||||
} else {
|
||||
map->lock.lock();
|
||||
map->lock.unlock();
|
||||
goto start;
|
||||
}
|
||||
ctx->cacheLock.lock();
|
||||
ctx->cache.insert(map->path, data);
|
||||
} else
|
||||
cached->points(ctx->rect, ctx->points);
|
||||
|
||||
ctx->cacheLock.unlock();
|
||||
map->lock.unlock();
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -39,34 +31,26 @@ bool AtlasData::polyCb(MapEntry *map, void *context)
|
||||
{
|
||||
PolyCTX *ctx = (PolyCTX*)context;
|
||||
|
||||
start:
|
||||
map->lock.lock();
|
||||
|
||||
ctx->cacheLock.lock();
|
||||
|
||||
MapData *cached = ctx->cache.object(map->path);
|
||||
|
||||
if (!cached) {
|
||||
ctx->cacheLock.unlock();
|
||||
|
||||
if (map->lock.tryLock()) {
|
||||
MapData *data = new MapData(map->path);
|
||||
data->polygons(ctx->rect, ctx->polygons);
|
||||
data->lines(ctx->rect, ctx->lines);
|
||||
MapData *data = new MapData(map->path);
|
||||
data->polygons(ctx->rect, ctx->polygons);
|
||||
data->lines(ctx->rect, ctx->lines);
|
||||
|
||||
ctx->cacheLock.lock();
|
||||
ctx->cache.insert(map->path, data);
|
||||
|
||||
map->lock.unlock();
|
||||
} else {
|
||||
map->lock.lock();
|
||||
map->lock.unlock();
|
||||
goto start;
|
||||
}
|
||||
ctx->cacheLock.lock();
|
||||
ctx->cache.insert(map->path, data);
|
||||
} else {
|
||||
cached->polygons(ctx->rect, ctx->polygons);
|
||||
cached->lines(ctx->rect, ctx->lines);
|
||||
}
|
||||
|
||||
ctx->cacheLock.unlock();
|
||||
map->lock.unlock();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -146,7 +146,7 @@ int DEMFile::level(const Zoom &zoom) const
|
||||
}
|
||||
|
||||
MapData::Elevation *DEMFile::elevations(Handle &hdl, int level,
|
||||
const DEMTile *tile)
|
||||
const DEMTile *tile) const
|
||||
{
|
||||
const Level &l = _levels.at(level);
|
||||
MapData::Elevation *ele = new MapData::Elevation();
|
||||
|
@ -16,7 +16,8 @@ public:
|
||||
|
||||
bool load(Handle &hdl);
|
||||
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;
|
||||
QList<const DEMTile *> tiles(const RectC &rect, int level) const;
|
||||
@ -44,7 +45,7 @@ private:
|
||||
QList<DEMTile> tiles;
|
||||
};
|
||||
|
||||
qint16 meters(qint16 val)
|
||||
qint16 meters(qint16 val) const
|
||||
{
|
||||
return (_flags & 1) ? (qint16)qRound(val * 0.3048) : val;
|
||||
}
|
||||
|
@ -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()));
|
||||
delete tile;
|
||||
return false;
|
||||
|
@ -29,11 +29,11 @@ static SubFile::Type tileType(const char str[3])
|
||||
return SubFile::Unknown;
|
||||
}
|
||||
|
||||
bool IMGData::readSubFileBlocks(QFile &file, quint64 offset, SubFile *subFile)
|
||||
bool IMGData::readSubFileBlocks(QFile *file, quint64 offset, SubFile *subFile)
|
||||
{
|
||||
quint16 block;
|
||||
|
||||
if (!file.seek(offset + 0x20))
|
||||
if (!file->seek(offset + 0x20))
|
||||
return false;
|
||||
for (int i = 0; i < 240; i++) {
|
||||
if (!readValue(file, block))
|
||||
@ -46,11 +46,11 @@ bool IMGData::readSubFileBlocks(QFile &file, quint64 offset, SubFile *subFile)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool IMGData::readIMGHeader(QFile &file)
|
||||
bool IMGData::readIMGHeader(QFile *file)
|
||||
{
|
||||
char signature[7], identifier[7];
|
||||
if (!(file.read((char*)&_key, 1) && file.seek(0x10)
|
||||
&& read(file, signature, sizeof(signature)) && file.seek(0x41)
|
||||
if (!(file->read((char*)&_key, 1) && file->seek(0x10)
|
||||
&& read(file, signature, sizeof(signature)) && file->seek(0x41)
|
||||
&& read(file, identifier, sizeof(identifier)))
|
||||
|| memcmp(signature, "DSKIMG", sizeof(signature))
|
||||
|| memcmp(identifier, "GARMIN", sizeof(identifier))) {
|
||||
@ -60,8 +60,8 @@ bool IMGData::readIMGHeader(QFile &file)
|
||||
|
||||
char d1[20], d2[31];
|
||||
quint8 e1, e2;
|
||||
if (!(file.seek(0x49) && read(file, d1, sizeof(d1)) && file.seek(0x61)
|
||||
&& readValue(file, e1) && readValue(file, e2) && file.seek(0x65)
|
||||
if (!(file->seek(0x49) && read(file, d1, sizeof(d1)) && file->seek(0x61)
|
||||
&& readValue(file, e1) && readValue(file, e2) && file->seek(0x65)
|
||||
&& read(file, d2, sizeof(d2)))) {
|
||||
_errorString = "Error reading IMG header";
|
||||
return false;
|
||||
@ -74,7 +74,7 @@ bool IMGData::readIMGHeader(QFile &file)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool IMGData::readFAT(QFile &file, TileMap &tileMap)
|
||||
bool IMGData::readFAT(QFile *file, TileMap &tileMap)
|
||||
{
|
||||
QByteArray typFile;
|
||||
quint8 flag;
|
||||
@ -82,7 +82,7 @@ bool IMGData::readFAT(QFile &file, TileMap &tileMap)
|
||||
|
||||
// Skip unused FAT blocks if any
|
||||
while (true) {
|
||||
if (!(file.seek(offset) && readValue(file, flag)))
|
||||
if (!(file->seek(offset) && readValue(file, flag)))
|
||||
return false;
|
||||
if (flag)
|
||||
break;
|
||||
@ -93,14 +93,14 @@ bool IMGData::readFAT(QFile &file, TileMap &tileMap)
|
||||
char name[8], type[3];
|
||||
quint32 size;
|
||||
quint16 part;
|
||||
if (!(file.seek(offset + 12) && readValue(file, size)))
|
||||
if (!(file->seek(offset + 12) && readValue(file, size)))
|
||||
return false;
|
||||
offset += 512;
|
||||
int cnt = (size - offset) / 512;
|
||||
|
||||
// Read FAT blocks describing the IMG sub-files
|
||||
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, type, sizeof(type)) && readValue(file, size)
|
||||
&& readValue(file, part)))
|
||||
@ -140,13 +140,13 @@ bool IMGData::readFAT(QFile &file, TileMap &tileMap)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool IMGData::createTileTree(const TileMap &tileMap)
|
||||
bool IMGData::createTileTree(QFile *file, const TileMap &tileMap)
|
||||
{
|
||||
for (TileMap::const_iterator it = tileMap.constBegin();
|
||||
it != tileMap.constEnd(); ++it) {
|
||||
VectorTile *tile = it.value();
|
||||
|
||||
if (!tile->init()) {
|
||||
if (!tile->init(file)) {
|
||||
qWarning("%s: %s: Invalid map tile", qPrintable(_fileName),
|
||||
qPrintable(it.key()));
|
||||
delete tile;
|
||||
@ -177,14 +177,14 @@ IMGData::IMGData(const QString &fileName) : MapData(fileName)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!readIMGHeader(file))
|
||||
if (!readIMGHeader(&file))
|
||||
return;
|
||||
if (!readFAT(file, tileMap)) {
|
||||
if (!readFAT(&file, tileMap)) {
|
||||
_errorString = "Error reading FAT data";
|
||||
qDeleteAll(tileMap);
|
||||
return;
|
||||
}
|
||||
if (!createTileTree(tileMap)) {
|
||||
if (!createTileTree(&file, tileMap)) {
|
||||
_errorString = "No usable map tile found";
|
||||
return;
|
||||
}
|
||||
@ -194,16 +194,16 @@ IMGData::IMGData(const QString &fileName) : MapData(fileName)
|
||||
_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)
|
||||
for (int i = 0; i < ret; i++)
|
||||
data[i] ^= _key;
|
||||
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;
|
||||
|
||||
@ -215,9 +215,9 @@ template<class T> bool IMGData::readValue(QFile &file, T &val) const
|
||||
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;
|
||||
if (read(file, data, 1ULL<<_blockBits) < (qint64)(1ULL<<_blockBits))
|
||||
return false;
|
||||
|
@ -13,17 +13,17 @@ public:
|
||||
IMGData(const QString &fileName);
|
||||
|
||||
unsigned blockBits() const {return _blockBits;}
|
||||
bool readBlock(QFile &file, int blockNum, char *data) const;
|
||||
bool readBlock(QFile *file, int blockNum, char *data) const;
|
||||
|
||||
private:
|
||||
typedef QMap<QByteArray, VectorTile*> TileMap;
|
||||
|
||||
qint64 read(QFile &file, char *data, qint64 maxSize) const;
|
||||
template<class T> bool readValue(QFile &file, T &val) const;
|
||||
bool readSubFileBlocks(QFile &file, quint64 offset, SubFile *subFile);
|
||||
bool readFAT(QFile &file, TileMap &tileMap);
|
||||
bool readIMGHeader(QFile &file);
|
||||
bool createTileTree(const TileMap &tileMap);
|
||||
qint64 read(QFile *file, char *data, qint64 maxSize) const;
|
||||
template<class T> bool readValue(QFile *file, T &val) const;
|
||||
bool readSubFileBlocks(QFile *file, quint64 offset, SubFile *subFile);
|
||||
bool readFAT(QFile *file, TileMap &tileMap);
|
||||
bool readIMGHeader(QFile *file);
|
||||
bool createTileTree(QFile *file, const TileMap &tileMap);
|
||||
|
||||
quint8 _key;
|
||||
unsigned _blockBits;
|
||||
|
@ -32,7 +32,8 @@ JLS::JLS(quint16 maxval, quint16 near)
|
||||
_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;
|
||||
quint16 cnt = 0;
|
||||
@ -42,12 +43,12 @@ bool JLS::processRunMode(BitStream &bs, quint16 col, quint16 &samples)
|
||||
z = Z[(bs.value() >> 0x18) ^ 0xff];
|
||||
|
||||
for (quint8 i = 0; i < z; i++) {
|
||||
cnt = cnt + _rg;
|
||||
cnt = cnt + ctx.rg;
|
||||
|
||||
if (cnt <= col && _runIndex < 31) {
|
||||
_runIndex++;
|
||||
_rk = J[_runIndex];
|
||||
_rg = 1U << _rk;
|
||||
if (cnt <= col && ctx.runIndex < 31) {
|
||||
ctx.runIndex++;
|
||||
ctx.rk = J[ctx.runIndex];
|
||||
ctx.rg = 1U << ctx.rk;
|
||||
}
|
||||
|
||||
if (cnt >= col) {
|
||||
@ -65,18 +66,18 @@ bool JLS::processRunMode(BitStream &bs, quint16 col, quint16 &samples)
|
||||
if (!bs.read(z + 1))
|
||||
return false;
|
||||
|
||||
if (_rk) {
|
||||
samples = (bs.value() >> (32 - _rk)) + cnt;
|
||||
if (!bs.read(_rk))
|
||||
if (ctx.rk) {
|
||||
samples = (bs.value() >> (32 - ctx.rk)) + cnt;
|
||||
if (!bs.read(ctx.rk))
|
||||
return false;
|
||||
} else
|
||||
samples = cnt;
|
||||
|
||||
_lrk = _rk + 1;
|
||||
if (_runIndex != 0) {
|
||||
_runIndex--;
|
||||
_rk = J[_runIndex];
|
||||
_rg = 1U << _rk;
|
||||
ctx.lrk = ctx.rk + 1;
|
||||
if (ctx.runIndex != 0) {
|
||||
ctx.runIndex--;
|
||||
ctx.rk = J[ctx.runIndex];
|
||||
ctx.rg = 1U << ctx.rk;
|
||||
}
|
||||
|
||||
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;
|
||||
MErrval = 0;
|
||||
@ -122,19 +124,19 @@ bool JLS::decodeError(BitStream &bs, quint8 limit, quint8 k, uint &MErrval)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool JLS::readLine(BitStream &bs)
|
||||
bool JLS::readLine(BitStream &bs, Context &ctx) const
|
||||
{
|
||||
quint8 ictx, rctx;
|
||||
quint8 k;
|
||||
uint MErrval;
|
||||
int Errval;
|
||||
int Rx;
|
||||
int Ra = _last[1];
|
||||
int Rb = _last[1];
|
||||
int Rc = _last[0];
|
||||
int Ra = ctx.last[1];
|
||||
int Rb = ctx.last[1];
|
||||
int Rc = ctx.last[0];
|
||||
uint col = 1;
|
||||
|
||||
*_current = _last[1];
|
||||
*ctx.current = ctx.last[1];
|
||||
|
||||
do {
|
||||
if (abs(Rb - Ra) > _near) {
|
||||
@ -144,7 +146,7 @@ bool JLS::readLine(BitStream &bs)
|
||||
else if (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))
|
||||
@ -158,7 +160,7 @@ bool JLS::readLine(BitStream &bs)
|
||||
meh = MErrval >> 1;
|
||||
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;
|
||||
mes = -mes - 1;
|
||||
if (MErrval & 1)
|
||||
@ -179,67 +181,67 @@ bool JLS::readLine(BitStream &bs)
|
||||
if (Rx > _maxval)
|
||||
Rx = _maxval;
|
||||
|
||||
_a[1] = _a[1] + meh;
|
||||
_b[1] = _b[1] + mes;
|
||||
if (_n[1] == 0x40) {
|
||||
_a[1] = _a[1] >> 1;
|
||||
if (_b[1] >= 0)
|
||||
_b[1] = _b[1] >> 1;
|
||||
ctx.a[1] = ctx.a[1] + meh;
|
||||
ctx.b[1] = ctx.b[1] + mes;
|
||||
if (ctx.n[1] == 0x40) {
|
||||
ctx.a[1] = ctx.a[1] >> 1;
|
||||
if (ctx.b[1] >= 0)
|
||||
ctx.b[1] = ctx.b[1] >> 1;
|
||||
else
|
||||
_b[1] = -((1 - _b[1]) >> 1);
|
||||
_n[1] = 0x21;
|
||||
ctx.b[1] = -((1 - ctx.b[1]) >> 1);
|
||||
ctx.n[1] = 0x21;
|
||||
} else
|
||||
_n[1] = _n[1] + 1;
|
||||
ctx.n[1] = ctx.n[1] + 1;
|
||||
|
||||
if (_b[1] <= -_n[1]) {
|
||||
_b[1] = _b[1] + _n[1];
|
||||
if (_b[1] <= -_n[1])
|
||||
_b[1] = 1 - _n[1];
|
||||
} else if (_b[1] > 0) {
|
||||
_b[1] = _b[1] - _n[1];
|
||||
if (_b[1] > 0)
|
||||
_b[1] = 0;
|
||||
if (ctx.b[1] <= -ctx.n[1]) {
|
||||
ctx.b[1] = ctx.b[1] + ctx.n[1];
|
||||
if (ctx.b[1] <= -ctx.n[1])
|
||||
ctx.b[1] = 1 - ctx.n[1];
|
||||
} else if (ctx.b[1] > 0) {
|
||||
ctx.b[1] = ctx.b[1] - ctx.n[1];
|
||||
if (ctx.b[1] > 0)
|
||||
ctx.b[1] = 0;
|
||||
}
|
||||
|
||||
Rc = Rb;
|
||||
Rb = _last[col + 1];
|
||||
Rb = ctx.last[col + 1];
|
||||
} else {
|
||||
quint16 samples;
|
||||
if (!processRunMode(bs, _w - col + 1, samples))
|
||||
if (!processRunMode(bs, ctx, ctx.w - col + 1, samples))
|
||||
return false;
|
||||
|
||||
if (samples != 0) {
|
||||
for (int i = 0; i < samples; i++) {
|
||||
if (col > _w)
|
||||
if (col > ctx.w)
|
||||
return false;
|
||||
_current[col] = Ra;
|
||||
ctx.current[col] = Ra;
|
||||
col++;
|
||||
}
|
||||
|
||||
if (col > _w)
|
||||
if (col > ctx.w)
|
||||
break;
|
||||
|
||||
Rc = _last[col];
|
||||
Rb = _last[col + 1];
|
||||
Rc = ctx.last[col];
|
||||
Rb = ctx.last[col + 1];
|
||||
} else {
|
||||
Rc = Rb;
|
||||
Rb = _last[col + 1];
|
||||
Rb = ctx.last[col + 1];
|
||||
}
|
||||
|
||||
rctx = (abs(Rc - Ra) <= _near);
|
||||
quint16 TEMP = _a[rctx + 2];
|
||||
quint16 TEMP = ctx.a[rctx + 2];
|
||||
if (rctx)
|
||||
TEMP += _n[rctx + 2] >> 1;
|
||||
TEMP += ctx.n[rctx + 2] >> 1;
|
||||
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;
|
||||
|
||||
quint16 s = ((k == 0) && (rctx || MErrval)) ?
|
||||
(_b[ictx] * 2 < _n[ictx]) : 0;
|
||||
(ctx.b[ictx] * 2 < ctx.n[ictx]) : 0;
|
||||
|
||||
Errval = MErrval + rctx + s;
|
||||
int evh;
|
||||
@ -249,7 +251,7 @@ bool JLS::readLine(BitStream &bs)
|
||||
} else {
|
||||
Errval = s - ((Errval + 1) >> 1);
|
||||
evh = -Errval;
|
||||
_b[ictx] = _b[ictx] + 1;
|
||||
ctx.b[ictx] = ctx.b[ictx] + 1;
|
||||
}
|
||||
|
||||
Errval *= (_near * 2 + 1);
|
||||
@ -274,59 +276,45 @@ bool JLS::readLine(BitStream &bs)
|
||||
if (Rx > _maxval)
|
||||
Rx = _maxval;
|
||||
|
||||
_a[ictx] = _a[ictx] + (evh - rctx);
|
||||
if (_n[ictx] == 0x40) {
|
||||
_a[ictx] = _a[ictx] >> 1;
|
||||
if (_b[ictx] >= 0)
|
||||
_b[ictx] = _b[ictx] >> 1;
|
||||
ctx.a[ictx] = ctx.a[ictx] + (evh - rctx);
|
||||
if (ctx.n[ictx] == 0x40) {
|
||||
ctx.a[ictx] = ctx.a[ictx] >> 1;
|
||||
if (ctx.b[ictx] >= 0)
|
||||
ctx.b[ictx] = ctx.b[ictx] >> 1;
|
||||
else
|
||||
_b[ictx] = -((1 - _b[ictx]) >> 1);
|
||||
_n[ictx] = 0x21;
|
||||
ctx.b[ictx] = -((1 - ctx.b[ictx]) >> 1);
|
||||
ctx.n[ictx] = 0x21;
|
||||
} else
|
||||
_n[ictx] = _n[ictx] + 1;
|
||||
ctx.n[ictx] = ctx.n[ictx] + 1;
|
||||
}
|
||||
|
||||
_current[col] = Rx;
|
||||
ctx.current[col] = Rx;
|
||||
|
||||
Ra = Rx;
|
||||
col = col + 1;
|
||||
} while (col <= _w);
|
||||
} while (col <= ctx.w);
|
||||
|
||||
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);
|
||||
|
||||
if (!bs.init())
|
||||
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++) {
|
||||
if (!readLine(bs))
|
||||
if (!readLine(bs, ctx))
|
||||
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;
|
||||
_last = _current;
|
||||
_current = tmp;
|
||||
quint16 *tmp = ctx.last;
|
||||
ctx.last = ctx.current;
|
||||
ctx.current = tmp;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -12,7 +12,8 @@ class JLS
|
||||
public:
|
||||
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:
|
||||
class BitStream
|
||||
@ -56,28 +57,53 @@ private:
|
||||
qint8 _shift;
|
||||
};
|
||||
|
||||
bool readLine(BitStream &bs);
|
||||
bool processRunMode(BitStream &bs, quint16 col, quint16 &samples);
|
||||
bool decodeError(BitStream &bs, quint8 limit, quint8 k, uint &MErrval);
|
||||
struct Context
|
||||
{
|
||||
Context(quint16 width, quint16 range)
|
||||
{
|
||||
w = width;
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
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 _near;
|
||||
quint16 _range;
|
||||
quint8 _qbpp;
|
||||
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;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ using namespace IMG;
|
||||
bool MapData::polyCb(VectorTile *tile, void *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);
|
||||
return true;
|
||||
}
|
||||
@ -21,14 +21,16 @@ bool MapData::polyCb(VectorTile *tile, void *context)
|
||||
bool MapData::pointCb(VectorTile *tile, void *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;
|
||||
}
|
||||
|
||||
bool MapData::elevationCb(VectorTile *tile, void *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;
|
||||
}
|
||||
|
||||
@ -50,10 +52,10 @@ MapData::~MapData()
|
||||
delete _style;
|
||||
}
|
||||
|
||||
void MapData::polys(const RectC &rect, int bits, QList<Poly> *polygons,
|
||||
QList<Poly> *lines)
|
||||
void MapData::polys(QFile *file, const RectC &rect, int bits,
|
||||
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];
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
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];
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
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];
|
||||
|
||||
min[0] = rect.left();
|
||||
@ -95,14 +99,14 @@ void MapData::load(qreal ratio)
|
||||
Q_ASSERT(!_style);
|
||||
|
||||
if (_typ)
|
||||
_style = new Style(ratio, _typ);
|
||||
_style = new Style(0, ratio, _typ);
|
||||
else {
|
||||
QString typFile(ProgramPaths::typFile());
|
||||
if (QFileInfo::exists(typFile)) {
|
||||
SubFile typ(&typFile);
|
||||
_style = new Style(ratio, &typ);
|
||||
_style = new Style(0, ratio, &typ);
|
||||
} else
|
||||
_style = new Style(ratio);
|
||||
_style = new Style(0, ratio);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include <QPointF>
|
||||
#include <QCache>
|
||||
#include <QMutex>
|
||||
#include <QFile>
|
||||
#include <QDebug>
|
||||
#include "common/rectc.h"
|
||||
#include "common/rtree.h"
|
||||
@ -77,10 +78,11 @@ public:
|
||||
const RectC &bounds() const {return _bounds;}
|
||||
const Range &zooms() const {return _zoomLevels;}
|
||||
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);
|
||||
void points(const RectC &rect, int bits, QList<Point> *points);
|
||||
void elevations(const RectC &rect, int bits, QList<Elevation> *elevations);
|
||||
void points(QFile *file, const RectC &rect, int bits, QList<Point> *points);
|
||||
void elevations(QFile *file, const RectC &rect, int bits,
|
||||
QList<Elevation> *elevations);
|
||||
|
||||
void load(qreal ratio);
|
||||
void clear();
|
||||
@ -122,12 +124,13 @@ private:
|
||||
|
||||
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,
|
||||
PolyCache *cache, QMutex *lock)
|
||||
: rect(rect), zoom(zoom), polygons(polygons), lines(lines),
|
||||
cache(cache), lock(lock) {}
|
||||
: file(file), rect(rect), zoom(zoom), polygons(polygons),
|
||||
lines(lines), cache(cache), lock(lock) {}
|
||||
|
||||
QFile *file;
|
||||
const RectC ▭
|
||||
const Zoom &zoom;
|
||||
QList<MapData::Poly> *polygons;
|
||||
@ -138,10 +141,12 @@ private:
|
||||
|
||||
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)
|
||||
: 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 ▭
|
||||
const Zoom &zoom;
|
||||
QList<MapData::Point> *points;
|
||||
@ -151,11 +156,12 @@ private:
|
||||
|
||||
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)
|
||||
: rect(rect), zoom(zoom), elevations(elevations), cache(cache),
|
||||
lock(lock) {}
|
||||
: file(file), rect(rect), zoom(zoom), elevations(elevations),
|
||||
cache(cache), lock(lock) {}
|
||||
|
||||
QFile *file;
|
||||
const RectC ▭
|
||||
const Zoom &zoom;
|
||||
QList<Elevation> *elevations;
|
||||
|
@ -152,7 +152,7 @@ void RasterTile::drawPolygons(QPainter *painter,
|
||||
bool insert = false;
|
||||
SubFile::Handle *hdl = hc.object(poly.raster.lbl());
|
||||
if (!hdl) {
|
||||
hdl = new SubFile::Handle(poly.raster.lbl());
|
||||
hdl = new SubFile::Handle(_file, poly.raster.lbl());
|
||||
insert = true;
|
||||
}
|
||||
QPixmap pm(poly.raster.lbl()->image(*hdl, poly.raster.id()));
|
||||
@ -443,11 +443,16 @@ void RasterTile::fetchData(QList<MapData::Poly> &polygons,
|
||||
{
|
||||
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()
|
||||
+ _rect.height()));
|
||||
RectD polyRectD(_transform.img2proj(polyRect.topLeft()),
|
||||
_transform.img2proj(polyRect.bottomRight()));
|
||||
_data->polys(polyRectD.toRectC(_proj, 20), _zoom,
|
||||
_data->polys(_file, polyRectD.toRectC(_proj, 20), _zoom,
|
||||
&polygons, _vectors ? &lines : 0);
|
||||
|
||||
if (_vectors) {
|
||||
@ -456,7 +461,7 @@ void RasterTile::fetchData(QList<MapData::Poly> &polygons,
|
||||
+ TEXT_EXTENT));
|
||||
RectD pointRectD(_transform.img2proj(pointRect.topLeft()),
|
||||
_transform.img2proj(pointRect.bottomRight()));
|
||||
_data->points(pointRectD.toRectC(_proj, 20), _zoom, &points);
|
||||
_data->points(_file, pointRectD.toRectC(_proj, 20), _zoom, &points);
|
||||
}
|
||||
}
|
||||
|
||||
@ -481,7 +486,7 @@ MatrixD RasterTile::elevation(int extend) const
|
||||
// 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)
|
||||
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);
|
||||
|
||||
DEMTree tree(tiles);
|
||||
|
@ -22,7 +22,8 @@ public:
|
||||
bool hillShading, bool rasters, bool vectors)
|
||||
: _proj(proj), _transform(transform), _data(data), _zoom(zoom),
|
||||
_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;}
|
||||
QPoint xy() const {return _rect.topLeft();}
|
||||
@ -88,6 +89,7 @@ private:
|
||||
QPixmap _pixmap;
|
||||
bool _hillShading;
|
||||
bool _rasters, _vectors;
|
||||
QFile *_file;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -1268,50 +1268,50 @@ bool Style::parseDrawOrder(SubFile *file, SubFile::Handle &hdl,
|
||||
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;
|
||||
quint16 tmp16, codepage;
|
||||
|
||||
if (!(file->seek(hdl, 0x15) && file->readUInt16(hdl, codepage)
|
||||
&& file->readUInt32(hdl, points.offset)
|
||||
&& file->readUInt32(hdl, points.size)
|
||||
&& file->readUInt32(hdl, lines.offset)
|
||||
&& file->readUInt32(hdl, lines.size)
|
||||
&& file->readUInt32(hdl, polygons.offset)
|
||||
&& file->readUInt32(hdl, polygons.size)))
|
||||
if (!(typ->seek(hdl, 0x15) && typ->readUInt16(hdl, codepage)
|
||||
&& typ->readUInt32(hdl, points.offset)
|
||||
&& typ->readUInt32(hdl, points.size)
|
||||
&& typ->readUInt32(hdl, lines.offset)
|
||||
&& typ->readUInt32(hdl, lines.size)
|
||||
&& typ->readUInt32(hdl, polygons.offset)
|
||||
&& typ->readUInt32(hdl, polygons.size)))
|
||||
return false;
|
||||
|
||||
if (!(file->readUInt16(hdl, tmp16) && file->readUInt16(hdl, tmp16)))
|
||||
if (!(typ->readUInt16(hdl, tmp16) && typ->readUInt16(hdl, tmp16)))
|
||||
return false;
|
||||
|
||||
if (!(file->readUInt32(hdl, points.arrayOffset)
|
||||
&& file->readUInt16(hdl, points.arrayItemSize)
|
||||
&& file->readUInt32(hdl, points.arraySize)
|
||||
&& file->readUInt32(hdl, lines.arrayOffset)
|
||||
&& file->readUInt16(hdl, lines.arrayItemSize)
|
||||
&& file->readUInt32(hdl, lines.arraySize)
|
||||
&& file->readUInt32(hdl, polygons.arrayOffset)
|
||||
&& file->readUInt16(hdl, polygons.arrayItemSize)
|
||||
&& file->readUInt32(hdl, polygons.arraySize)
|
||||
&& file->readUInt32(hdl, order.arrayOffset)
|
||||
&& file->readUInt16(hdl, order.arrayItemSize)
|
||||
&& file->readUInt32(hdl, order.arraySize)))
|
||||
if (!(typ->readUInt32(hdl, points.arrayOffset)
|
||||
&& typ->readUInt16(hdl, points.arrayItemSize)
|
||||
&& typ->readUInt32(hdl, points.arraySize)
|
||||
&& typ->readUInt32(hdl, lines.arrayOffset)
|
||||
&& typ->readUInt16(hdl, lines.arrayItemSize)
|
||||
&& typ->readUInt32(hdl, lines.arraySize)
|
||||
&& typ->readUInt32(hdl, polygons.arrayOffset)
|
||||
&& typ->readUInt16(hdl, polygons.arrayItemSize)
|
||||
&& typ->readUInt32(hdl, polygons.arraySize)
|
||||
&& typ->readUInt32(hdl, order.arrayOffset)
|
||||
&& typ->readUInt16(hdl, order.arrayItemSize)
|
||||
&& typ->readUInt32(hdl, order.arraySize)))
|
||||
return false;
|
||||
|
||||
if (!(parsePoints(file, hdl, points) && parseLines(file, hdl, lines)
|
||||
&& parsePolygons(file, hdl, polygons)
|
||||
&& parseDrawOrder(file, hdl, order))) {
|
||||
if (!(parsePoints(typ, hdl, points) && parseLines(typ, hdl, lines)
|
||||
&& parsePolygons(typ, hdl, polygons)
|
||||
&& parseDrawOrder(typ, hdl, order))) {
|
||||
qWarning("%s: Invalid TYP file, using default style",
|
||||
qPrintable(file->fileName()));
|
||||
qPrintable(typ->fileName()));
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Style::Style(qreal ratio, SubFile *typ)
|
||||
Style::Style(QFile *file, qreal ratio, SubFile *typ)
|
||||
{
|
||||
_large = pixelSizeFont(16);
|
||||
_normal = pixelSizeFont(14);
|
||||
@ -1326,7 +1326,7 @@ Style::Style(qreal ratio, SubFile *typ)
|
||||
defaultPointStyle(ratio);
|
||||
|
||||
if (typ)
|
||||
parseTYPFile(typ);
|
||||
parseTYPFile(file, typ);
|
||||
}
|
||||
|
||||
const Style::Line &Style::line(quint32 type) const
|
||||
|
@ -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 Polygon &polygon(quint32 type) const;
|
||||
@ -171,7 +171,7 @@ private:
|
||||
bool extended;
|
||||
};
|
||||
|
||||
bool parseTYPFile(SubFile *file);
|
||||
bool parseTYPFile(QFile *file, SubFile *typ);
|
||||
bool parsePoints(SubFile *file, SubFile::Handle &hdl,
|
||||
const Section §ion);
|
||||
bool parsePoint(SubFile *file, SubFile::Handle &hdl,
|
||||
|
@ -27,9 +27,9 @@ bool SubFile::seek(Handle &handle, quint32 pos) const
|
||||
int blockNum = pos >> BLOCK_BITS;
|
||||
|
||||
if (handle._blockNum != blockNum) {
|
||||
if (!handle._file.seek((quint64)blockNum << BLOCK_BITS))
|
||||
if (!handle._file->seek((quint64)blockNum << BLOCK_BITS))
|
||||
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;
|
||||
handle._blockNum = blockNum;
|
||||
}
|
||||
|
@ -18,25 +18,34 @@ public:
|
||||
class Handle
|
||||
{
|
||||
public:
|
||||
Handle(const SubFile *subFile)
|
||||
: _blockNum(-1), _blockPos(-1), _pos(-1)
|
||||
Handle(QFile *file, const SubFile *subFile)
|
||||
: _file(file), _blockNum(-1), _blockPos(-1), _pos(-1), _delete(false)
|
||||
{
|
||||
if (!subFile)
|
||||
return;
|
||||
|
||||
if (!_file) {
|
||||
_file = new QFile(subFile->fileName());
|
||||
_file->open(QIODevice::ReadOnly | QIODevice::Unbuffered);
|
||||
_delete = true;
|
||||
}
|
||||
_data.resize(subFile->blockSize());
|
||||
_file.setFileName(subFile->fileName());
|
||||
_file.open(QIODevice::ReadOnly | QIODevice::Unbuffered);
|
||||
}
|
||||
~Handle()
|
||||
{
|
||||
if (_delete)
|
||||
delete _file;
|
||||
}
|
||||
|
||||
private:
|
||||
friend class SubFile;
|
||||
|
||||
QFile _file;
|
||||
QFile *_file;
|
||||
QByteArray _data;
|
||||
int _blockNum;
|
||||
int _blockPos;
|
||||
int _pos;
|
||||
bool _delete;
|
||||
};
|
||||
|
||||
SubFile(const IMGData *img)
|
||||
|
@ -49,9 +49,9 @@ TREFile::~TREFile()
|
||||
clear();
|
||||
}
|
||||
|
||||
bool TREFile::init()
|
||||
bool TREFile::init(QFile *file)
|
||||
{
|
||||
Handle hdl(this);
|
||||
Handle hdl(file, this);
|
||||
quint8 locked, levels[64];
|
||||
quint16 hdrLen;
|
||||
qint32 north, east, south, west;
|
||||
@ -154,9 +154,9 @@ int TREFile::readExtEntry(Handle &hdl, quint32 &polygons, quint32 &lines,
|
||||
return rb;
|
||||
}
|
||||
|
||||
bool TREFile::load(int idx)
|
||||
bool TREFile::load(QFile *file, int idx)
|
||||
{
|
||||
Handle hdl(this);
|
||||
Handle hdl(file, this);
|
||||
QList<SubDiv*> sl;
|
||||
SubDiv *s = 0;
|
||||
SubDivTree *tree = new SubDivTree();
|
||||
@ -282,7 +282,7 @@ void TREFile::clear()
|
||||
_subdivs.clear();
|
||||
}
|
||||
|
||||
const TREFile::SubDivTree *TREFile::subdivs(const Zoom &zoom)
|
||||
const TREFile::SubDivTree *TREFile::subdivs(QFile *file, const Zoom &zoom)
|
||||
{
|
||||
int idx = -1;
|
||||
|
||||
@ -296,7 +296,7 @@ const TREFile::SubDivTree *TREFile::subdivs(const Zoom &zoom)
|
||||
if (idx < 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 _subdivs.value(_levels.at(idx).level);
|
||||
@ -309,10 +309,10 @@ static bool cb(SubDiv *subdiv, void *context)
|
||||
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;
|
||||
const SubDivTree *tree = subdivs(zoom);
|
||||
const SubDivTree *tree = subdivs(file, zoom);
|
||||
double min[2], max[2];
|
||||
|
||||
min[0] = rect.left();
|
||||
|
@ -24,11 +24,11 @@ public:
|
||||
: SubFile(gmp, offset), _flags(0), _extItemSize(0) {}
|
||||
~TREFile();
|
||||
|
||||
bool init();
|
||||
bool init(QFile *file);
|
||||
void clear();
|
||||
|
||||
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
|
||||
{return (bits == _levels.last().bits) ? (_flags >> 0xb) & 7 : 0;}
|
||||
QVector<Zoom> zooms() const;
|
||||
@ -41,8 +41,8 @@ private:
|
||||
};
|
||||
typedef RTree<SubDiv*, double, 2> SubDivTree;
|
||||
|
||||
bool load(int idx);
|
||||
const SubDivTree *subdivs(const Zoom &zoom);
|
||||
bool load(QFile *file, int idx);
|
||||
const SubDivTree *subdivs(QFile *file, const Zoom &zoom);
|
||||
int readExtEntry(Handle &hdl, quint32 &polygons, quint32 &lines,
|
||||
quint32 &points);
|
||||
|
||||
|
@ -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;
|
||||
|
||||
if (!(_tre && _tre->init() && _rgn))
|
||||
if (!(_tre && _tre->init(file) && _rgn))
|
||||
return false;
|
||||
|
||||
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;
|
||||
|
||||
if (!(_gmp->seek(hdl, 0x19) && _gmp->readUInt32(hdl, tre)
|
||||
@ -118,49 +118,56 @@ void VectorTile::clear()
|
||||
_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,
|
||||
MapData::PolyCache *cache, QMutex *lock)
|
||||
MapData::PolyCache *cache, QMutex *cacheLock)
|
||||
{
|
||||
SubFile::Handle *rgnHdl = 0, *lblHdl = 0, *netHdl = 0, *nodHdl = 0,
|
||||
*nodHdl2 = 0;
|
||||
|
||||
lock->lock();
|
||||
_lock.lock();
|
||||
|
||||
if (_loaded < 0) {
|
||||
lock->unlock();
|
||||
_lock.unlock();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_loaded) {
|
||||
rgnHdl = new SubFile::Handle(_rgn);
|
||||
lblHdl = new SubFile::Handle(_lbl);
|
||||
netHdl = new SubFile::Handle(_net);
|
||||
nodHdl = new SubFile::Handle(_nod);
|
||||
rgnHdl = new SubFile::Handle(file, _rgn);
|
||||
lblHdl = new SubFile::Handle(file, _lbl);
|
||||
netHdl = new SubFile::Handle(file, _net);
|
||||
nodHdl = new SubFile::Handle(file, _nod);
|
||||
|
||||
if (!load(*rgnHdl, *lblHdl, *netHdl, *nodHdl)) {
|
||||
lock->unlock();
|
||||
_lock.unlock();
|
||||
delete rgnHdl; delete lblHdl; delete netHdl; delete nodHdl;
|
||||
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++) {
|
||||
SubDiv *subdiv = subdivs.at(i);
|
||||
|
||||
MapData::Polys *polys = cache->object(subdiv);
|
||||
if (!polys) {
|
||||
cacheLock->unlock();
|
||||
|
||||
quint32 shift = _tre->shift(subdiv->bits());
|
||||
|
||||
if (!rgnHdl) {
|
||||
rgnHdl = new SubFile::Handle(_rgn);
|
||||
lblHdl = new SubFile::Handle(_lbl);
|
||||
netHdl = new SubFile::Handle(_net);
|
||||
rgnHdl = new SubFile::Handle(file, _rgn);
|
||||
lblHdl = new SubFile::Handle(file, _lbl);
|
||||
netHdl = new SubFile::Handle(file, _net);
|
||||
}
|
||||
|
||||
if (!subdiv->initialized() && !_rgn->subdivInit(*rgnHdl, subdiv))
|
||||
if (!subdiv->initialized() && !_rgn->subdivInit(*rgnHdl, subdiv)) {
|
||||
cacheLock->lock();
|
||||
continue;
|
||||
}
|
||||
|
||||
polys = new MapData::Polys();
|
||||
|
||||
@ -175,9 +182,9 @@ void VectorTile::polys(const RectC &rect, const Zoom &zoom,
|
||||
|
||||
if (_net && _net->hasLinks()) {
|
||||
if (!nodHdl)
|
||||
nodHdl = new SubFile::Handle(_nod);
|
||||
nodHdl = new SubFile::Handle(file, _nod);
|
||||
if (!nodHdl2)
|
||||
nodHdl2 = new SubFile::Handle(_nod);
|
||||
nodHdl2 = new SubFile::Handle(file, _nod);
|
||||
_rgn->links(*rgnHdl, subdiv, shift, _net, *netHdl, _nod, *nodHdl,
|
||||
*nodHdl2, _lbl, *lblHdl, &polys->lines);
|
||||
}
|
||||
@ -186,6 +193,7 @@ void VectorTile::polys(const RectC &rect, const Zoom &zoom,
|
||||
if (lines)
|
||||
copyPolys(rect, &polys->lines, lines);
|
||||
|
||||
cacheLock->lock();
|
||||
cache->insert(subdiv, polys);
|
||||
} else {
|
||||
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;
|
||||
}
|
||||
|
||||
void VectorTile::points(const RectC &rect, const Zoom &zoom,
|
||||
QList<MapData::Point> *points, MapData::PointCache *cache, QMutex *lock)
|
||||
void VectorTile::points(QFile *file, const RectC &rect, const Zoom &zoom,
|
||||
QList<MapData::Point> *points, MapData::PointCache *cache, QMutex *cacheLock)
|
||||
{
|
||||
SubFile::Handle *rgnHdl = 0, *lblHdl = 0;
|
||||
|
||||
lock->lock();
|
||||
_lock.lock();
|
||||
|
||||
if (_loaded < 0) {
|
||||
lock->unlock();
|
||||
_lock.unlock();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_loaded) {
|
||||
rgnHdl = new SubFile::Handle(_rgn);
|
||||
lblHdl = new SubFile::Handle(_lbl);
|
||||
SubFile::Handle nodHdl(_nod);
|
||||
SubFile::Handle netHdl(_net);
|
||||
rgnHdl = new SubFile::Handle(file, _rgn);
|
||||
lblHdl = new SubFile::Handle(file, _lbl);
|
||||
SubFile::Handle nodHdl(file, _nod);
|
||||
SubFile::Handle netHdl(file, _net);
|
||||
|
||||
if (!load(*rgnHdl, *lblHdl, netHdl, nodHdl)) {
|
||||
lock->unlock();
|
||||
_lock.unlock();
|
||||
delete rgnHdl; delete lblHdl;
|
||||
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++) {
|
||||
SubDiv *subdiv = subdivs.at(i);
|
||||
|
||||
QList<MapData::Point> *pl = cache->object(subdiv);
|
||||
if (!pl) {
|
||||
cacheLock->unlock();
|
||||
|
||||
if (!rgnHdl) {
|
||||
rgnHdl = new SubFile::Handle(_rgn);
|
||||
lblHdl = new SubFile::Handle(_lbl);
|
||||
rgnHdl = new SubFile::Handle(file, _rgn);
|
||||
lblHdl = new SubFile::Handle(file, _lbl);
|
||||
}
|
||||
|
||||
if (!subdiv->initialized() && !_rgn->subdivInit(*rgnHdl, subdiv))
|
||||
if (!subdiv->initialized() && !_rgn->subdivInit(*rgnHdl, subdiv)) {
|
||||
cacheLock->lock();
|
||||
continue;
|
||||
}
|
||||
|
||||
pl = new QList<MapData::Point>;
|
||||
|
||||
@ -248,34 +264,36 @@ void VectorTile::points(const RectC &rect, const Zoom &zoom,
|
||||
|
||||
copyPoints(rect, pl, points);
|
||||
|
||||
cacheLock->lock();
|
||||
cache->insert(subdiv, pl);
|
||||
} else
|
||||
copyPoints(rect, pl, points);
|
||||
}
|
||||
|
||||
lock->unlock();
|
||||
cacheLock->unlock();
|
||||
_lock.unlock();
|
||||
|
||||
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,
|
||||
QMutex *lock)
|
||||
QMutex *cacheLock)
|
||||
{
|
||||
SubFile::Handle *hdl = 0;
|
||||
|
||||
lock->lock();
|
||||
_demLock.lock();
|
||||
|
||||
if (_demLoaded < 0) {
|
||||
lock->unlock();
|
||||
_demLock.unlock();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_demLoaded) {
|
||||
hdl = new SubFile::Handle(_dem);
|
||||
hdl = new SubFile::Handle(file, _dem);
|
||||
|
||||
if (!loadDem(*hdl)) {
|
||||
lock->unlock();
|
||||
_demLock.unlock();
|
||||
delete hdl;
|
||||
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
|
||||
// maps with a single level this has no effect.
|
||||
int level = qMax(0, _dem->level(zoom) - 1);
|
||||
|
||||
QList<const DEMTile*> tiles(_dem->tiles(rect, level));
|
||||
|
||||
cacheLock->lock();
|
||||
|
||||
for (int i = 0; i < tiles.size(); i++) {
|
||||
const DEMTile *tile = tiles.at(i);
|
||||
MapData::Elevation *el = cache->object(tile);
|
||||
|
||||
MapData::Elevation *el = cache->object(tile);
|
||||
if (!el) {
|
||||
cacheLock->unlock();
|
||||
|
||||
if (!hdl)
|
||||
hdl = new SubFile::Handle(_dem);
|
||||
hdl = new SubFile::Handle(file, _dem);
|
||||
|
||||
el = _dem->elevations(*hdl, level, tile);
|
||||
if (!el->m.isNull())
|
||||
elevations->append(*el);
|
||||
|
||||
cacheLock->lock();
|
||||
cache->insert(tile, el);
|
||||
} else {
|
||||
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;
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ public:
|
||||
delete _dem; delete _gmp;
|
||||
}
|
||||
|
||||
bool init();
|
||||
bool init(QFile *file);
|
||||
void clear();
|
||||
|
||||
const RectC &bounds() const {return _tre->bounds();}
|
||||
@ -30,14 +30,15 @@ public:
|
||||
|
||||
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,
|
||||
MapData::PolyCache *cache, QMutex *lock);
|
||||
void points(const RectC &rect, const Zoom &zoom,
|
||||
QList<MapData::Point> *points, MapData::PointCache *cache, QMutex *lock);
|
||||
void elevations(const RectC &rect, const Zoom &zoom,
|
||||
MapData::PolyCache *cache, QMutex *cacheLock);
|
||||
void points(QFile *file, const RectC &rect, const Zoom &zoom,
|
||||
QList<MapData::Point> *points, MapData::PointCache *cache,
|
||||
QMutex *cacheLock);
|
||||
void elevations(QFile *file, const RectC &rect, const Zoom &zoom,
|
||||
QList<MapData::Elevation> *elevations, MapData::ElevationCache *cache,
|
||||
QMutex *lock);
|
||||
QMutex *cacheLock);
|
||||
|
||||
static bool isTileFile(SubFile::Type type)
|
||||
{
|
||||
@ -78,7 +79,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
bool initGMP();
|
||||
bool initGMP(QFile *file);
|
||||
bool load(SubFile::Handle &rgnHdl, SubFile::Handle &lblHdl,
|
||||
SubFile::Handle &netHdl, SubFile::Handle &nodHdl);
|
||||
bool loadDem(SubFile::Handle &demHdl);
|
||||
@ -92,6 +93,7 @@ private:
|
||||
SubFile *_gmp;
|
||||
|
||||
int _loaded, _demLoaded;
|
||||
QMutex _lock, _demLock;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -276,7 +276,7 @@ double IMGMap::elevation(const Coordinates &c)
|
||||
if (d->hasDEM()) {
|
||||
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);
|
||||
DEMTree tree(tiles);
|
||||
|
||||
|
@ -219,10 +219,9 @@ bool MapData::readTags(SubFile &subfile, int count,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MapData::readSubFiles()
|
||||
bool MapData::readSubFiles(QFile &file)
|
||||
{
|
||||
/* both _pointFile and _pathFile can be used here */
|
||||
QDataStream stream(&_pointFile);
|
||||
QDataStream stream(&file);
|
||||
|
||||
for (int i = 0; i < _subFiles.size(); i++) {
|
||||
const SubFileInfo &f = _subFiles.at(i);
|
||||
@ -422,8 +421,7 @@ bool MapData::readHeader(QFile &file)
|
||||
return true;
|
||||
}
|
||||
|
||||
MapData::MapData(const QString &fileName)
|
||||
: _pointFile(fileName), _pathFile(fileName), _valid(false)
|
||||
MapData::MapData(const QString &fileName) : _fileName(fileName), _valid(false)
|
||||
{
|
||||
QFile file(fileName);
|
||||
|
||||
@ -460,17 +458,13 @@ RectC MapData::bounds() const
|
||||
|
||||
void MapData::load()
|
||||
{
|
||||
_pointFile.open(QIODevice::ReadOnly | QIODevice::Unbuffered);
|
||||
_pathFile.open(QIODevice::ReadOnly | QIODevice::Unbuffered);
|
||||
|
||||
readSubFiles();
|
||||
QFile file(_fileName);
|
||||
if (file.open(QIODevice::ReadOnly | QIODevice::Unbuffered))
|
||||
readSubFiles(file);
|
||||
}
|
||||
|
||||
void MapData::clear()
|
||||
{
|
||||
_pointFile.close();
|
||||
_pathFile.close();
|
||||
|
||||
_pathCache.clear();
|
||||
_pointCache.clear();
|
||||
|
||||
@ -494,14 +488,14 @@ void MapData::clearTiles()
|
||||
bool MapData::pathCb(VectorTile *tile, void *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;
|
||||
}
|
||||
|
||||
bool MapData::pointCb(VectorTile *tile, void *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;
|
||||
}
|
||||
|
||||
@ -514,13 +508,14 @@ int MapData::level(int zoom) const
|
||||
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())
|
||||
return;
|
||||
|
||||
int l(level(zoom));
|
||||
PointCTX ctx(this, rect, zoom, list);
|
||||
PointCTX ctx(file, this, rect, zoom, list);
|
||||
double min[2], max[2];
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
void MapData::points(const VectorTile *tile, const RectC &rect, int zoom,
|
||||
QList<Point> *list)
|
||||
void MapData::points(QFile &file, VectorTile *tile, const RectC &rect,
|
||||
int zoom, QList<Point> *list)
|
||||
{
|
||||
Key key(tile, zoom);
|
||||
|
||||
_pointLock.lock();
|
||||
tile->lock.lock();
|
||||
|
||||
_pointCacheLock.lock();
|
||||
QList<Point> *tilePoints = _pointCache.object(key);
|
||||
|
||||
if (!tilePoints) {
|
||||
_pointCacheLock.unlock();
|
||||
QList<Point> *p = new QList<Point>();
|
||||
if (readPoints(tile, zoom, p)) {
|
||||
if (readPoints(file, tile, zoom, p)) {
|
||||
copyPoints(rect, p, list);
|
||||
_pointCacheLock.lock();
|
||||
_pointCache.insert(key, p);
|
||||
_pointCacheLock.unlock();
|
||||
} else
|
||||
delete p;
|
||||
} else
|
||||
} else {
|
||||
copyPoints(rect, tilePoints, list);
|
||||
_pointCacheLock.unlock();
|
||||
}
|
||||
|
||||
_pointLock.unlock();
|
||||
|
||||
|
||||
_pathLock.lock();
|
||||
|
||||
_pathCacheLock.lock();
|
||||
QList<Path> *tilePaths = _pathCache.object(key);
|
||||
|
||||
if (!tilePaths) {
|
||||
_pathCacheLock.unlock();
|
||||
QList<Path> *p = new QList<Path>();
|
||||
if (readPaths(tile, zoom, p)) {
|
||||
if (readPaths(file, tile, zoom, p)) {
|
||||
copyPoints(rect, p, list);
|
||||
_pathCacheLock.lock();
|
||||
_pathCache.insert(key, p);
|
||||
_pathCacheLock.unlock();
|
||||
} else
|
||||
delete p;
|
||||
} else
|
||||
} else {
|
||||
copyPoints(rect, tilePaths, list);
|
||||
_pathCacheLock.unlock();
|
||||
}
|
||||
|
||||
_pathLock.unlock();
|
||||
tile->lock.unlock();
|
||||
}
|
||||
|
||||
void MapData::paths(const RectC &searchRect, const RectC &boundsRect, int zoom,
|
||||
QList<Path> *list)
|
||||
void MapData::paths(QFile &file, const RectC &searchRect,
|
||||
const RectC &boundsRect, int zoom, QList<Path> *list)
|
||||
{
|
||||
if (!searchRect.isValid())
|
||||
return;
|
||||
|
||||
int l(level(zoom));
|
||||
PathCTX ctx(this, boundsRect, zoom, list);
|
||||
PathCTX ctx(file, this, boundsRect, zoom, list);
|
||||
double min[2], max[2];
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
Key key(tile, zoom);
|
||||
|
||||
_pathLock.lock();
|
||||
tile->lock.lock();
|
||||
|
||||
_pathCacheLock.lock();
|
||||
QList<Path> *cached = _pathCache.object(key);
|
||||
|
||||
if (!cached) {
|
||||
_pathCacheLock.unlock();
|
||||
QList<Path> *p = new QList<Path>();
|
||||
if (readPaths(tile, zoom, p)) {
|
||||
if (readPaths(file, tile, zoom, p)) {
|
||||
copyPaths(rect, p, list);
|
||||
_pathCacheLock.lock();
|
||||
_pathCache.insert(key, p);
|
||||
_pathCacheLock.unlock();
|
||||
} else
|
||||
delete p;
|
||||
} else
|
||||
} else {
|
||||
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));
|
||||
SubFile subfile(_pathFile, info.offset, info.size);
|
||||
SubFile subfile(file, info.offset, info.size);
|
||||
int rows = info.max - info.min + 1;
|
||||
QVector<unsigned> paths(rows);
|
||||
quint32 blocks, unused, val, cnt = 0;
|
||||
@ -698,10 +704,11 @@ bool MapData::readPaths(const VectorTile *tile, int zoom, QList<Path> *list)
|
||||
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));
|
||||
SubFile subfile(_pointFile, info.offset, info.size);
|
||||
SubFile subfile(file, info.offset, info.size);
|
||||
int rows = info.max - info.min + 1;
|
||||
QVector<unsigned> points(rows);
|
||||
quint32 val, unused, cnt = 0;
|
||||
|
@ -58,14 +58,15 @@ public:
|
||||
{return point.layer < other.point.layer;}
|
||||
};
|
||||
|
||||
const QString &fileName() const {return _fileName;}
|
||||
RectC bounds() const;
|
||||
Range zooms() const
|
||||
{return Range(_subFiles.first().min, _subFiles.last().max);}
|
||||
int tileSize() const {return _tileSize;}
|
||||
|
||||
void points(const RectC &rect, int zoom, QList<Point> *list);
|
||||
void paths(const RectC &searchRect, const RectC &boundsRect, int zoom,
|
||||
QList<Path> *set);
|
||||
void points(QFile &file, const RectC &rect, int zoom, QList<Point> *list);
|
||||
void paths(QFile &file, const RectC &searchRect, const RectC &boundsRect,
|
||||
int zoom, QList<Path> *set);
|
||||
unsigned tagId(const QByteArray &name) const {return _keys.value(name);}
|
||||
|
||||
void load();
|
||||
@ -89,12 +90,15 @@ private:
|
||||
|
||||
size_t offset;
|
||||
Coordinates pos;
|
||||
QMutex lock;
|
||||
};
|
||||
|
||||
struct PathCTX {
|
||||
PathCTX(MapData *data, const RectC &rect, int zoom, QList<Path> *list)
|
||||
: data(data), rect(rect), zoom(zoom), list(list) {}
|
||||
PathCTX(QFile &file, MapData *data, const RectC &rect, int zoom,
|
||||
QList<Path> *list)
|
||||
: file(file), data(data), rect(rect), zoom(zoom), list(list) {}
|
||||
|
||||
QFile &file;
|
||||
MapData *data;
|
||||
const RectC ▭
|
||||
int zoom;
|
||||
@ -102,9 +106,11 @@ private:
|
||||
};
|
||||
|
||||
struct PointCTX {
|
||||
PointCTX(MapData *data, const RectC &rect, int zoom, QList<Point> *list)
|
||||
: data(data), rect(rect), zoom(zoom), list(list) {}
|
||||
PointCTX(QFile &file, MapData *data, const RectC &rect, int zoom,
|
||||
QList<Point> *list)
|
||||
: file(file), data(data), rect(rect), zoom(zoom), list(list) {}
|
||||
|
||||
QFile &file;
|
||||
MapData *data;
|
||||
const RectC ▭
|
||||
int zoom;
|
||||
@ -143,16 +149,18 @@ private:
|
||||
bool readTagInfo(SubFile &hdr, QVector<TagSource> &tags);
|
||||
bool readMapInfo(SubFile &hdr, QByteArray &projection, bool &debugMap);
|
||||
bool readHeader(QFile &file);
|
||||
bool readSubFiles();
|
||||
bool readSubFiles(QFile &file);
|
||||
void clearTiles();
|
||||
|
||||
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);
|
||||
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);
|
||||
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,
|
||||
const QVector<TagSource> &tags, QVector<Tag> &list);
|
||||
@ -161,7 +169,7 @@ private:
|
||||
|
||||
friend HASH_T qHash(const MapData::Key &key);
|
||||
|
||||
QFile _pointFile, _pathFile;
|
||||
QString _fileName;
|
||||
RectC _bounds;
|
||||
quint16 _tileSize;
|
||||
QVector<SubFileInfo> _subFiles;
|
||||
@ -171,7 +179,7 @@ private:
|
||||
|
||||
QCache<Key, QList<Path> > _pathCache;
|
||||
QCache<Key, QList<Point> > _pointCache;
|
||||
QMutex _pathLock, _pointLock;
|
||||
QMutex _pathCacheLock, _pointCacheLock;
|
||||
|
||||
bool _valid;
|
||||
QString _errorString;
|
||||
|
@ -408,6 +408,10 @@ void RasterTile::fetchData(QList<MapData::Path> &paths,
|
||||
QList<MapData::Point> &points) const
|
||||
{
|
||||
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),
|
||||
QPointF(ttl.x() + _rect.width() + PATHS_EXTENT, ttl.y() + _rect.height()
|
||||
@ -419,15 +423,15 @@ void RasterTile::fetchData(QList<MapData::Path> &paths,
|
||||
_transform.img2proj(pathRect.bottomRight()));
|
||||
RectD searchRectD(_transform.img2proj(searchRect.topLeft()),
|
||||
_transform.img2proj(searchRect.bottomRight()));
|
||||
_data->paths(searchRectD.toRectC(_proj, 20), pathRectD.toRectC(_proj, 20),
|
||||
_zoom, &paths);
|
||||
_data->paths(file, searchRectD.toRectC(_proj, 20),
|
||||
pathRectD.toRectC(_proj, 20), _zoom, &paths);
|
||||
|
||||
QRectF pointRect(QPointF(ttl.x() - TEXT_EXTENT, ttl.y() - TEXT_EXTENT),
|
||||
QPointF(ttl.x() + _rect.width() + TEXT_EXTENT, ttl.y() + _rect.height()
|
||||
+ TEXT_EXTENT));
|
||||
RectD pointRectD(_transform.img2proj(pointRect.topLeft()),
|
||||
_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
|
||||
|