Странные растры в QGIS + GDAL - давайте разберемся!
Добавлено: 16 июл 2010, 01:08
Как хорошо известно, пирамидные слои сильно ускоряют отрисовку изображения. Всегда ли? Отнюдь.
Есть например вот такой http://gis-lab.info/data/samples/l7_142-021_1999-187.7z растр. Сцена ландсата. Попробуйте загрузить ее в QGIS (можно убедиться, что пирамиды в ней построены) и поработать с ней. Тормозит?!
В чем причина - в странной структуре растра. Блоки не квадратные как у обычных растров, а размеров ширина растра * 1 пиксель. Смотрим утилитой gdalinfo этот растр и любой другой ландсат, отрисовывающийся быстро. Назовем их условно SLOW и FAST.
SLOW
FAST
Видно, что в первом случае блоки Block=8841x1, а во втором Block=64x64.
Теперь собственно вопросы:
Как и почему они такие получились? Исходники - поканальные тифы из гловиса, склеивал или через gdaltools, или эрдасом, не помню точно. Впрочем и тем. и другим склеивал не раз - не было такого.
Как переконвертировать к нормальной структуре? Пересохранение в другой формат (tif -> img и наоборот) не помогает, перегонка в другую проекцию тоже.
Можно ли ускорить отображение таких растров?
Интересно также быстро ли их отрисовывают другие программы. Помниться, и раньше попадались некоторые растры, которые очень медленно отрисовывались в трешке и девятке, не вэтом ли причина?
Есть например вот такой http://gis-lab.info/data/samples/l7_142-021_1999-187.7z растр. Сцена ландсата. Попробуйте загрузить ее в QGIS (можно убедиться, что пирамиды в ней построены) и поработать с ней. Тормозит?!
В чем причина - в странной структуре растра. Блоки не квадратные как у обычных растров, а размеров ширина растра * 1 пиксель. Смотрим утилитой gdalinfo этот растр и любой другой ландсат, отрисовывающийся быстро. Назовем их условно SLOW и FAST.
SLOW
Код: Выделить всё
Driver: GTiff/GeoTIFF
Files: /data/l7_142-021_1999-187.tif
Size is 8841, 8041
Coordinate System is:
PROJCS["WGS 84 / UTM zone 46N",
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.2572235629972,
AUTHORITY["EPSG","7030"]],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433],
AUTHORITY["EPSG","4326"]],
PROJECTION["Transverse_Mercator"],
PARAMETER["latitude_of_origin",0],
PARAMETER["central_meridian",93],
PARAMETER["scale_factor",0.9996],
PARAMETER["false_easting",500000],
PARAMETER["false_northing",0],
UNIT["metre",1,
AUTHORITY["EPSG","9001"]],
AUTHORITY["EPSG","32646"]]
Origin = (263985.000000000000000,6936015.000000000000000)
Pixel Size = (30.000000000000000,-30.000000000000000)
Metadata:
AREA_OR_POINT=Area
Image Structure Metadata:
INTERLEAVE=PIXEL
Corner Coordinates:
Upper Left ( 263985.000, 6936015.000) ( 88d25'8.31"E, 62d28'47.57"N)
Lower Left ( 263985.000, 6694785.000) ( 88d43'30.72"E, 60d19'14.60"N)
Upper Right ( 529215.000, 6936015.000) ( 93d34'5.25"E, 62d33'14.00"N)
Lower Right ( 529215.000, 6694785.000) ( 93d31'48.02"E, 60d23'18.23"N)
Center ( 396600.000, 6815400.000) ( 91d 3'35.99"E, 61d27'30.70"N)
Band 1 Block=8841x1 Type=Byte, ColorInterp=Gray
NoData Value=0
Overviews: 4421x4021, 2211x2011, 1106x1006, 553x503, 277x252
Band 2 Block=8841x1 Type=Byte, ColorInterp=Undefined
NoData Value=0
Overviews: 4421x4021, 2211x2011, 1106x1006, 553x503, 277x252
Band 3 Block=8841x1 Type=Byte, ColorInterp=Undefined
NoData Value=0
Overviews: 4421x4021, 2211x2011, 1106x1006, 553x503, 277x252
Band 4 Block=8841x1 Type=Byte, ColorInterp=Undefined
NoData Value=0
Overviews: 4421x4021, 2211x2011, 1106x1006, 553x503, 277x252
Band 5 Block=8841x1 Type=Byte, ColorInterp=Undefined
NoData Value=0
Overviews: 4421x4021, 2211x2011, 1106x1006, 553x503, 277x252
Band 6 Block=8841x1 Type=Byte, ColorInterp=Undefined
NoData Value=0
Overviews: 4421x4021, 2211x2011, 1106x1006, 553x503, 277x252
Код: Выделить всё
Driver: HFA/Erdas Imagine Images (.img)
Files: /data/LE71590182009205ASN00.img
Size is 8701, 7781
Coordinate System is:
PROJCS["UTM Zone 42, Northern Hemisphere",
GEOGCS["WGS_1984",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.2572235629972],
TOWGS84[0,0,0,0,0,0,0]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433],
AUTHORITY["EPSG","4326"]],
PROJECTION["Transverse_Mercator"],
PARAMETER["latitude_of_origin",0],
PARAMETER["central_meridian",69],
PARAMETER["scale_factor",0.9996],
PARAMETER["false_easting",500000],
PARAMETER["false_northing",0],
UNIT["Meter",1],
AUTHORITY["EPSG","32642"]]
Origin = (423584.999999999941792,6778215.000000000000000)
Pixel Size = (30.000000000000000,-30.000000000000000)
Corner Coordinates:
Upper Left ( 423585.000, 6778215.000) ( 67d34'52.42"E, 61d 7'51.84"N)
Lower Left ( 423585.000, 6544785.000) ( 67d40'6.62"E, 59d 2'8.40"N)
Upper Right ( 684615.000, 6778215.000) ( 72d25'28.92"E, 61d 5'42.45"N)
Lower Right ( 684615.000, 6544785.000) ( 72d12'51.83"E, 59d 0'9.44"N)
Center ( 554100.000, 6661500.000) ( 69d58'21.00"E, 60d 5'13.26"N)
Band 1 Block=64x64 Type=Byte, ColorInterp=Undefined
Description = Layer_1
Min=0.000 Max=159.000
Minimum=0.000, Maximum=159.000, Mean=28.300, StdDev=30.435
Overviews: 2176x1946, 1088x973, 544x487, 272x244, 136x122, 68x61
Metadata:
STATISTICS_MINIMUM=0
STATISTICS_MAXIMUM=159
STATISTICS_MEAN=28.299991309473
STATISTICS_MEDIAN=0
STATISTICS_MODE=0
STATISTICS_STDDEV=30.435067834072
STATISTICS_HISTONUMBINS=256
STATISTICS_HISTOMIN=0
STATISTICS_HISTOMAX=255
LAYER_TYPE=athematic
STATISTICS_HISTOBINVALUES=36150464|0|0|0|128|64|64|0|320|512|0|64|0|0|64|0|192|0|0|64|0|0|0|0|0|0|64|64|0|64|0|0|0|0|0|0|0|64|128|64|0|0|0|0|0|0|0|0|0|64|448|5248|39808|194560|744384|1868800|2862272|2947776|2659520|2677184|2846784|2682880|2312896|2023360|1879872|1663040|1344960|970944|629440|388352|256512|158656|101952|68544|47104|35904|27520|21248|17792|13632|10816|9216|7360|6016|5312|5120|4864|4096|3072|2560|2624|2432|2944|2176|2496|2496|1984|2112|1856|2112|1792|1600|1408|896|1088|1280|704|1216|896|832|1024|1024|1088|896|960|384|832|256|704|384|192|448|832|256|320|256|256|256|192|256|128|384|384|192|192|320|256|256|64|64|128|64|192|192|64|128|192|128|64|0|128|128|128|0|0|0|64|0|0|64|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|
<GDALRasterAttributeTable Row0Min="0" BinSize="1">
<FieldDefn index="0">
<Name>Histogram</Name>
<Type>1</Type>
<Usage>0</Usage>
</FieldDefn>
<Row index="0">
<F>36150464</F>
</Row>
<Row index="1">
<F>0</F>
</Row>
<Row index="2">
<F>0</F>
</Row>
<Row index="3">
<F>0</F>
</Row>
<Row index="4">
<F>128</F>
</Row>
<Row index="5">
<F>64</F>
</Row>
<Row index="6">
<F>64</F>
</Row>
<Row index="7">
<F>0</F>
</Row>
<Row index="8">
<F>320</F>
</Row>
<Row index="9">
<F>512</F>
</Row>
<Row index="10">
<F>0</F>
</Row>
<Row index="11">
<F>64</F>
</Row>
<Row index="12">
<F>0</F>
</Row>
<Row index="13">
<F>0</F>
</Row>
<Row index="14">
<F>64</F>
</Row>
<Row index="15">
<F>0</F>
</Row>
<Row index="16">
<F>192</F>
</Row>
<Row index="17">
<F>0</F>
</Row>
<Row index="18">
<F>0</F>
</Row>
<Row index="19">
<F>64</F>
</Row>
<Row index="20">
<F>0</F>
</Row>
<Row index="21">
<F>0</F>
</Row>
<Row index="22">
<F>0</F>
</Row>
<Row index="23">
<F>0</F>
</Row>
<Row index="24">
<F>0</F>
</Row>
<Row index="25">
<F>0</F>
</Row>
<Row index="26">
<F>64</F>
</Row>
<Row index="27">
<F>64</F>
</Row>
<Row index="28">
<F>0</F>
</Row>
<Row index="29">
<F>64</F>
</Row>
<Row index="30">
<F>0</F>
</Row>
<Row index="31">
<F>0</F>
</Row>
<Row index="32">
<F>0</F>
</Row>
<Row index="33">
<F>0</F>
</Row>
<Row index="34">
<F>0</F>
</Row>
<Row index="35">
<F>0</F>
</Row>
<Row index="36">
<F>0</F>
</Row>
<Row index="37">
<F>64</F>
</Row>
<Row index="38">
<F>128</F>
</Row>
<Row index="39">
<F>64</F>
</Row>
<Row index="40">
<F>0</F>
</Row>
<Row index="41">
<F>0</F>
</Row>
<Row index="42">
<F>0</F>
</Row>
<Row index="43">
<F>0</F>
</Row>
<Row index="44">
<F>0</F>
</Row>
<Row index="45">
<F>0</F>
</Row>
<Row index="46">
<F>0</F>
</Row>
<Row index="47">
<F>0</F>
</Row>
<Row index="48">
<F>0</F>
</Row>
<Row index="49">
<F>64</F>
</Row>
<Row index="50">
<F>448</F>
</Row>
<Row index="51">
<F>5248</F>
</Row>
<Row index="52">
<F>39808</F>
</Row>
<Row index="53">
<F>194560</F>
</Row>
<Row index="54">
<F>744384</F>
</Row>
<Row index="55">
<F>1868800</F>
</Row>
<Row index="56">
<F>2862272</F>
</Row>
<Row index="57">
<F>2947776</F>
</Row>
<Row index="58">
<F>2659520</F>
</Row>
<Row index="59">
<F>2677184</F>
</Row>
<Row index="60">
<F>2846784</F>
</Row>
<Row index="61">
<F>2682880</F>
</Row>
<Row index="62">
<F>2312896</F>
</Row>
<Row index="63">
<F>2023360</F>
</Row>
<Row index="64">
<F>1879872</F>
</Row>
<Row index="65">
<F>1663040</F>
</Row>
<Row index="66">
<F>1344960</F>
</Row>
<Row index="67">
<F>970944</F>
</Row>
<Row index="68">
<F>629440</F>
</Row>
<Row index="69">
<F>388352</F>
</Row>
<Row index="70">
<F>256512</F>
</Row>
<Row index="71">
<F>158656</F>
</Row>
<Row index="72">
<F>101952</F>
</Row>
<Row index="73">
<F>68544</F>
</Row>
<Row index="74">
<F>47104</F>
</Row>
<Row index="75">
<F>35904</F>
</Row>
<Row index="76">
<F>27520</F>
</Row>
<Row index="77">
<F>21248</F>
</Row>
<Row index="78">
<F>17792</F>
</Row>
<Row index="79">
<F>13632</F>
</Row>
<Row index="80">
<F>10816</F>
</Row>
<Row index="81">
<F>9216</F>
</Row>
<Row index="82">
<F>7360</F>
</Row>
<Row index="83">
<F>6016</F>
</Row>
<Row index="84">
<F>5312</F>
</Row>
<Row index="85">
<F>5120</F>
</Row>
<Row index="86">
<F>4864</F>
</Row>
<Row index="87">
<F>4096</F>
</Row>
<Row index="88">
<F>3072</F>
</Row>
<Row index="89">
<F>2560</F>
</Row>
<Row index="90">
<F>2624</F>
</Row>
<Row index="91">
<F>2432</F>
</Row>
<Row index="92">
<F>2944</F>
</Row>
<Row index="93">
<F>2176</F>
</Row>
<Row index="94">
<F>2496</F>
</Row>
<Row index="95">
<F>2496</F>
</Row>
<Row index="96">
<F>1984</F>
</Row>
<Row index="97">
<F>2112</F>
</Row>
<Row index="98">
<F>1856</F>
</Row>
<Row index="99">
<F>2112</F>
</Row>
<Row index="100">
<F>1792</F>
</Row>
<Row index="101">
<F>1600</F>
</Row>
<Row index="102">
<F>1408</F>
</Row>
<Row index="103">
<F>896</F>
</Row>
<Row index="104">
<F>1088</F>
</Row>
<Row index="105">
<F>1280</F>
</Row>
<Row index="106">
<F>704</F>
</Row>
<Row index="107">
<F>1216</F>
</Row>
<Row index="108">
<F>896</F>
</Row>
<Row index="109">
<F>832</F>
</Row>
<Row index="110">
<F>1024</F>
</Row>
<Row index="111">
<F>1024</F>
</Row>
<Row index="112">
<F>1088</F>
</Row>
<Row index="113">
<F>896</F>
</Row>
<Row index="114">
<F>960</F>
</Row>
<Row index="115">
<F>384</F>
</Row>
<Row index="116">
<F>832</F>
</Row>
<Row index="117">
<F>256</F>
</Row>
<Row index="118">
<F>704</F>
</Row>
<Row index="119">
<F>384</F>
</Row>
<Row index="120">
<F>192</F>
</Row>
<Row index="121">
<F>448</F>
</Row>
<Row index="122">
<F>832</F>
</Row>
<Row index="123">
<F>256</F>
</Row>
<Row index="124">
<F>320</F>
</Row>
<Row index="125">
<F>256</F>
</Row>
<Row index="126">
<F>256</F>
</Row>
<Row index="127">
<F>256</F>
</Row>
<Row index="128">
<F>192</F>
</Row>
<Row index="129">
<F>256</F>
</Row>
<Row index="130">
<F>128</F>
</Row>
<Row index="131">
<F>384</F>
</Row>
<Row index="132">
<F>384</F>
</Row>
<Row index="133">
<F>192</F>
</Row>
<Row index="134">
<F>192</F>
</Row>
<Row index="135">
<F>320</F>
</Row>
<Row index="136">
<F>256</F>
</Row>
<Row index="137">
<F>256</F>
</Row>
<Row index="138">
<F>64</F>
</Row>
<Row index="139">
<F>64</F>
</Row>
<Row index="140">
<F>128</F>
</Row>
<Row index="141">
<F>64</F>
</Row>
<Row index="142">
<F>192</F>
</Row>
<Row index="143">
<F>192</F>
</Row>
<Row index="144">
<F>64</F>
</Row>
<Row index="145">
<F>128</F>
</Row>
<Row index="146">
<F>192</F>
</Row>
<Row index="147">
<F>128</F>
</Row>
<Row index="148">
<F>64</F>
</Row>
<Row index="149">
<F>0</F>
</Row>
<Row index="150">
<F>128</F>
</Row>
<Row index="151">
<F>128</F>
</Row>
<Row index="152">
<F>128</F>
</Row>
<Row index="153">
<F>0</F>
</Row>
<Row index="154">
<F>0</F>
</Row>
<Row index="155">
<F>0</F>
</Row>
<Row index="156">
<F>64</F>
</Row>
<Row index="157">
<F>0</F>
</Row>
<Row index="158">
<F>0</F>
</Row>
<Row index="159">
<F>64</F>
</Row>
<Row index="160">
<F>0</F>
</Row>
<Row index="161">
<F>0</F>
</Row>
<Row index="162">
<F>0</F>
</Row>
<Row index="163">
<F>0</F>
</Row>
<Row index="164">
<F>0</F>
</Row>
<Row index="165">
<F>0</F>
</Row>
<Row index="166">
<F>0</F>
</Row>
<Row index="167">
<F>0</F>
</Row>
<Row index="168">
<F>0</F>
</Row>
<Row index="169">
<F>0</F>
</Row>
<Row index="170">
<F>0</F>
</Row>
<Row index="171">
<F>0</F>
</Row>
<Row index="172">
<F>0</F>
</Row>
<Row index="173">
<F>0</F>
</Row>
<Row index="174">
<F>0</F>
</Row>
<Row index="175">
<F>0</F>
</Row>
<Row index="176">
<F>0</F>
</Row>
<Row index="177">
<F>0</F>
</Row>
<Row index="178">
<F>0</F>
</Row>
<Row index="179">
<F>0</F>
</Row>
<Row index="180">
<F>0</F>
</Row>
<Row index="181">
<F>0</F>
</Row>
<Row index="182">
<F>0</F>
</Row>
<Row index="183">
<F>0</F>
</Row>
<Row index="184">
<F>0</F>
</Row>
<Row index="185">
<F>0</F>
</Row>
<Row index="186">
<F>0</F>
</Row>
<Row index="187">
<F>0</F>
</Row>
<Row index="188">
<F>0</F>
</Row>
<Row index="189">
<F>0</F>
</Row>
<Row index="190">
<F>0</F>
</Row>
<Row index="191">
<F>0</F>
</Row>
<Row index="192">
<F>0</F>
</Row>
<Row index="193">
<F>0</F>
</Row>
<Row index="194">
<F>0</F>
</Row>
<Row index="195">
<F>0</F>
</Row>
<Row index="196">
<F>0</F>
</Row>
<Row index="197">
<F>0</F>
</Row>
<Row index="198">
<F>0</F>
</Row>
<Row index="199">
<F>0</F>
</Row>
<Row index="200">
<F>0</F>
</Row>
<Row index="201">
<F>0</F>
</Row>
<Row index="202">
<F>0</F>
</Row>
<Row index="203">
<F>0</F>
</Row>
<Row index="204">
<F>0</F>
</Row>
<Row index="205">
<F>0</F>
</Row>
<Row index="206">
<F>0</F>
</Row>
<Row index="207">
<F>0</F>
</Row>
<Row index="208">
<F>0</F>
</Row>
<Row index="209">
<F>0</F>
</Row>
<Row index="210">
<F>0</F>
</Row>
<Row index="211">
<F>0</F>
</Row>
<Row index="212">
<F>0</F>
</Row>
<Row index="213">
<F>0</F>
</Row>
<Row index="214">
<F>0</F>
</Row>
<Row index="215">
<F>0</F>
</Row>
<Row index="216">
<F>0</F>
</Row>
<Row index="217">
<F>0</F>
</Row>
<Row index="218">
<F>0</F>
</Row>
<Row index="219">
<F>0</F>
</Row>
<Row index="220">
<F>0</F>
</Row>
<Row index="221">
<F>0</F>
</Row>
<Row index="222">
<F>0</F>
</Row>
<Row index="223">
<F>0</F>
</Row>
<Row index="224">
<F>0</F>
</Row>
<Row index="225">
<F>0</F>
</Row>
<Row index="226">
<F>0</F>
</Row>
<Row index="227">
<F>0</F>
</Row>
<Row index="228">
<F>0</F>
</Row>
<Row index="229">
<F>0</F>
</Row>
<Row index="230">
<F>0</F>
</Row>
<Row index="231">
<F>0</F>
</Row>
<Row index="232">
<F>0</F>
</Row>
<Row index="233">
<F>0</F>
</Row>
<Row index="234">
<F>0</F>
</Row>
<Row index="235">
<F>0</F>
</Row>
<Row index="236">
<F>0</F>
</Row>
<Row index="237">
<F>0</F>
</Row>
<Row index="238">
<F>0</F>
</Row>
<Row index="239">
<F>0</F>
</Row>
<Row index="240">
<F>0</F>
</Row>
<Row index="241">
<F>0</F>
</Row>
<Row index="242">
<F>0</F>
</Row>
<Row index="243">
<F>0</F>
</Row>
<Row index="244">
<F>0</F>
</Row>
<Row index="245">
<F>0</F>
</Row>
<Row index="246">
<F>0</F>
</Row>
<Row index="247">
<F>0</F>
</Row>
<Row index="248">
<F>0</F>
</Row>
<Row index="249">
<F>0</F>
</Row>
<Row index="250">
<F>0</F>
</Row>
<Row index="251">
<F>0</F>
</Row>
<Row index="252">
<F>0</F>
</Row>
<Row index="253">
<F>0</F>
</Row>
<Row index="254">
<F>0</F>
</Row>
<Row index="255">
<F>0</F>
</Row>
</GDALRasterAttributeTable>
и далее аналогично по оставшимся каналам...
Теперь собственно вопросы:
Как и почему они такие получились? Исходники - поканальные тифы из гловиса, склеивал или через gdaltools, или эрдасом, не помню точно. Впрочем и тем. и другим склеивал не раз - не было такого.
Как переконвертировать к нормальной структуре? Пересохранение в другой формат (tif -> img и наоборот) не помогает, перегонка в другую проекцию тоже.
Можно ли ускорить отображение таких растров?
Интересно также быстро ли их отрисовывают другие программы. Помниться, и раньше попадались некоторые растры, которые очень медленно отрисовывались в трешке и девятке, не вэтом ли причина?