Starting with GDAL 1.7.0, the Rasterlite driver allows reading and creating Rasterlite databases.
Those databases can be produced by the utilities of the
rasterlite distribution,
such as rasterlite_load, rasterlite_pyramids, ....
The driver supports reading grayscale, paletted and RGB images stored as GIF, PNG, TIFF or JPEG tiles.
The driver also supports reading overviews/pyramids, spatial reference system and spatial extent.
GDAL/OGR must be compiled with OGR SQLite driver support. For read support, linking against spatialite library is not required, but recent enough sqlite3 library is needed to read rasterlite databases. rasterlite library is not required either.
For write support a new table, linking against spatialite library *is* required.
Although the Rasterlite documentation only mentions GIF, PNG, TIFF, JPEG and WAVELET (EPSILON driver) as compression formats for tiles, the driver supports reading and writing internal tiles in any format handled by GDAL. Furthermore, the Rasterlite driver also allow reading and writing as many bands and as many band types as supported by the driver for the internal tiles.
where :
The driver can create a new database if necessary, create a new raster table if necessary and copy a source dataset into the specified raster table.
If data already exists in the raster table, the new data will be added. You can use the WIPE=YES creation options to erase existing data.
The driver does not support updating a block in an existing raster table. It can only append new data.
Syntax for the name of the output dataset: 'RASTERLITE:rasterlitedb_name,table=raster_table_prefix' or 'rasterlitedb_name'
It is possible to specify only the DB name as in the later form, but only if the database does not already exists. In that case, the raster table name will be base on the DB name itself.
The driver supports building (if the dataset is opened in update mode) and reading internal overviews.
If no internal overview is detected, the driver will try using external overviews (.ovr files).
$ gdalinfo rasterlitedb.sqlite -noctOutput:
Driver: Rasterlite/Rasterlite Files: rasterlitedb.sqlite Size is 7200, 7200 Coordinate System is: GEOGCS["WGS 84", DATUM["WGS_1984", SPHEROID["WGS 84",6378137,298.257223563, AUTHORITY["EPSG","7030"]], AUTHORITY["EPSG","6326"]], PRIMEM["Greenwich",0, AUTHORITY["EPSG","8901"]], UNIT["degree",0.01745329251994328, AUTHORITY["EPSG","9122"]], AUTHORITY["EPSG","4326"]] Origin = (-5.000000000000000,55.000000000000000) Pixel Size = (0.002083333333333,-0.002083333333333) Metadata: TILE_FORMAT=GIF Image Structure Metadata: INTERLEAVE=PIXEL Corner Coordinates: Upper Left ( -5.0000000, 55.0000000) ( 5d 0'0.00"W, 55d 0'0.00"N) Lower Left ( -5.0000000, 40.0000000) ( 5d 0'0.00"W, 40d 0'0.00"N) Upper Right ( 10.0000000, 55.0000000) ( 10d 0'0.00"E, 55d 0'0.00"N) Lower Right ( 10.0000000, 40.0000000) ( 10d 0'0.00"E, 40d 0'0.00"N) Center ( 2.5000000, 47.5000000) ( 2d30'0.00"E, 47d30'0.00"N) Band 1 Block=480x480 Type=Byte, ColorInterp=Palette Color Table (RGB with 256 entries)
$ gdalinfo multirasterdb.sqliteOutput:
Driver: Rasterlite/Rasterlite Files: Size is 512, 512 Coordinate System is `' Subdatasets: SUBDATASET_1_NAME=RASTERLITE:multirasterdb.sqlite,table=raster1 SUBDATASET_1_DESC=RASTERLITE:multirasterdb.sqlite,table=raster1 SUBDATASET_2_NAME=RASTERLITE:multirasterdb.sqlite,table=raster2 SUBDATASET_2_DESC=RASTERLITE:multirasterdb.sqlite,table=raster2 Corner Coordinates: Upper Left ( 0.0, 0.0) Lower Left ( 0.0, 512.0) Upper Right ( 512.0, 0.0) Lower Right ( 512.0, 512.0) Center ( 256.0, 256.0)
$ gdalinfo RASTERLITE:multirasterdb.sqlite,table=raster1
$ gdal_translate -of Rasterlite source.tif RASTERLITE:my_db.sqlite,table=source -co DRIVER=JPEG
$ gdaladdo RASTERLITE:my_db.sqlite,table=source 2 4 8 16
$ gdaladdo -clean RASTERLITE:my_db.sqlite,table=source
$ gdaladdo -ro RASTERLITE:my_db.sqlite,table=source 2 4 8 16
See Also: