Skip to content

kochizufan/spatiasql.js

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spatiasql.js

Experimental* JavaScript (emscripten) port of SpatiaLite

*all sql_stmt.. tests (geos, proj, geopackage) pass

##Demo 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).

##Usage 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');

##License Same license as SpatiaLite.

Releases

No releases published

Packages

No packages published

Languages

  • C 60.4%
  • C++ 13.4%
  • Makefile 9.4%
  • Shell 7.8%
  • JavaScript 5.6%
  • HTML 0.8%
  • Other 2.6%