Hi,

I made a test with Spatialite-4 dll files and everything seems to work. Thank 
you very much for the great job.

Two usage example for those who are not familiar with Spatialite yet:
1) Read data as reprojected into any coordinate system supported by Spatialite, 
which means support for 4223 different projections out-of-the box and more if 
you add the projection definitions into Spatialite database.  Spatialite and 
PostGIS are handling projections in a similar way which is excellent for 
interoperability.
2) OpenJUMP can utilize the OpenSteetMap routing facility of Spatialite
http://www.gaia-gis.it/spatialite-2.4.0/Using-Routing.pdf

This good news make me hungry. It would be really nice to to be able to save an 
OpenJUMP layer into Spatialite.

I did my test with this package I gathered a few weeks ago 
http://latuviitta.org/documents/Spatialite_4.0_test_with_jre_1.6.zip
This version is very feature rich and it has lots of dependies and therefore 
the zip contains 10 dll files.

Unzip the 10 dll files into the lib\ext folder together with the DB Query 
Plugin 0.8.1 and you are ready to go.
If all dll files are in \lib\ext it will be enough to define the Spatialite DB 
connection as
jdbc:sqlite:/c:/data/your_db_file.sqlite?spatialite=libspatialite-4.dll
and you can run for example route queries as

SELECT  * FROM way_net
WHERE nodefrom=1 AND nodeto=1000
limit 1;

or transform data into another projection as
SELECT Transform(geometry,3067) FROM way;

There is some inconvenience in putting all the 10 dll files into lib\ext 
because they are so many. However, I could not find a simple way to make OJ to 
find to dll files is I placed them into lib\ext\Spatialite_dll.

This plugin in so good that maybe we should really add it into OpenJUMP 1.6 
Plus. But perhaps we are too late for that.

-Jukka Rahkonen-

________________________________
 Larry Reeder wrote:

> I added the ability to load spatialite DLLs, and thus use Spatialite 
> functions, to the Jump DB Query plugin .   Instead of calling SELECT 
> load_extension('path_to\
spatialite-4.dll'), you need to append "?spatialite=/path/to/spatialite.dll" to 
the JDBC URL path in the dbquery properties file.    Its written up in slightly 
more detail here:

> https://sourceforge.net/p/jumpdbqplugin/wiki/Documentation/<https://sourceforge.net/p/jumpdbqplugin/wiki/Documentation/>

> If you don't append the Spatialite DLL path to the JDBC url, or loading the 
> Spatialite library fails, the plugin will behave as before.   You'll be able 
> to load features from the database, but won't be able to use Spatialite 
> functions.

> I recommend installing SQLite first and making sure you can load spatialite 
> DLLs from SQLite before trying it in the plugin.  Tested on Windows and 
> LInux, but not Mac.

 -lreeder


On Sun, Mar 17, 2013 at 11:44 AM, Rahkonen Jukka 
<jukka.rahko...@mmmtike.fi<mailto:jukka.rahko...@mmmtike.fi>> wrote:
Hi,

Whatever you do, as a user I would absolutely like to keep also the current 
mode which is perhaps limited but robust. The libspatialite-4.dll seems to be 
dependent on 9 other dlls and from my experience it feels sure that some day 
there will be some odd dll version missmatch in the system.

-Jukka-
________________________________________
Larry Reeder wrote:

> Great research, Jukka.   Looks like you are almost ready to submit a
> patch :-) .   Reading the link you sent, the SQLiteConfig must be used
> at the time the connection is first set up, so it will require a bit
> more setup in the plugin, but it doesn't look too bad.   My time to
> work on OJ is limited, but let me see what I can get done in the next
> few days.

>     -lreeder

> On Fri, Mar 15, 2013 at 7:45 AM, Rahkonen Jukka
> <jukka.rahko...@mmmtike.fi<mailto:jukka.rahko...@mmmtike.fi>> wrote:
>> This is mostly for Larry.
>
>> I was reading this document by Alessandro Furieri 
>> http://www.gaia-gis.it/spatialite-2.4.0-4/splite-jdbc.html
>>
>> I downloaded fresh Spatialite 4.0 dll files and tried to follow the document 
>> and finally I managed to compile the sample java program so that it loads 
>> and uses current Spatialite stuff.   All dll files which are tested to suit 
>> together and java code in in this zip file 
>> http://latuviitta.org/documents/Spatialite_4.0_test_with_jre_1.6.zip
>>
>> I also learned that it is enough to have a plain SQLite connection with the 
>> database first. Spatialite extencion can be loaded afterwards with SQL.  
>> Theoretically DB Query Plugin could support all Spatialite stuff if user 
>> just has all the Spatialite binaries, puts them all to a directory where OS 
>> finds them and  loads the extension by sending SQL with DB Query Plugin as
>> SELECT load_extension('path_to\spatialite-4.dll')
>>
>> However, SQLite does not allow loading extensions by default and that is 
>> also the case with DB Query Plugin.  I believe that it would be possible to 
>> activate this possibility  by editing  file JumpSpatialiteDbQuery.java.
>>  The code is now
>>
>>    @Override
>>    public FeatureCollection getCollection(String query, int maxFeatures) 
>> throws Exception
>>    {
>>       Connection connection = getConnection();
>>       FeatureCollection featureCollection = null;
>>
>> It should be possible to load Spatialite extension later with SQL if couple 
>> of lines were added:
>>       SQLiteConfig config = new SQLiteConfig();
>>       config.enableLoadExtension(true);
>>
>>
>> This snippet shows how the Spatialite sample program (included in my dll 
>> package) creates a connection to allow extension  loading.
>>
>>
>> Connection conn = null;
>>     try
>>     {
>>       // enabling dynamic extension loading
>>       // absolutely required by SpatiaLite
>>       SQLiteConfig config = new SQLiteConfig();
>>       config.enableLoadExtension(true);
>>
>>       // create a database connection
>>       conn = DriverManager.getConnection("jdbc:sqlite:spatialite.sample",
>>       config.toProperties());
>>       Statement stmt = conn.createStatement();
>>       stmt.setQueryTimeout(30); // set timeout to 30 sec.
>>
>> -Jukka Rahkonen-
>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_mar
> _______________________________________________
> 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

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
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

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
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


------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire 
the most talented Cisco Certified professionals. Visit the 
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to