SE_ReigisterRasterStyledLayer

31 views
Skip to first unread message

colinx...@gmail.com

unread,
Sep 6, 2015, 6:00:14 AM9/6/15
to SpatiaLite Users
Sorry - yet more problems. I'm trying to register a styled layer in my sqlite database ( something I've done with no problem on previous occasions) but
either by trying to load from the command line or via the spatialite-gui results in -1 being returned.

The only things I think that have changed are the spatialite/rasterlite versions. I am using the latest from the fossil repository and having read the previous query
regarding SE_RegisterVectorStyle, I have recompiled the spatialite gui app with ./configure --enable-rl2extra=yes but still no go

I have even tried with the epoto sample stylesheets but I've obviously missed something

This is the sql I'm using on spatialite_gui-2.0.0-devel with libspatialite4.3.0

SELECT SE_RegisterRasterStyledLayer('altitudes',XB_Create(XB_LoadXML('../etopo.xml'), 1, 1));

It thinks about it for several seconds before returning -1

Anyone spot my mistake?

Colin B

a.fu...@lqt.it

unread,
Sep 6, 2015, 11:55:08 AM9/6/15
to spatiali...@googlegroups.com
Hi Colin,

accordingly to the documentation accompanying libspatialite 4.3.0
this is the SE_RegisterRasterStyledLayer() signature:

SE_RegisterRasterStyledLayer ( coverage_name String , style_id Integer
) : Integer
SE_RegisterRasterStyledLayer ( coverage_name String , style_name Text )
: Integer

as you can easily see the second argument is expected to be of
the Integer or Text type.
XB_Create() will return a BLOB (success) or NULL (failure); on
either cases this is not an acceptable value and will raise an
error (-1).

in order to check the more recent evolutions introduced by 4.3.0
about Raster and Vector Styling please see:

https://www.gaia-gis.it/fossil/libspatialite/wiki?name=4.3.0+functions#8

bye Sandro

colinx...@gmail.com

unread,
Sep 6, 2015, 4:47:35 PM9/6/15
to SpatiaLite Users
Many thanks - I now see what I did wrong but I am scratching my head as to exactly how to register this raster coverage. I have successfully added the raster styles to
the SE_Raster_styles table  but maybe it's too late at night for me but I can't see how to register the coverage An example would be very helpful

Apologies for ineptitude but it's a long time since I did any of this stuff.

Colin B

mj10777

unread,
Sep 6, 2015, 11:56:14 PM9/6/15
to SpatiaLite Users


On Sunday, 6 September 2015 22:47:35 UTC+2, colinx...@gmail.com wrote:
Many thanks - I now see what I did wrong but I am scratching my head as to exactly how to register this raster coverage. I have successfully added the raster styles to
the SE_Raster_styles table  but maybe it's too late at night for me but I can't see how to register the coverage An example would be very helpful

I am working on a wiki page (by no means complete) which explains some of this
- for the present development version


As apposed to the alpha-version, there is now a 2 step approach:
- first you load a style into the Database
-- SE_RegisterRasterStyle

(with a SE_ReloadRasterStyle to UPDATE that style (i.e. reloading the xml file) when it has been changed)

- then you tell the raster_coverage to use that style
(it is only a reference to the loaded Style)
-- SE_RegisterRasterStyledLayer


In this way the Style needs to be loaded into the Database only ONCE
- but can be used multiple times

Any UPDATE of that Style (SE_ReloadRasterStyle)
- will take effect for all raster_coverage using that Style

This, together with the distinguishing between 'Raster' and 'Vector' Styles, is one of the MAJOR differences
- between the present developer version and the alpha-api 

Mark

colinx...@gmail.com

unread,
Sep 7, 2015, 3:11:53 AM9/7/15
to SpatiaLite Users

Many Thanks - I'd worked out the first part and thought I'd tried the second stage but probably mis-spelt something! This is all coming together nicely as
I've already decided that Geopaparazzi looks ideal for my purpose. A task that involves both ground mapping and scientific fauna surveys. The future looks promising
For reference, an example of each library function given with its description would be extremely helpful for idiots like me. Many thanks again - I'm sure you'll be hearing
more from me.

Regards Colin B

Reply all
Reply to author
Forward
0 new messages