Experimental JavaScript (emscripten) port of SpatiaLite 4.3.0a
A little web-worker demo is available from here: http://jvail.github.io/spatiasql.js/
(be patient, loading the js and database file takes some time).
spatiasql.js (SpatiaLite) is an extension of sql.js (SQLite) and implements the same API, exept:
- loading shapefiles:
var fs = require('fs');
var SQL = require('spatiasql');
var db = new SQL.Database();
db.loadshp('my_table', 'CP1251', 4326, {
shp: fs.readFileSync('my_shp.shp'),
shx: fs.readFileSync('my_shp.shx'),
dbf: fs.readFileSync('my_shp.dbf')
});
var res = db.exec('SELECT name, GeometryType(geometry) FROM my_table');
Same license as SpatiaLite.