D 2014-10-02T17:36:32.685 L benchmarks P 3f03ce033fb78e902e27006063ff4bfd36e14581 U sandro W 55868 Back to RasterLite2 doc index

RasterLite2 reference Benchmarks

1.a) Color Satellite/Aerial Orthophotos (RGB: 3 bands, unsigned integer 8bit sample)

Input dataset

We'll use in this benchmark the well known True Marble imagery in its 500m version. This dataset corresponds to a worldwide mosaic of many reprocessed cloud-free Landsat scenes. All the input GeoTIFFs are freely available for download under the CC-BY license terms:
  1. TrueMarble.500m.21600x21600.A1.tif
  2. TrueMarble.500m.21600x21600.A2.tif
  3. TrueMarble.500m.21600x21600.B1.tif
  4. TrueMarble.500m.21600x21600.B2.tif
  5. TrueMarble.500m.21600x21600.C1.tif
  6. TrueMarble.500m.21600x21600.C2.tif
  7. TrueMarble.500m.21600x21600.D1.tif
  8. TrueMarble.500m.21600x21600.D2.tif
Each single GeoTIFF corresponds to a 21,600 x 21,600 pixels image (1.45 GB), so the whole input dataset requires about 11.5 GB of disk storage.

True Marble

Scope of this benchmark

Methodology

  1. a separate db-file was created and populated for each configuration being tested.
  2. then a monolithic multi-resolution Pyramid was added.
  3. finally 50 GeoTiff images at full resolution were extracted from each db-file: all exported images had different sizes and geographic positions, and exactly the same identical requests were issued on behalf on each db-file.
  4. as far as possible all timings have been measured under hot cache conditions.
The following is an excerpt of actual commands and SQL queries used in this benchmark: $ rl2tool CREATE -db tm_png1024.sqlite -cov tm -smp UINT8 -pxl RGB \ -cpr PNG -srid 4326 -res 0.00416666666666667 -tlw 1024 -tlh 1024 $ rl2tool CREATE -db tm_png1024.sqlite -cov tm -dir . -ext tif $ rl2tool PYRAMIDIZE-MONOLITHIC -db tm_png1024.sqlite -cov tm $ export "SPATIALITE_SECURITY=relaxed" $ sqlite3 tm_png1024.sqlite

Objective comparative results

Test ConfigurationDB size
(after initial loading)
Final DB size
(including Pyramid)
LoadingPyramidizingExporting
Compression: NONE
tile size: 512 x 512
10.8 GB10.9 GB17 mins 35 secs14 mins 52 secs11.90 secs
Compression: JPEG
tile size: 256 x 256
269.0 MB275.0 MB16 mins 47 secs3 mins 30 secs10.20 secs
Compression: JPEG
tile size: 512 x 512
220.0 MB225.0 MB15 mins 24 secs3 mins 34 secs10.63 secs
Compression: JPEG
tile size: 1024 x 1024
212.0 MB217.0 MB15 mins 37 secs3 mins 37 secs12.10 secs
Compression: PNG
tile size: 256 x 256
1.51 GB1.53 GB34 mins 8 secs7 mins 22 secs14.09 secs
Compression: PNG
tile size: 512 x 512
1.46 GB1.49 GB34 mins 36 secs7 mins 59 secs16.50 secs
Compression: PNG
tile size: 1024 x 1024
1.47 GB1.49 GB34 mins 30 secs7 mins 32 secs20.71 secs
Compression: WEBP (lossy)
tile size: 512 x 512
130.0 MB136.1 MB72 mins 29 secs8 mins 22 secs20.59 secs
Compression: WEBP (lossless)
tile size: 512 x 512
1.06 GB1.07 GB210 mins 49 secs8 mins 52 secs24.99 secs

Conclusions and final remarks

Very short said: the venerable JPEG (born in 1986, about thirty years ago) clearly wins hands down: If you are looking instead for a lossless compression, then PNG is obviously your better choice: The real delusion comes from webp, in both its flavors: Few interesting details worth to be noted:

1.b) RGB (8 bit) multi-resolution Pyramid

Input dataset

Exactly the same as above.

Scope of this benchmark

Methodology

  1. recycling the tm_jpeg.sqlite DB prepared in the previous benchmark (RGB UINT8, JPEG compressed, 512 x 512 tiles).
  2. then rebuilding from scratch a monolithic multi-resolution Pyramid using any alternative configuration supported by RasterLite2.
  3. finally about 200 JPEG images at different arbitrary resolutions were extracted for each Pyramid configuration being tested: all extracted images had the same size but different resolutions and geographic positions, and exactly the same identical requests were issued on behalf on each configuration.
    The intended scope is the one to reply the typical actions performed by an user zooming in and out on different positions of a map.
The following is an excerpt of actual commands and SQL queries used in this benchmark: $ rl2tool DE-PYRAMIDIZE -db tm_jpeg.sqlite -cov tm $ sqlite3 tm_jpeg.sqlite sqlite> vacuum; sqlite> .quit $ rl2tool PYRAMIDIZE-MONOLITHIC -db tm_jpeg.sqlite -cov tm -lev 1 $ sqlite3 tm_jpeg.sqlite

Objective comparative results

Test ConfigurationFinal DB size
(including Pyramid)
PyramidizingImages Extraction
-lev 1

all Pyramid levels are physical
no virtual levels are present
302 MB12 mins 9 secs17.48 secs
-lev 2

Pyramid levels are alternatively one physical and one virtual
239 MB5 mins 2 secs17.55 secs
-lev 3

every three Pyramid levels one is physical and the following two are virtual
(exactly corresponding the the default setting)
225 MB3 mins 32 secs19.13 secs

Conclusions and final remarks

  • Not at all surprisingly explicitly setting the -lev 3 option produces exactly the same effects as before, because this one is the implicit default setting.
  • The time required to build a denser Pyramid obviously tends to significantly increase.
  • And exactly the same is for the overall size.
  • Rather surprisingly, a denser Pyramid performs only marginally better in the majority of cases being tested; once again the wonderful JPEG trade-off makes few small sized tiles to be decently good performers.
  • Anyway a denser Pyramid will surely support a smoother navigation between different arbitrary resolutions; but the difference is not as big as we were expecting, at least in the case of RGB/JPEG tiles.


2.a) Digital Elevation Model (DEM) (DATAGRID: 1 band, signed integer 16bit sample)

Input dataset

We'll use in this benchmark the well known SRTM DEM, and more precisely we'll use a reprocessed void filled sample covering the Italian peninsula.
This dataset consists in 9 ASCII Grids files and is freely available for download under the CC-BY-SA license terms:
  1. E005_N35.asc
  2. E005_N40.asc
  3. E005_N45.asc
  4. E010_N35.asc
  5. E010_N40.asc
  6. E010_N45.asc
  7. E015_N35.asc
  8. E015_N40.asc
  9. E015_N45.asc
Each single ASCII Grid corresponds to a 6,001 x 6,001 pixels image exactly covering 5 square degrees; the whole input dataset requires about 979 MB of disk storage.

SRTM Italy

Scope of this benchmark

  • Stressing the different tile sizes, encodings and compressions supported by RasterLite2.
  • Objectively measuring their comparative performances, considering both speed and space effectiveness.

Methodology

  1. a separate db-file was created and populated for each configuration being tested.
  2. then a monolithic multi-resolution Pyramid was added.
  3. finally 100 GeoTiff images at full resolution were extracted from each db-file: all exported images had different sizes and geographic positions, and exactly the same identical requests were issued on behalf on each db-file.
  4. as far as possible all timings have been measured under hot cache conditions.
The following is an excerpt of actual commands and SQL queries used in this benchmark: $ rl2tool CREATE -db srtm_lzma1024.sqlite -cov srtm -smp INT16 -pxl DATAGRID \ -cpr LZMA -srid 4326 -res 0.000833194467589 -nd -9999 -tlw 1024 -tlh 1024 $ rl2tool CREATE -db srtm_lzma1024.sqlite -cov srtm -dir . -ext asc $ rl2tool PYRAMIDIZE-MONOLITHIC -db srtm_lzma1024.sqlite -cov srtm $ export "SPATIALITE_SECURITY=relaxed" $ sqlite3 srtm_lzma1024.sqlite

Objective comparative results

Test ConfigurationDB size
(after initial loading)
Final DB size
(including Pyramid)
LoadingPyramidizingExporting
Compression: NONE
tile size: 256 x 256
659 MB662 MB5 mins 6 secs41.59 secs7.58 secs
Compression: NONE
tile size: 512 x 512
656 MB660 MB5 mins 2 secs33.66 secs8.76 secs
Compression: NONE
tile size: 1024 x 1024
656 MB660 MB4 mins 53 secs33.02 secs11.74 secs
Compression: DEFLATE
tile size: 256 x 256
192 MB196 MB5 mins 31 secs19.80 secs10.01 secs
Compression: DEFLATE
tile size: 512 x 512
190 MB194 MB5 mins 31 secs15.02 secs11.90 secs
Compression: DEFLATE
tile size: 1024 x 1024
193 MB197 MB5 mins 10 secs18.02 secs15.12 secs
Compression: LZMA
tile size: 256 x 256
147 MB151 MB13 mins 15 secs54.10 secs26.16 secs
Compression: LZMA
tile size: 512 x 512
142 MB147 MB13 mins 28 secs46.05 secs32.83 secs
Compression: LZMA
tile size: 1024 x 1024
141 MB146 MB12 mins 32 secs48.10 secs48.09 secs

Conclusions and final remarks

All compression algorithms (DEFLATE and LZMA) tested in this benchmark are of the lossless type, so any possible quality difference is certainly excluded. No data information loss will never be possible. So the unique interesting variables to be compared are size and time.

There is no real difference in measured timings between NONE and DEFLATE (NONE is actually faster, but the difference isn't an impressive one). Anyway DEFLATE has an astonishing advantage in size; so all considered it's the clear winner of this comparison.

LZMA surely ensures an even better compression, but this is at the cost of a remarkable slowness; and the really bad new is in that it's noticeably slow even while decompressing. This definitely makes LZMA to be a discouraged option, except may be in the few cases when saving even the last possible storage bit has a capital relevance.

Few interesting details worth to be noted:
  • adding a multi-resolution Pyramid (default setting) has a very limited impact on the DB-file size.
  • using different tile sizes seems to have only a very marginal impact; the default setting 512 x 512 seems to be to optimal choice.


2.b) DEM (INT16) multi-resolution Pyramid

Input dataset

Exactly the same as above.

Scope of this benchmark

  • Stressing the monolithic multi-resolution Pyramid supporting a DATAGRID INT16 Coverage.
  • Objectively measuring sizes and timings on different configurations.
  • Objectively measuring the timings required to apply Styling rules (SLD/SE RasterSymbolizer).

Methodology

  1. recycling the srtm_deflate.sqlite DB prepared in the previous benchmark (DATAGRID INT16, DEFLATE compressed, 512 x 512 tiles).
  2. then rebuilding from scratch a monolithic multi-resolution Pyramid using any alternative configuration supported by RasterLite2.
  3. finally about 150 JPEG images at different arbitrary resolutions and applying different Styling rules were extracted for each Pyramid configuration being tested: all extracted images had the same size but different resolutions and geographic positions, and exactly the same identical requests were issued on behalf on each configuration.
    The intended scope is the one to reply the typical actions performed by an user zooming in and out on different positions of a map.
The following is an excerpt of actual commands and SQL queries used in this benchmark: $ rl2tool DE-PYRAMIDIZE -db srtm_deflate.sqlite -cov srtm $ sqlite3 srtm_deflate.sqlite sqlite> vacuum; sqlite> .quit $ rl2tool PYRAMIDIZE-MONOLITHIC -db srtm_deflate.sqlite -cov srtm -lev 1 $ sqlite3 srtm_deflate.sqlite The following are visual examples of the Styling rules being tested:
SRTM Italy default       SRTM Italy color       SRTM Italy shaded relief
default
mapping elevations to grayscale
      srtm_plus
mapping elevations to false-colors
      srtm_plus_ShRel_100
mapping elevations to false-colors
and applying shaded relief

Objective comparative results

Test ConfigurationFinal DB size
(including Pyramid)
PyramidizingStyling:
default
Styling:
color rules
Styling:
shaded relief
-lev 1

all Pyramid levels are physical
no virtual levels are present
260 MB48.66 secs11.07 secs14.00 secs1 min 5 secs
-lev 2

Pyramid levels are alternatively one physical and one virtual
206 MB16.50 secs11.21 secs14.99 secs1 min 6 secs
-lev 3

every three Pyramid levels one is physical and the following two are virtual
(exactly corresponding the the default setting)
194 MB10.48 secs12.02 secs15.90 secs1 min 8 secs

Conclusions and final remarks

  • Explicitly setting the -lev 3 option produces exactly the same effects as before, because this corresponds to the default setting.
  • The time required to build a denser Pyramid obviously tends to significantly increase, and exactly the same is for the overall size.
  • Rather surprisingly, a denser Pyramid performs only marginally better in the majority of cases being tested.
  • Anyway a denser Pyramid will surely support a smoother navigation between different arbitrary resolutions; but the average difference in timings is not as big as we were expecting.
  • Applying a rendering Style based on false-color rules doesn't seem to imply any relevant cost (i.e. it's an efficient process).
  • Anyway applying a rendering Style requiring shaded relief certainly is a more demanding task, and the corresponding timings are significantly slower.
    The good new is in that all DEM-rendering related algorithms could be rather easily implemented by adopting multi-threaded parallel processing; and this advanced option will be surely supported by some future version of RasterLite2.


3.a) Panchromatic Satellite Imagery (GRAYSCALE: 1 band, unsigned integer 16bit sample)

Input dataset

We'll use in this benchmark the well known Landsat 8 imagery only considering its high-resolution panchromatic band (B8: 15m / pixel). So we'll process a single Landsat8 scene:
  1. LC81920292013183LGN00_B8.TIF
This GeoTIFF corresponds to a 15,301 x 15,581 pixels image requiring about 454 MB of disk storage.

Landsat8

Scope of this benchmark

  • Stressing the different encodings and compressions supported by RasterLite2.
  • Objectively measuring their comparative performances, considering both speed and space effectiveness.
Please note: this benchmark is very similar to the previous one, because the internal encoding is always is the same in both cases, i.e. DATAGRID 16bit; anyway the statistical distribution of pixel values is completely different.

Methodology

  1. a separate db-file was created and populated for each configuration being tested.
  2. then a monolithic multi-resolution Pyramid was added.
  3. finally 120 GeoTiff images at full resolution were extracted from each db-file: all exported images had different sizes and geographic positions, and exactly the same identical requests were issued on behalf on each db-file.
  4. as far as possible all timings have been measured under hot cache conditions.
The following is an excerpt of actual commands and SQL queries used in this benchmark: $ rl2tool CREATE -db landsat_none.sqlite -cov landsat8 -smp UINT16 \ -pxl DATAGRID -cpr NONE -srid 32632 -res 15 -nd 0 $ rl2tool IMPORT -db landsat_none.sqlite -cov landsat8 \ -src ./LC81920292013183LGN00_B8.TIF $ rl2tool PYRAMIDIZE-MONOLITHIC -db landsat_none.sqlite -cov landsat8 $ export "SPATIALITE_SECURITY=relaxed" $ sqlite3 landsat_none.sqlite

Objective comparative results

Test ConfigurationDB size
(after initial loading)
Final DB size
(including Pyramid)
LoadingPyramidizingExporting
Compression: NONE
tile size: 512 x 512
472 MB476 MB2 mins 26 secs7.40 secs12.16 secs
Compression: DEFLATE
tile size: 512 x 512
268 MB272 MB2 mins 5 secs10.45 secs14.93 secs
Compression: LZMA
tile size: 512 x 512
241 MB245 MB7 mins 20 secs1 min 2 secs44.32 secs

Conclusions and final remarks

Same conclusions as in the previous benchmark: even in the case of Landsat8 panchromatic imagery DEFLATE ensures a noticeable storage saving at the cost of a very bland performance loss.
LZMA definitely confirms its intrinsic slowness either when compressing and while decompressing. The storage saving it certainly ensures is too much expensive in computational terms to be really interesting.


3.b) Grayscale (UINT16) multi-resolution Pyramid

Input dataset

Exactly the same as above.

Scope of this benchmark

  • Stressing the monolithic multi-resolution Pyramid supporting a DATAGRID UINT16 Coverage.
  • Objectively measuring sizes and timings on different configurations.
  • Objectively measuring the timings required to apply Styling rules (SLD/SE RasterSymbolizer).

Methodology

  1. recycling the landsat_deflate.sqlite DB prepared in the previous benchmark (DATAGRID UINT16, DEFLATE compressed, 512 x 512 tiles).
  2. then rebuilding from scratch a monolithic multi-resolution Pyramid using any alternative configuration supported by RasterLite2.
  3. finally about 150 JPEG images at different arbitrary resolutions and applying different Styling rules (contrast enhancements) were extracted for each Pyramid configuration being tested: all extracted images had the same size but different resolutions and geographic positions, and exactly the same identical requests were issued on behalf on each configuration.
    The intended scope is the one to reply the typical actions performed by an user zooming in and out on different positions of a map.
The following is an excerpt of actual commands and SQL queries used in this benchmark: $ rl2tool DE-PYRAMIDIZE -db landsat_deflate.sqlite -cov srtm $ sqlite3 landsat_deflate.sqlite sqlite> vacuum; sqlite> .quit $ rl2tool PYRAMIDIZE-MONOLITHIC -db landsat_deflate.sqlite -cov srtm -lev 1 $ sqlite3 landsat_deflate.sqlite The following are visual examples of the Styling rules (contrast enhancement) being tested:
Landsat default       Landsat8 gamma       Landsat8 histogram       Landsat8 normalize
default       gamma 2.5       histogram       normalize

Objective comparative results

Test ConfigurationFinal DB size
(including Pyramid)
PyramidizingStyling:
default
Styling:
gamma 2.5
Styling:
histogram
Styling:
normalize
-lev 1

all Pyramid levels are physical
no virtual levels are present
357 MB55.33 secs9.96 secs10.09 secs10.06 secs10.07 secs
-lev 2

Pyramid levels are alternatively one physical and one virtual
286 MB19.26 secs10.25 secs10.45 secs10.43 secs10.38 secs
-lev 3

every three Pyramid levels one is physical and the following two are virtual
(exactly corresponding the the default setting)
272 MB11.15 secs14.01 secs14.80 secs14.75 secs14.50 secs

Conclusions and final remarks

  • Exactly as we've already seen in any other previous benchmark the time required to build a denser Pyramid tends to significantly increase, and the same is for the overall size.
  • The differences in timings required by applying different contrast enhancement algorithms are practically negligible. So systematically choosing the higher quality and better looking normalize algorithm doesn't imply any further computational cost.


4.a) RGB + IR Aerial Imagery (MULTIBAND: 4 bands, unsigned integer 8bit samples)

Input dataset

Aerial imagery supporting standard RGB bands plus an extra Near InfraRed (NIR) band is quickly becoming widespread in recent times.
The extra NIR band allows visualizing false colors images, thus making an easier task differentiating and correctly recognizing the vegetation and the water bodies.
This specific kind of aerial imagery is a very popular option for many remote sensing projects related to agricultural activities.

In the current benchmark we'll use a NAIP quadrant freely distributed by Indiana University; and most precisely we'll download the following four GeoTIFF images:
  1. m_3808409_ne_16_1_20120607
  2. m_3808409_nw_16_1_20120607
  3. m_3808409_se_16_1_20120607
  4. m_3808409_sw_16_1_20120607
Each GeoTIFF corresponds to a 6,180 x 7,600 pixels image; the whole quadrant requires about 720 MB of disk storage.

NAIP

Scope of this benchmark

  • Stressing the different encodings and compressions supported by RasterLite2.
  • Objectively measuring their comparative performances, considering both speed and space effectiveness.

Methodology

  1. a separate db-file was created and populated for each configuration being tested.
  2. then a monolithic multi-resolution Pyramid was added.
  3. finally 100 GeoTiff images at full resolution were extracted from each db-file: all exported images had different sizes and geographic positions, and exactly the same identical requests were issued on behalf on each db-file.
  4. as far as possible all timings have been measured under hot cache conditions.
The following is an excerpt of actual commands and SQL queries used in this benchmark: $ rl2tool CREATE -db indiana_none.sqlite -cov naip -smp UINT8 \ -pxl MULTIBAND -bds 4 -cpr NONE -srid 26916 -res 1 $ rl2tool IMPORT -db indiana_none.sqlite -cov naip -dir . -ext tif $ rl2tool PYRAMIDIZE-MONOLITHIC -db indiana_none.sqlite -cov naip $ export "SPATIALITE_SECURITY=relaxed" $ sqlite3 indiana_none.sqlite

Objective comparative results

Test ConfigurationDB size
(after initial loading)
Final DB size
(including Pyramid)
LoadingPyramidizingExporting
Compression: NONE
tile size: 512 x 512
788 MB797 MB1 mins 27 secs16.50 secs27.01 secs
Compression: DEFLATE
tile size: 512 x 512
633 MB642 MB2 mins 10 secs25.38 secs34.21 secs
Compression: LZMA
tile size: 512 x 512
556 MB565 MB11 mins 53 secs1 min 52 secs2 mins 17 secs

Conclusions and final remarks

More or less we still continue noticing the same general trends already seen on the last two benchmarks. Anyway in this specific case both DEFLATE and LZMA are unable to reach high compression ratios as we were probably expecting; but there is very clear explanation for all this:
  • all lossless compression algorithms are basically intended to reduce any redundancy found in input data; and consequently:
    • data presenting a rather poor internal variance and possibly containing many repeated sequences will be compressed in a very effective way.
    • data presenting a very rich and highly dynamic internal variance will be compressed very poorly.
  • Color photographies of natural subjects usually present an impressive internal variance; thus it's not at all surprising to discover that they couldn't be efficiently compressed by DEFLATE or LZMA.
    Unhappily the alternative lossy compression algorithms specifically intended to support an efficient compression for photographic images (e.g. JPEG or WEBP) don't support multi-band imagery; so DEFLATE and LZMA still remain the unique available options.


4.b) MULTIBAND (UINT8, 4 bands) multi-resolution Pyramid

Input dataset

Exactly the same as above.

Scope of this benchmark

  • Stressing the monolithic multi-resolution Pyramid supporting a MULTIBAND (4 bands) UINT8 Coverage.
  • Objectively measuring sizes and timings on different configurations.
  • Objectively measuring the timings required to apply Styling rules (SLD/SE RasterSymbolizer).

Methodology

  1. recycling the indiana_deflate.sqlite DB prepared in the previous benchmark (MULTIBAND UINT8, DEFLATE compressed, 512 x 512 tiles).
  2. then rebuilding from scratch a monolithic multi-resolution Pyramid using any alternative configuration supported by RasterLite2.
  3. finally about 100 JPEG images at different arbitrary resolutions and applying different Styling rules (band selection) were extracted for each Pyramid configuration being tested: all extracted images had the same size but different resolutions and geographic positions, and exactly the same identical requests were issued on behalf on each configuration.
    The intended scope is the one to reply the typical actions performed by an user zooming in and out on different positions of a map.
The following is an excerpt of actual commands and SQL queries used in this benchmark: $ rl2tool DE-PYRAMIDIZE -db indiana_deflate.sqlite -cov naip $ sqlite3 indiana_deflate.sqlite sqlite> vacuum; sqlite> .quit $ rl2tool PYRAMIDIZE-MONOLITHIC -db indiana_deflate.sqlite -cov naip -lev 1 $ sqlite3 indiana_deflate.sqlite The following are visual examples of the Styling rules (band selection) being tested:
NAIP default       NAIP Red+Green+Blue       NAIP InfraRed+Red+Green       NAIP Green+Red+InfraRed
default
band #0 (Red) as grayscale
      RGB
natural colors
      false colors
NIR + R + G bands
      false colors
G + R + NIR bands

Objective comparative results

Test ConfigurationFinal DB size
(including Pyramid)
PyramidizingStyling:
default
Styling:
RGB
Styling:
NIR+R+G
Styling:
G+R+NIR
-lev 1

all Pyramid levels are physical
no virtual levels are present
819 MB1 min 26 secs14.88 secs17.00 secs17.12 secs17.14 secs
-lev 2

Pyramid levels are alternatively one physical and one virtual
670 MB35.67 secs15.41 secs17.89 secs18.14 secs17.95 secs
-lev 3

every three Pyramid levels one is physical and the following two are virtual
(exactly corresponding the the default setting)
642 MB22.46 secs22.72 secs25.69 secs25.44 secs25.28 secs

Conclusions and final remarks

  • Exactly as we've already seen in any other previous benchmark the time required to build a denser Pyramid tends to significantly increase, and the same is for the overall size. Anyway in this specific case the poor compression ratio implies bigger sizes, and consequently longer times due to the obvious impact on the I/O sub-system.
  • The differences in timings required by applying different band selections are negligible for any practical purpose.
    Please note: the default test performs marginally faster simply because it handles just a single band instead of three.


5.a) 1-BIT topographical maps (MONOCHROME)

Input dataset

We'll use exactly the same GeoTIFF files we've already encountered in the trento-ctr tutorial.

Scope of this benchmark

  • Stressing the different encodings and compressions supported by RasterLite2.
  • Objectively measuring their comparative performances, considering both speed and space effectiveness.

Methodology

  1. a separate db-file was created and populated for each configuration being tested.
  2. then a monolithic multi-resolution Pyramid was added.
  3. finally 120 GeoTiff images at full resolution were extracted from each db-file: all exported images had different sizes and geographic positions, and exactly the same identical requests were issued on behalf on each db-file.
  4. as far as possible all timings have been measured under hot cache conditions.
The following is an excerpt of actual commands and SQL queries used in this benchmark: $ rl2tool CREATE -db mono_fax4.sqlite -cov mono -smp 1-BIT \ -pxl MONOCHROME -cpr FAX4 -srid 25832 -res 0.67730 $ rl2tool IMPORT -db mono_fax4.sqlite -cov mono -srid 25832 \ -dir . -ext tif $ rl2tool PYRAMIDIZE-MONOLITHIC -db mono_fax4.sqlite -cov mono $ export "SPATIALITE_SECURITY=relaxed" $ sqlite3 mono_fax4.sqlite

Objective comparative results

Test ConfigurationDB size
(after initial loading)
Final DB size
(including Pyramid)
LoadingPyramidizingExporting
Compression: NONE
tile size: 512 x 512
111 MB200 MB49.37 secs4 mins 1 sec7.58 secs
Compression: PNG
tile size: 512 x 512
38.6 MB128 MB1 mins 10 secs4 mins 59 secs8.47 secs
Compression: FAX4
tile size: 512 x 512
29.8 MB119 MB56.16 secs4 mins 59 secs7.36 secs

Conclusions and final remarks

1-bit MONOCHROME samples are rather exceptional under many aspects:
  • 8 pixels can be directly packed into a single byte; and this implies that even uncompressed tiles (NONE) will require a surprising limited storage amount.
  • both PNG and FAX4 algorithms support good compression ratios, and are fast performers either while compressing and when decompressing.
    Both supports very similar performances, difference are practically marginal; anyway the more specialized FAX4 (specifically intended for monochromatic tiles) is surely the best available option under any possible aspect.
  • the monolithic Pyramid in the specific case of 1-bit samples always requires a substantial storage amount. This is directly related to the very limited variance intrinsic in 1-bit; simple/naive downsampling (aka rescaling) algorithms in this case offer a really unpleasant and sacrificed visual quality.
    A by far better visual quality is supported by RasterLite2 for rescaled images based on 1-bit samples; but this necessarily implies adopting more sophisticated algorithms based on interpolation. And in turn interpolated values imply scaling-up to Grayscale UINT8 samples, thus requiring many more storage space for any upper level of the multi-resolution Pyramid except the first one (corresponding to full resolution).
    The following two figures will definitely clarify this critical point.
monochromatic simple downsampling
This first figure exactly corresponds to a rescaled 1-bit image produced by another sw tool adopting a simpler and unsophisticated downsampling algorithm.
As you can easily notice, the visual quality is indecently poor, and any fine grained detail has gone completely lost when rescaling; this one isn't a map, it simply is meaningless digital noise.

monochromatic interpolated downsampling
This second figure exactly corresponds to a rescaled 1-bit image produced by RasterLite2 by applying a more advanced algorithm based on halftone interpolated pixels (Grayscale: 256 shades of gray). The difference between the two alternative approaches is self-explanatory.


5.b) 1-BIT (MONOCHROME) multi-resolution Pyramid

Input dataset

Exactly the same as above.

Scope of this benchmark

  • Stressing the monolithic multi-resolution Pyramid supporting a MONOCHROME (1-BIT) Coverage.
  • Objectively measuring sizes and timings on different configurations.
  • Objectively measuring the timings required to apply Styling rules (SLD/SE RasterSymbolizer).

Methodology

  1. recycling the mono_fax4.sqlite DB prepared in the previous benchmark (MONOCHROME 1-BIT, FAX4 compressed, 512 x 512 tiles).
  2. then rebuilding from scratch a monolithic multi-resolution Pyramid using any alternative configuration supported by RasterLite2.
  3. finally about 100 JPEG images at different arbitrary resolutions and applying different Styling rules (re-coloring) were extracted for each Pyramid configuration being tested: all extracted images had the same size but different resolutions and geographic positions, and exactly the same identical requests were issued on behalf on each configuration.
    The intended scope is the one to reply the typical actions performed by an user zooming in and out on different positions of a map.
The following is an excerpt of actual commands and SQL queries used in this benchmark: $ rl2tool DE-PYRAMIDIZE -db mono_fax4.sqlite -cov mono $ sqlite3 mono_fax4.sqlite sqlite> vacuum; sqlite> .quit $ rl2tool PYRAMIDIZE-MONOLITHIC -db mono_fax4.sqlite -cov mono -lev 1 $ sqlite3 mono_fax4.sqlite The following are visual examples of the Styling rules (re-coloring) being tested:
mono default       mono red
default
black and transparency
      re-colored
red and transparency

Objective comparative results

Test ConfigurationFinal DB size
(including Pyramid)
PyramidizingStyling:
default
Styling:
Red
-lev 1

all Pyramid levels are physical
no virtual levels are present
119 MB4 mins 50 secs10.79 secs16.02 secs
-lev 2

Pyramid levels are alternatively one physical and one virtual
93.4 MB3 mins 36 secs11.65 secs18.42 secs
-lev 3

every three Pyramid levels one is physical and the following two are virtual
(exactly corresponding the the default setting)
86.2 MB3 mins 22 secs13.72 secs18.09 secs

Conclusions and final remarks

  • Please, pay close attention: in the case of 1-bit monochrome samples the default setting when building a monolithic Pyramid is -lev 1, and not -lev 3 as in any other different case.
    This is because in this special case using virtual Pyramid level will impair the interpolation algorithm thus producing worst visual results; and RasterLite2 always attempts to preserve the best possible visual quality.
  • Anyway, exactly as we've already seen in any other previous benchmark the time required to build a denser Pyramid tends to significantly increase, and the same is for the overall size. Anyway in this specific case, due to intrinsic requirements of the hi-quality interpolated rescaled levels, the multi-resolution Pyramid will require paradoxically more storage space than the full resolution level itself.
  • A clearly noticeable overhead is required when applying some re-colored style, but the implied computational cost seems to be fairly reasonable.



Back to RasterLite2 doc index Z 2e9c9627494548287876697415092890