SpatiaLite Plugin

Developer
Nov 8, 2011 at 5:21 PM

Here are some tips how to use the DotSpatial.Plugins.SpatiaLite extension in your application:

1. When you build DotSpatial from source code, make sure that there is a folder Plugins/SpatiaLite with two DLL files: DotSpatial.Plugins.SpatiaLite.dll and System.Data.SQLite.dll

2. Run DemoMap.exe. You will see three buttons in the toolbar: 1) Add Layer from SpatiaLite, 2) Run SpatiaLite Query, 3) Save Layer to SpatiaLite database. Note: instead of DemoMap.exe, you can use the SpatiaLite plugin with any other DotSpatial-based application (including MapWindow6 or HydroDesktop or your own application) that supports extensions.

3. The functionality of the buttons is:

3a) Add Layer from SpatiaLite --> First, you need to specify the SQLite database. If the database is a valid SpatiaLite database (which means, that it has the geometry_columns table), then see a second dialog where you select the table. The table is then displayed as a layer in the map

3b) Run SpatiaLite Query --> Here you need to enter an SQL query. The result of the query is displayed as a layer in the map.

Running advanced Spatial query operations:

By default, the SpatiaLite plugin only supports standard SQL query operations (SELECT, JOIN, WHERE...). Only the two DLL's (DotSpatial.Plugins.SpatiaLite and System.Data.SQLite) are required to run these queries.

In order to support the more advanced Spatial database queries (Intersect, buffer, touches ...) you also need to include the SpatiaLite DLL's with your application. These extra DLL's must be in the same folder as the main executable. The following DLL's are required for supporting spatial queries:  libspatialite-1.dll, libgeos-3-1-1.dll and libgeos-c.dll. These files can be downloaded from: http://www.gaia-gis.it/spatialite/binaries.html

I'm preparing a more detailed tutorial on the SpatiaLite plugin that will be added to the tutorials page in the next couple of weeks. Please post any questions or suggestions about the SpatiaLite plugin or more general support for Spatial databases in DotSpatial here.

-- Jiri

Developer
Jun 1, 2012 at 3:57 PM

Jiri:

Where you able to finish your SpatialLite plugin tutorial?

Thanks

Jay

 

Aug 14, 2012 at 3:58 PM

any news on the tutorial Jiri?