Null value getting images in the left or bottom border from a Rasterlite2 DB in Android

30 views
Skip to first unread message

Javier Ramos

unread,
Mar 5, 2015, 4:11:09 AM3/5/15
to spatiali...@googlegroups.com
Hi all,

I have a Rasterlite2 DB and I want to get images in an Android app.

I have something like this:

String query = "SELECT RL2_GetMapImage('ortofotos', GeomFromEWKT ('SRID=4326;POLYGON ((-4.7076416015625 41.6688085556206, -4.7076416015625 41.6647050300921, -4.70214843750001 41.6647050300921, -4.70214843750001 41.6688085556206, -4.7076416015625 41.6688085556206))'),256,256, 'default')";

List<byte[]> tiles = new ArrayList<byte[]>();

stmt = db.prepare(query);
if (stmt.step()) {
   byte[] bitmap = stmt.column_bytes(0);
   tiles.add(bitmap);
}



Everything is fine, except when the image is in the left border or the bottom border of the Rasterlite, with one part in the extent of the db and the other out.
In this case bitmap takes null value, but if I do the same query with spatialite_gui I get results:








a.fu...@lqt.it

unread,
Mar 5, 2015, 5:47:08 AM3/5/15
to spatiali...@googlegroups.com
On Thu, 5 Mar 2015 01:11:09 -0800 (PST), Javier Ramos wrote:
> Everything is fine, except when the image is in the left border or
> the
> bottom border of the Rasterlite, with one part in the extent of the
> db
> and the other out.
> In this case bitmap takes null value, but if I do the same query with
> spatialite_gui I get results:
>

Hi Javier,

the most probable cause seems to be the one that spatialite_gui
is using a different version of librasterlite2

bye Sandro

Javier Ramos

unread,
Mar 5, 2015, 6:04:06 AM3/5/15
to spatiali...@googlegroups.com
Spatialite uses 0.9 and my Android app 1.6.10



--
You received this message because you are subscribed to a topic in the Google Groups "SpatiaLite Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/spatialite-users/fXPPFuPxnFo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to spatialite-users+unsubscribe@googlegroups.com.
To post to this group, send email to spatialite-users@googlegroups.com.
Visit this group at http://groups.google.com/group/spatialite-users.
For more options, visit https://groups.google.com/d/optout.

a.fu...@lqt.it

unread,
Mar 5, 2015, 6:36:01 AM3/5/15
to spatiali...@googlegroups.com
On Thu, 5 Mar 2015 12:04:03 +0100, Javier Ramos wrote:
> Spatialite uses 0.9 and my Android app 1.6.10
>

I've no idea about what 1.6.10 could eventually mean;
it doesn't matches any rasterlite2 version number.

anyway the most obvious solution seems to be the one
to update your android library to some fresher version.

bye Sandro

Javier Ramos

unread,
Mar 5, 2015, 6:52:13 AM3/5/15
to spatiali...@googlegroups.com
Is the result of "SELECT RL2_Version()"



bye Sandro

a.fu...@lqt.it

unread,
Mar 5, 2015, 7:02:10 AM3/5/15
to spatiali...@googlegroups.com
On Thu, 5 Mar 2015 12:52:12 +0100, Javier Ramos wrote:
> Is the result of "SELECT RL2_Version()"
>

the current development version still is 1.0-0-rc
1.6.10 doesn't seems at all a "genuine" version number (may be
introduced by some Android re-distribution project ?)

bye Sandro

Javier Ramos

unread,
Mar 5, 2015, 7:08:52 AM3/5/15
to spatiali...@googlegroups.com
I'm using this libraries 20140710.libjsqlite.R4.2.0.tar.bz2



bye Sandro

Javier Ramos

unread,
Mar 24, 2015, 4:52:32 AM3/24/15
to spatiali...@googlegroups.com
I'm using the libraries from geopaparazzi project.
I've tried to get the tiles directly with the function RL2_GetTileImage and the problem persists. If the tile is in the border of the coverage, and it's not complete, I've got a Null value from the query in Android. With Spatialite_GUI everything is OK.
Reply all
Reply to author
Forward
0 new messages