Michaël Michaud wrote:

> Hi Jukka,

> I had a look on both plugins source code.
> I could not see anything obvious, they seem to parse spatialite geometries 
> about the same way.
> SQLite store geometries in a blob including ewkb + a few extra information. 
> EWKB part is parsed by JTS in both cases.
> I must have a deeper look.
> Also I don't understand why the second plugin can access database functions 
> and not the first.
> Function execution is supposed to be performed by spatialite, not by the 
> plugin.
> OK, I have to install all that if I want to make serious tests.
> Will take some time...

I understand it so that function execution is performed by SQLite. It does not 
have Spatialite functions before it loads  them from Spatialite extension and 
Sandro was doing it in his Java test as

import org.sqlite.SQLiteConfig;
...
SQLiteConfig config = new SQLiteConfig;
config.enableLoadExtension(true);
Connection conn = DriverManager.getConnection("path", config.toProperties);
Statement stmt = conn.createStatement();
stmt.execute("SELECT load_extension('/usr/local/lib/libspatialite.so')");

The calling SQLite part must have been compiled so that extension loading is 
allowed. I am remembering that by default it is not.

-Jukka-




> Michaël


Hi,

I started a new thread about this plugin.

We have two plugins for Spatialite. The first is Spatialite DB Query plugin and 
the second Spatialite Reader plugin. DB Query plugin works. However, it is not 
really a Spatialite plugin because it does not use any Spatialite extentions. 
It is a SQLite plugin which can read attributes and geometries from SQLite 
database through jdbc driver.  There are two different ways for storing 
geometries into SQLite database and this plugin understands them both.  
However, DB Query plugin can't use special Spatialite functions in the SQL 
queries. The list of  current Spatialite SQL functions shows what possibilities 
all we are missing because of this 
http://www.gaia-gis.it/gaia-sins/spatialite-sql-4.0.0.html

I had some troubles with DB Query plugin and with one certain Spatialite 
database. I haven't been able to reproduce the problem so I think it was 
nothing critical.

The Spatialite Reader plugin can utilize Spatialite functions and on Windows it 
happens through the "libspatialite-1.dll" library.  The immediate problem we 
have now with OpenJUMP 1.6 (actually all OJ versions since 1.3.1)  is that 
something goes wrong with converting Spatialite geometries into OJ geometries. 
Results look pretty odd as you can see from the attached screen capture.  
Geometries of point layers are placed on a horizontal line with zero North 
coordinates while the East coordinates seem to be correct.  Line layer becomes 
a set of vertical lines.

I put the plugin version which behaves for me like I described here 
http://latuviitta.org/documents/spatialite_reader_plugin.zip.

In addition to the geometry problem there would also be a need to update the 
plugin.  Spatialite database file holds just the data and some metadata about 
the data and database and for running the database operations the sqlite3 and 
spatialite libraries are used. I checked that with the libraries included with 
the Spatialite reader plugin the new Spatialite databases created with 
Spatialite 4.0 version can't be opened. I guess that a new spatialite.dll 
version would be needed for that. And even if the database is made with 
Spatialite 3.0 version some features, like the routing VirtualNetwork tables 
can't be used. I suppose that this is because virtual tables are a new SQLite 
feature and for using them the sqlite3 binaries should be updated.

Ideal solution would be do build the plugin again by using most recent SQLite 
and Spatialite version but I fear it is difficult.  Programmers may understand 
how it goes from this blog post by Alessandro Furieri 
http://www.gaia-gis.it/gaia-sins/java-test/JavaTestCoverage.pdf

Perhaps fixing the geometry conversion with OJ 1.6 would be an easier task.

-Jukka Rahkonen-




------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the
endpoint security space. For insight on selecting the right partner to
tackle endpoint security challenges, access the full report.
http://p.sf.net/sfu/symantec-dev2dev



_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net<mailto:Jump-pilot-devel@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel



------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to