Rasterlite2 - rl2tool catalog - no Rasterlite-2 datasources found - wmslite - doesn't contain any valid Raster Coverage

102 views
Skip to first unread message

khanh dinh

unread,
Sep 15, 2017, 11:20:50 AM9/15/17
to SpatiaLite Users
Hi,

I have an issue while importing JPG in sqlite3.

I'rm running Debian linux

#  rl2tool catalog -db test10.sqlite

rl2tool; request is CATALOG
===========================================================
DB path: test10.sqlite
===========================================================
     SQLite version: 3.16.2
 SpatiaLite version: 4.3.0a
RasterLite2 version: 1.0.0-devel
no Rasterlite-2 datasources found
restoring the DB to its previous state (ROLLBACK)


---------------------------------------------------------------------------------------------------------
samething with wmslite ( failed)


N:\\SQLITE-Spatiale>wmslite -db test10.sqlite
======================================================
              WmsLite server startup
======================================================
         SQLite version: 3.8.5
     SpatiaLite version: 4.2.0
    RasterLite2 version: 1.0.0-rc0
======================================================
the DB "test10.sqlite" doesn't contain any valid Raster Coverage
wmslite server shutdown in progress
wmslite shutdown completed ... bye bye

N:\\SQLITE-Spatiale>





My Db was created with the following steps
------------------------------------------------------------------------------------------------------
1) create image
     jpggdal_translate -of JPEG -projwin 115.40063 -31.20215 115.42724 -31.22502 parameters.xml Perth-new/Perth_image_1.jpg

-------------------------------------------------------------------------------------------------
 file parameters.xml
<GDAL_WMS>
    <Service name="WMS">
        <Version>1.1.1</Version>
        <ServerUrl>https://services.slip.wa.gov.au/public/services/SLIP_Public_Services/Locate/MapServer/WMSServer?</ServerUrl>
        <SRS>EPSG:4326</SRS>
        <ImageFormat>image/tiff</ImageFormat>
        <Layers>1%2C2%2C3</Layers>
    </Service>
    <DataWindow>
        <SizeX>80000000</SizeX>
        <SizeY>40000000</SizeY>
    </DataWindow>
    <Cache>
        <Path>./gdalwmscache</Path>
        <Depth>2</Depth>
        <Extension>.jpg</Extension>
    </Cache>
    <MaxConnections>2</MaxConnections>
    <Timeout>300</Timeout>
    <UnsafeSSL>true</UnsafeSSL>
    <BlockSizeX>1024</BlockSizeX>
    <BlockSizeY>1024</BlockSizeY>
    <Projection>EPSG:4326</Projection>
    <BandsCount>3</BandsCount>
    <ClampRequests>false</ClampRequests>
     <UserAgent>GDAL WMS driver (http://www.gdal.org/frmt_wms.html)</UserAgent>
</GDAL_WMS>

--------------------------------------------------------------------------------------------------------------

2) I get the image file 

# ls  Perth_image_1.*
Perth_image_1.jpg  Perth_image_1.jpg.aux.xml  Perth_image_1.wld
----------------------------------------------------------------------------------------------------------------
3) import to DB sqlite3

root@vmi94019:/home/khanh/image# sqlite3 test4.sqlite < /tmp/aa.sql
SELECT load_extension('mod_rasterlite2');
SELECT load_extension('mod_spatialite');
SELECT InitSpatialMetadata(1);
1
SELECT CreateRasterCoveragesTable();
1
SELECT CreateStylingTables();
1
SELECT RL2_SetMaxThreads(4);
4
SELECT RL2_GetMaxThreads();
4
SELECT RL2_CreateRasterCoverage('Perth-new/Perth_image_1','UINT8', 'RGB', 3, 'JPEG', 80, 512, 512, 4326, 0.0000045);
1
SELECT RL2_LoadRaster('Perth-new/Perth_image_1', 'Perth-new/Perth_image_1.jpg',1, 4326, 1, 1);
------------------
Importing: Perth-new/Perth_image_1.jpg
    Image Size (pixels): 5913 x 5082
                   SRID: 4326
       LowerLeft Corner: X=115.40 Y=-31.23
      UpperRight Corner: X=115.43 Y=-31.20
       Pixel resolution: X=0.0000045 Y=0.0000045
>> Image successfully imported in: 0 mins 02 secs
1
SELECT SE_UpdateRasterCoverageExtent('Perth-new/Perth_image_1');
1

------------------------------------------------------------------------------

My question :
Did I have done something wrong with import to sqlite or while I'm generating the jpeg file ?


Need some help
   

  
    
     
test10.sqlite

a.fu...@lqt.it

unread,
Sep 15, 2017, 12:22:20 PM9/15/17
to spatiali...@googlegroups.com
On Fri, 15 Sep 2017 08:20:50 -0700 (PDT), khanh dinh wrote:
> Hi,
>
> I have an issue while importing JPG in sqlite3.
>
> I'rm running Debian linux
>
> rl2tool; request is CATALOG
>      SQLite version: 3.16.2
>  SpatiaLite version: 4.3.0a
> RasterLite2 version: 1.0.0-devel
>
> samething with wmslite ( failed)
>          SQLite version: 3.8.5
>      SpatiaLite version: 4.2.0
>     RasterLite2 version: 1.0.0-rc0
>


Hi Khanh,

it seems that you are using tools of different
generations casually mixed more or less at random:
it's clearly evident from your post that rl2tool
and wmslite are based on libraries of completely
different versions.

this one is a _VERY_ dangerous approach, because
librasterlite2 quickly evolved during last years/months,
sometimes completely breaking backward compatibility
for both the API and the DB layout.

never forget: librasterlite2 has not yet reached its
"stable" configuration, so carefully checking that all
sw tools you are using belong to same generation is
an absolutely mandatory pre-requisite.

_AND_ you must carefully avoid at the same time to use
any DB created by previous versions of libspatialite
and/or librasterlite2, because the expected layout of
several DB tables may have suddenly changed in the
meanwhile.

hint:
if you intend to perform any serious testing on
RasterLite2 you necessarily have to build your
own binaries starting from the latest version
of the "development" sources available from the
Fossil repositories (then frequently updating
every time that a further commit will become
available).

note:
- the version of librasterlite2 under current
development is 1.1.0-devel
- which in turn strictly requires using
libspatialite-4.5.0-devel

bye Sandro


bye Sa

khanh dinh

unread,
Sep 15, 2017, 5:24:25 PM9/15/17
to SpatiaLite Users
Hi Sandro,

Thank a lot for your big help.
I just want to import my map in the sqlite DB file and I'm running Linux Debian.
My librasterlite2 is the version 1.0.0-devel as I can see with rl2tool

root@vmi94019:/home/khanh/image#  rl2tool catalog -db test10.sqlite

rl2tool; request is CATALOG
===========================================================
DB path: test10.sqlite
===========================================================
     SQLite version: 3.16.2
 SpatiaLite version: 4.3.0a
RasterLite2 version: 1.0.0-devel
no Rasterlite-2 datasources found
restoring the DB to its previous state (ROLLBACK)
root@vmi94019:/home/khanh/image#


Could you provide some tips to get it from the fossil repositories ?
Is there any Rasterlite 1.1.0-devel already in binairies or do I have to compile it ?

Khanh


khanh dinh

unread,
Sep 15, 2017, 6:13:27 PM9/15/17
to SpatiaLite Users

HI Sandro,

I'm able to get the source for Rasterlite2.
and I compile it and now I get the desire version

sqlite> SELECT load_extension('mod_rasterlite2');
sqlite> select RL2_version();
1.1.0-devel
sqlite>
 

Could you tell me if I also need to recompile the libspatialite to get the version 4.5.0-devel ?

Khanh

khanh dinh

unread,
Sep 15, 2017, 7:00:32 PM9/15/17
to SpatiaLite Users
Hi Sandro,


I'm able to compile libspatialite 4.5;
Now I get  Rasterlite2_1.1.0-devel
I make an import into Sqlite DB but I get an error while trying with wmslite
wmslite was generated with the compilation from Rasterlite2 (3 tools after the compilation rl2tool, rl2sniff ans wmslite)


root@docker-test:/home/khanh/image/Perth-new# LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
root@docker-test:/home/khanh/image/Perth-new# export LD_LIBRARY_PATH
root@docker-test:/home/khanh/image/Perth-new# export SPATIALITE_SECURITY=relaxed
root@docker-test:/home/khanh/image/Perth-new# sqlite3 test40.sqlite < /tmp/aa.sql
SELECT load_extension('mod_rasterlite2');
SELECT load_extension('mod_spatialite');
SELECT InitSpatialMetadata(1);
1
SELECT CreateRasterCoveragesTable();
1
SELECT CreateStylingTables();
1
SELECT RL2_CreateRasterCoverage('Image1','UINT8', 'RGB', 3, 'JPEG', 80, 512, 512, 4326, 0.0000045);
1
SELECT RL2_LoadRaster('Image1', 'Perth_image_1.jpg',1, 4326, 1, 1);
------------------
Importing: Perth_image_1.jpg

    Image Size (pixels): 5913 x 5082
                   SRID: 4326
       LowerLeft Corner: X=115.40 Y=-31.23
      UpperRight Corner: X=115.43 Y=-31.20
       Pixel resolution: X=0.0000045 Y=0.0000045
>> Image successfully imported in: 0 mins 02 secs
1
SELECT SE_UpdateRasterCoverageExtent(1);
1
root@docker-test:/home/khanh/image/Perth-new# /usr/local/bin/rl2tool catalog -db test40.sqlite

rl2tool; request is CATALOG
===========================================================
DB path: test40.sqlite
===========================================================
     SQLite version: 3.16.2
 SpatiaLite version: 4.5.0-devel
RasterLite2 version: 1.1.0-devel
===============================================================================
             Coverage: image1
                Title: *** missing Title ***
             Abstract: *** missing Abstract ***
-------------------------------------------------------------------------------
          Sample Type: UINT8
           Pixel Type: RGB
      Number of Bands: 3
          Compression: JPEG (lossy)
  Compression Quality: 80
   Tile Size (pixels): 512 x 512
Pixel base resolution: X=0.0000045 Y=0.0000045
-------------------------------------------------------------------------------
Overall Size (pixels): 5912 x 5082
                 Srid: 4326 (epsg,4326) WGS 84
      LowerLeftCorner: X=115.40063025 Y=-31.22502074999999
     UpperRightCorner: X=115.42723875 Y=-31.20215174999999
-------------------------------------------------------------------------------
        NO-DATA Pixel: 255, 255, 255
-------------------------------------------------------------------------------
 NO-DATA Pixels Count: 1407414
   Valid Pixels Count: 30049866
  =========== Band #0 Summary ==========
            Min Value: 0
            Max Value: 255
           Mean Value: 67.77685920463014
             Variance: 628.8017714282572
   Standard Deviation: 25.07592015117804
  =========== Band #1 Summary ==========
            Min Value: 0
            Max Value: 255
           Mean Value: 84.93261430849631
             Variance: 491.7008827011209
   Standard Deviation: 22.17432936305224
  =========== Band #2 Summary ==========
            Min Value: 0
            Max Value: 255
           Mean Value: 74.28427258211407
             Variance: 403.4267113445299
   Standard Deviation: 20.08548509109326
-------------------------------------------------------------------------------
   ===  Pyramid Level: 0  ==========================
  Physical resolution: X=0.0000045 Y=0.0000045
   Virtual resolution: X=0.000009 Y=0.000009
   Virtual resolution: X=0.000018 Y=0.000018
   Virtual resolution: X=0.000036 Y=0.000036
          Tiles Count: 120
           BLOB Bytes: 6261956
   ===  Pyramid Level: 1  ==========================
  Physical resolution: X=0.000036 Y=0.000036
   Virtual resolution: X=0.000072 Y=0.000072
   Virtual resolution: X=0.000144 Y=0.000144
   Virtual resolution: X=0.000288 Y=0.000288
          Tiles Count: 4
           BLOB Bytes: 113929
   ===  Pyramid Level: 2  ==========================
  Physical resolution: X=0.000288 Y=0.000288
   Virtual resolution: X=0.000576 Y=0.000576
   Virtual resolution: X=0.001152 Y=0.001152
   Virtual resolution: X=0.002304 Y=0.002304
          Tiles Count: 1
           BLOB Bytes: 8132
===============================================================================

Operation CATALOG successfully completed
root@docker-test:/home/khanh/image/Perth-new# /usr/local/bin/wmslite -db test40.sqlite
======================================================
              WmsLite server startup
======================================================
         SQLite version: 3.16.2
     SpatiaLite version: 4.5.0-devel
    RasterLite2 version: 1.1.0-devel
======================================================
unable to retrieve Vector Coverages

wmslite server shutdown in progress
wmslite shutdown completed ... bye bye
root@docker-test:/home/khanh/image/Perth-new#

Did I have done something wrong ?
How can I check if my image is correct from the DB sqlite ?
Is the spatliate_gui able to show my map from the db file ?

Khanh


a.fu...@lqt.it

unread,
Sep 16, 2017, 3:15:08 AM9/16/17
to spatiali...@googlegroups.com
On Fri, 15 Sep 2017 14:24:24 -0700 (PDT), khanh dinh wrote:
> Could you provide some tips to get it from the fossil repositories ?
>

Hi Khanh,

you can find detailed instructions about using Fossil from here:
http://www.gaia-gis.it/gaia-sins/about-fossil.html

note: if you are working on Debian you should install first the
Fossil package: apt-get install fossil


> Is there any Rasterlite 1.1.0-devel already in binairies or do I have
> to compile it ?
>

no, there is no binary distribution simply because RL2 1.1.0-devel
still is under active development and the sources change very
frequently, thus making binaries to be quickly superseded by
following developments.
you necessarily have to build your own binaries starting from
the sources available on the Fossil repository, then quickly
updating every time that a new commit modifies the repository.

bye Sandro

a.fu...@lqt.it

unread,
Sep 16, 2017, 3:33:27 AM9/16/17
to spatiali...@googlegroups.com
On Fri, 15 Sep 2017 15:13:27 -0700 (PDT), khanh dinh wrote:
>>> HI Sandro,
>
> I'm able to get the source for Rasterlite2.
> and I compile it and now I get the desire version
>
> sqlite> SELECT load_extension('mod_rasterlite2');
> sqlite> select RL2_version();
> 1.1.0-devel
>
> Could you tell me if I also need to recompile the libspatialite to
> get
> the version 4.5.0-devel ?
>

Hi Khanh,

librasterlite-1.1.0-devel strictly requires libspatialite-4.5.0-devel.

this is because many strategic tables (and related safeguard triggers)
required by RL2 are directly created and handled by SpatiaLite itself.

note: SQL functions such as CreateStylingTables(),
CreateRasterCoverageTables(),
CreateVectorCoverageTables(), SE_UpdateRasterCoverageExtent(),
SE_UpdateVectorCoverageExtent() (and several others) are defined by
SpatiaLite and not by RasterLite2.

so, if you use librasterlite2-1.1.0-devel in conjunction with any
other version of libspatialite different from 4.5.0-devel you'll
dangerously open the door to many unexpected discrepancies between
the two libraries about the expected DB layout, and this can
easily cause severe malfunctions.

corollary: each DB accessed by librasterlite2-1.1.0-devel is
always expected to have been created by libspatialite-4.5.0-devel.

bye Sandro

khanh dinh

unread,
Sep 16, 2017, 3:50:04 AM9/16/17
to SpatiaLite Users

Hi Sandro,

 I'm now able to run with Rasterlite2_1.1.0-devel and libspatialite-4.5.0

Could you tell me if my import to DB sqlite is correct ?

root@docker-test:/home/khanh/image/Perth-new# sqlite3 image1.sqlite </tmp/aa.sql
SELECT load_extension('mod_rasterlite2');
SELECT load_extension('mod_spatialite');
SELECT InitSpatialMetadata(1);
1
SELECT CreateRasterCoveragesTable();
1
SELECT CreateStylingTables();
1
SELECT RL2_version();
1.1.0-devel
SELECT RL2_CreateRasterCoverage('Image1','UINT8', 'RGB', 3, 'JPEG', 80, 512, 512, 4326, 0.0000045);
1
SELECT RL2_LoadRaster('Image1', 'Perth_image_1.jpg',1, 4326, 1, 1);
------------------
Importing: Perth_image_1.jpg

    Image Size (pixels): 5913 x 5082
                   SRID: 4326
       LowerLeft Corner: X=115.40 Y=-31.23
      UpperRight Corner: X=115.43 Y=-31.20
       Pixel resolution: X=0.0000045 Y=0.0000045
>> Image successfully imported in: 0 mins 02 secs
1
SELECT SE_UpdateRasterCoverageExtent(1);
1
root@docker-test:/home/khanh/image/Perth-new# ls -l image1.sqlite
-rw-r--r-- 1 root root 12374016 Sep 16 03:45 image1.sqlite
root@docker-test:/home/khanh/image/Perth-new# rl2tool catalog -db image1.sqlite

rl2tool; request is CATALOG
===========================================================
DB path: image1.sqlite
===========================================================
     SQLite version: 3.16.2
root@docker-test:/home/khanh/image/Perth-new# wmslite -db image1.sqlite
======================================================
              WmsLite server startup
======================================================
         SQLite version: 3.16.2

     SpatiaLite version: 4.5.0-devel
    RasterLite2 version: 1.1.0-devel
======================================================
unable to retrieve Vector Coverages
wmslite server shutdown in progress
wmslite shutdown completed ... bye bye
root@docker-test:/home/khanh/image/Perth-new#


Could you tell me if those step above are correct  and how can I check my map ?
Thank a lot for your help .

Khanh


a.fu...@lqt.it

unread,
Sep 16, 2017, 3:53:02 AM9/16/17
to spatiali...@googlegroups.com
On Fri, 15 Sep 2017 16:00:32 -0700 (PDT), khanh dinh wrote:
> unable to retrieve Vector Coverages
> wmslite server shutdown in progress
>
> Did I have done something wrong ?
>

Hi Khanh,

the error message is self-explanatory; you've simply missed
to create the Vector Coverages table in your DB.
just executing "SELECT CreateVectorCoveragesTable();" should
resolve the issue.


> How can I check if my image is correct from the DB sqlite ?
> Is the spatliate_gui able to show my map from the db file ?
>

yes, this is supported by spatialite_gui-2.1.0-devel via the
brand new "Map Panel" tool.

note: this is a really unstable area subject to very frequent
changes and not yet fully documented because it currently
is under very active development.
caveat: use it at your own risk.

you can find a preliminary documentation form here:
https://www.gaia-gis.it/fossil/spatialite_gui/wiki?name=About+the+new+Map+tool+(starting+since+version+2.1.0)

warning: the above documentation is surely outdated and
not necessarily matches the actual behavior of the
current sources available from the Fossil repository,
but it's surely useful so to get some generic hints.

bye Sandro


khanh dinh

unread,
Sep 16, 2017, 9:16:23 AM9/16/17
to SpatiaLite Users

Hi Sandro,

I try to create  but I get an error
Error: near line 6: no such function: CreateVectorCoveragesTable

Do I need to load another library ? 

root@docker-test:/home/khanh/image/Perth-new# sqlite3 image3.sqlite </tmp/aa.sql
SELECT load_extension('mod_rasterlite2');

SELECT load_extension('mod_spatialite');

SELECT InitSpatialMetadata(1);
1
SELECT CreateRasterCoveragesTable();
1
Error: near line 6: no such function: CreateVectorCoveragesTable
SELECT CreateStylingTables();
1
SELECT RL2_version();
1.1.0-devel
SELECT RL2_CreateRasterCoverage('Image1','UINT8', 'RGB', 3, 'JPEG', 80, 512, 512, 4326, 0.0000045);
1
SELECT RL2_LoadRaster('Image1', 'Perth_image_1.jpg',1, 4326, 1, 1);
------------------
Importing: Perth_image_1.jpg
    Image Size (pixels): 5913 x 5082
                   SRID: 4326
       LowerLeft Corner: X=115.40 Y=-31.23
      UpperRight Corner: X=115.43 Y=-31.20
       Pixel resolution: X=0.0000045 Y=0.0000045
>> Image successfully imported in: 0 mins 03 secs
1
SELECT SE_UpdateRasterCoverageExtent(1);
1
root@docker-test:/home/khanh/image/Perth-new#


I'm not able to compile the source code for spatialite_gui-2.1.0-devel on Windows.
Is it possible to get spatialite_gui-2.1.0-devel already in windows binairies ?

Khanh


mj10777

unread,
Sep 16, 2017, 9:26:02 AM9/16/17
to SpatiaLite Users


On Saturday, 16 September 2017 15:16:23 UTC+2, khanh dinh wrote:

Hi Sandro,

I try to create  but I get an error
Error: near line 6: no such function: CreateVectorCoveragesTable
Since there is more than 1 table being created, an extra 's' is needed.

SELECT CreateVectorCoveragesTables();

Please read the 'spatialite-sql-latest.html' that you will find in the main source directory, for the newer commands.

Mark

a.fu...@lqt.it

unread,
Sep 16, 2017, 10:36:05 AM9/16/17
to spatiali...@googlegroups.com
On Sat, 16 Sep 2017 06:16:23 -0700 (PDT), khanh dinh wrote:
> I'm not able to compile the source code for
> spatialite_gui-2.1.0-devel
> on Windows.
> Is it possible to get spatialite_gui-2.1.0-devel already in windows
> binairies ?
>

Hi Khanh,

I have the impression that you are not reading my replies;
I'll reply to this question for the third (and last) time.

libspatialite-4.5.0-devel, librasterlite2-1.1.0-devel
and spatialite_gui-2.1.0-devel are software components
still under active development.
this means that their respective sources change very
frequently, and consequently releasing any pre-compiled
binary is completely out of discussion for obvious
technical reasons; they'll be quickly superseded by
further code developments after very few days.

pre-compiled binaries will come only when all three
components will reach a decent final stable configuration,
at least enough to support a reasonable Release Candidate.
(expected to be released during this autumn).

in the meanwhile, if you really want to perform some
preliminary experimental testing, you necessarily
have to build your binaries by yourself starting from
the sources available from the Fossil repositories.

Debian (as any other Linux) is the ideal platform for
this task; building from sources is plain and easy.
Windows is the worst of worst; building from sources
on Windows is a damn complex and very time consuming
task; I personally carefully avoid to perform any
Windows build, if not absolutely indispensable for
testing purposes, because such an activity adsorbs
too much time and isn't usually strictly required.

You say in your previous posts that you are working
on a Debian platform; why don't you try building
the GUI tool on Debian instead of Windows ?

You've already successfully built and installed both
libspatialite-4.5.0-devel and librasterlite2-1.1.0-devel,
so building spatialite_gui-2.1.0-devel should be now a
really trivial task.

hint: you'll probably have to install few more
packages from the Debian system repositories:
- libjpeg62-turbo-dev
- libpng12-dev
- libtiff5-dev
- libgeotiff-dev
- libgif-dev
- libwebp-dev
- libcharls-dev
- libopenjp2-7-dev
- libcairo2-dev
- libcurl4-gnutls-dev
- libwxgtk3.0-dev

bye Sandro


khanh dinh

unread,
Sep 17, 2017, 11:28:15 AM9/17/17
to SpatiaLite Users

Hi Sandro,

Thank you very much for your advice.
I already built libspatialite-4.5.0-devel and  librasterlite2-1.1.0-dev.
I will try to compile spatialite_gui on Debian.

Cheers
Khanh

Reply all
Reply to author
Forward
0 new messages