Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to cache my raster data(large geotiff files) on local database. I thought to use spatialite. I found librasterlite which provide functionality to do that.

Can anybody point to some tutorial on it. Or is there any other alternative.

Programming environment - C++

I want to store geotiff data to spatialite database. I am using gdal to read metadata and reading tiles converting them to hexwkb format and storing it in raster table (id (integer) and raster (blob) as columns).Table is created but when i am opening my database and select raster data column it shows nothing. I mean i can not explore data and see the tile image. Can any body tell me what should be the format in which we should store the tiled data. Are there any function which can automate these things. Like I tried to integrate rasterlite_load in my code but there were memory leakage in the code. Is there any function in spatialite or rasterlite which can take char buffer of tiled image and store it into blob data type in table (and corresponding function for reading).

share|improve this question
Here is a 20 page tutorial, – klewis Jun 24 '12 at 14:23
You might have better luck asking the Spatialite folks directly. You can also query the forum posts.!forum/spatialite-users – klewis Jun 26 '12 at 22:21

You could try compiling gdal with spatialite support or storing entire tiffs in a blob column.

See spatialite driver docs:

Then you can use gdal_translate:

gdal_translate -of Rasterlite source.tif RASTERLITE:my_db.sqlite,table=source
share|improve this answer

There is a rewrite, librasterlite2, available at , which is "intended to completely replace the superseded librasterlite".

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.