spatialite storing raster data

296 views
Skip to first unread message

Yogesh

unread,
Jun 26, 2012, 10:41:09 PM6/26/12
to spatiali...@googlegroups.com
I want to store geotiff data to spatialite database. I am using gdal to read metadata and 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 in spatialite GUI 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(from librasterlite) 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). 

Programming Environment - c++

Thanks

Jukka Rahkonen

unread,
Jun 27, 2012, 2:31:27 AM6/27/12
to spatiali...@googlegroups.com
You can use gdal_translate directly if your input is in any format supported by GDAL. Driver is documented in http://www.gdal.org/frmt_rasterlite.html and most simple command to test it is something like
gdal_translate -of rasterlite test.tif test.sqlite

For real use overviews are needed. Gdaladdo is a tool for that or then you can use rasterlite_pyramid utility.
Spatialite-gui shows me the tile as an image with the Blob explorer tool. Tool appears by doing right click on top of a blob in the query result area. Quantum GIS shows rasterlite tables created by GDAL usually nice, but QGis may come with too old sqlite3.dll file and then you will see only a black box.

For me gdal_translate has worked rather well. There were some troubles in creating Rasterlite databases with several raster tables but I think Even Rouault fixed them in GDAL trunk version. Gdal-dev mailing list has also been very responsive for my rasterlite questions.

-Jukka Rahkonen-

Yogesh

unread,
Jun 27, 2012, 5:36:50 AM6/27/12
to spatiali...@googlegroups.com
Is'nt there any api because i tried rasterlite_load binary it was creating table and i was able to explore it. But when I build it myself there were runtime memory leak errors.
I am working on some project which requires this feature(using c++) so i have to ultimately integrate source code for any of binary utility out there. After trying with rasterlite_load i am thinking of writing something by myself. I am able to populate blob with hexwkb of image data but explorer and qgis are not able to visulaize the data.
So now the problem is only that what should be the format of storing tiles in blob column so that qgis and spatialite-gui are able to load it.
Thanks
Reply all
Reply to author
Forward
0 new messages