Quantcast
Channel: MapWinGIS ActiveX Map and GIS Component
Viewing all articles
Browse latest Browse all 2341

New Post: Connection string spatialite from Access

$
0
0
Hi,

I just began using spatialite and did not reach the point to add a layer, here is what I've done so far, if this can help (or if wrong, anyone let me know !)

I was able to connect using system.data.sqlite with just
           Dim cnx As String = "Data Source=" & .<db file name>
            Try
                .connSq = New SQLiteConnection(cnx)
                .connSq.Open()
I installed libspatialite http://www.gaia-gis.it/gaia-sins/windows-bin-x86/ and installed mod_spatialite-4.3.0a-win-x86.7z library (make sure copy to true in order they get into compile folder)

this allows you to manage your spatialite database and insert démo features
http://www.gaia-gis.it/gaia-sins/spatialite-cookbook/html/metadata.html
            sql_exec_sq("SELECT load_extension('mod_spatialite.dll');", context.connSq, True)
            sql_exec_sq("SELECT InitSpatialMetaData();", context.connSq, True)
            sql_exec_sq("CREATE TABLE test_geom (id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL,  measured_value DOUBLE NOT NULL);", context.connSq, True)
            sql_exec_sq("SELECT AddGeometryColumn('test_geom', 'the_geom',  4326, 'POINT', 'XY');", context.connSq, True)
            sql_exec_sq("INSERT INTO test_geom(id, name, measured_value, the_geom)  VALUES (NULL, 'first point', 1.23456, GeomFromText('POINT(1.01 2.02)', 4326));", context.connSq, True)
Let me know when you'll be able to add the layer.

For gdal, I saw that I have to add libgdal but didn't have time to study so far, so I'll appreciate any follow on examples
http://www.gdal.org/drv_sqlite.html

Olivier

Viewing all articles
Browse latest Browse all 2341

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>