On Wed, 13 Sep 2017 09:01:18 -0700 (PDT), VIns D wrote:
> Hi,
>
> I am testing Spatialite/rasterlite2. I have got a couple of JPEG
> images which have the same properties, resolution... that I would
> like
> to store using rasterlite2. (example in attachment)
>
> Problem: when trying to store my rasters I have got the following
> error_ (*** Error in `sqlite3': double free or corruption
> (fasttop))_.
> Perhaps my coverage is not defined correctly?
>
Hi,
receiving a "double free" message isn't a trivial error as many
others; it'ss a very serious symptom of some critical bug, and it
usually causes a sudden program crash due to heavily corrupted
memory (as it actually happens in your specific case).
note: you are testing a desperately obsolete version of RasterLite2.
the current development version is 1.1.0-devel, and it strictly
requires
libspatialite 4.5.0-devel.
if you really intend to perform any serious testing you necessarily
have to perform a custom build starting from the current sources
available from Fossil repositories.
the updated documentation about SQL functions is here:
https://www.gaia-gis.it/fossil/librasterlite2/wiki?name=sql_reference_list
coming to your sample: there is an obvious glitch in your workflow,
and I strongly suspect that it's the most reasonable cause
triggering the above bug.
all JPEG rasters always lack georeferencing informations (not
natively supported by the image format itself), so RasterLite2
always expects to get a reference to a companion WorldFile (*.jgw
suffix in the case of JPEG) when executing RL2_LoadRaster(); but
it completely lacks in your example, so you'll end up by
attempting to import a raster presenting undefined georeferencing,
and this can easily cause a severe malfunction.
> I believed the coverage pixel size coverage was not setup correctly
> so I have tried rl2sniff which wouldn't help in this case:
> ------------ <snip> -------------
As you can easily notice the "srid", "x_resolution", "y_resolution",
"min_x", "min_y", "max_x" and "max_y" columns are empty (=undefined).
the obvious cause is once again the absence of the expected
companion *.jgw WorldFile.
> I am wrong with the pixel size or the sample type "UINT8" ?
>
it's correct: JPEG images are usually base on 8-bit band
components.
> I have tried on a Windows machine and got an error as well.
>
not surprisingly, because the bug strictly depends on the
absence of a companion WorldFile, and this obviously is
a platform independent critical factor.
=========
I've quickly tested your sample on rasterlite2-1.1.0-devel,
and anything ran smoothly (once created an appropriate
WorldFile, a very trivial task just requiring some text
editor).
here is the exact log of my SQL queries:
---------------------------------------------------------
SELECT CreateRasterCoveragesTable();
SELECT RL2_CreateRasterCoverage('mycoverage','UINT8', 'RGB', 3,
'JPEG', 80, 512, 512, 4326, 0.0000045);
SELECT RL2_LoadRaster('mycoverage',
'c:/sandro_tests/test_image_9.jpg',
1, 4326, 1, 1);
SELECT SE_UpdateRasterCoverageExtent('mycoverage');
---------------------------------------------------------
you'll find attached to this mail:
1. the JPG WorldFile required by RasterLite2 for importing
JPEG files
2. a screenshot exemplifying a magnified detail of your
JPEG as shown by the new Map tool supported by
spatialite_gui-2.1.0-devel
bye Sandro