spatialite JavaScript port

92 views
Skip to first unread message

j...@zalf.de

unread,
Apr 28, 2015, 9:37:30 AM4/28/15
to spatiali...@googlegroups.com
Hey,

I have currently not an exact idea what it is good for (apart of playing around with scripting spatialite) but I compiled libspatialite (4.2) to JavaScript with emscripten; including proj&geos libraries. It seems to work quite well - at least the sql_stmt_tests pass (2 of 1896 tests fail).
I also compiled demos in /examples. Though demo1.c asserts - as well in a native build on my machine. I am using sql.js's api (a port of SQLite) and called it therefore "spatiasql.js". The repo is here: https://github.com/jvail/spatiasql.js

Any hints on why those tests are failing are welcome!

Bye,
Jan




j...@zalf.de

unread,
Apr 29, 2015, 6:35:31 AM4/29/15
to spatiali...@googlegroups.com
Update: managed to put an example website (web-worker) together: http://jvail.github.io/spatiasql.js/ . Should work with common browsers.

Noli Sicad

unread,
Apr 30, 2015, 1:55:50 AM4/30/15
to spatiali...@googlegroups.com, j...@zalf.de
Hi Jan,

Thanks for Spatialite JS.

Good, you have a Leaflet example now.

I think it would be good to have a "Clear" Button as side from the
"Run" button, so we can rerun.

However, by refreshing it, it would clear the result and we could run again.

Good job.

Thanks.

Regards, Noli
> --
> You received this message because you are subscribed to the Google Groups
> "SpatiaLite Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to spatialite-use...@googlegroups.com.
> To post to this group, send email to spatiali...@googlegroups.com.
> Visit this group at http://groups.google.com/group/spatialite-users.
> For more options, visit https://groups.google.com/d/optout.
>

Jukka Rahkonen

unread,
Apr 30, 2015, 2:43:40 AM4/30/15
to spatiali...@googlegroups.com, j...@zalf.de, Noli Sicad
Hi,

For me it looks that the old results are cleared when I edit the SQL
query and press Run again.

-Jukka Rahkonen-

j...@zalf.de

unread,
Apr 30, 2015, 3:33:16 AM4/30/15
to spatiali...@googlegroups.com, j...@zalf.de
Hi, thank you.

Button added.

a.fu...@lqt.it

unread,
Apr 30, 2015, 4:40:42 AM4/30/15
to spatiali...@googlegroups.com
Hi Jan,

> I have currently not an exact idea what it is good for (apart of
> playing around with scripting spatialite)
>

it opens the doors to many potential future developments of very
high relevance.
this means that starting since now any standard web browser could
potentially support a full feathered Spatial DMBS.

HTML5 on its own supports a canvass element: so any recent web
browser offers a dynamic scriptable 2D rendering engine supporting
both vector shapes and bitmap images.

at least in theory that's enough to start imagining that any
web browser could be now realistically offer all we need in
order to deploy at least a minimalistic self-standing mapping
environment.
and such an hypothetical minimalistic mapping/GIS environment
will be universally portable by its intrinsic nature: it will
work on any Unix/Mac/Windows desktop exactly in the same way
it will work on a tablet or on any other mobile device.

for now it surely is a very immature technology just moving
it's very first steps.
anyway it looks very promising and highly interesting.

just as a suggestion: a web page where you can just test few SQL
statements is not at all sexy.
it could surely be much more attractive if someone mastering the
required JS skills could develop a prototype web app displaying
a simple map on the browser canvass.
I'm not a web developer, but I easily imagine that by integrating
OpenLayers or Leafltes this could probably be a not so complex task.

bye Sandro

a.fu...@lqt.it

unread,
Apr 30, 2015, 4:43:41 AM4/30/15
to spatiali...@googlegroups.com
On Tue, 28 Apr 2015 06:37:30 -0700 (PDT), j...@zalf.de wrote:
> It seems to work quite well - at least the sql_stmt_tests pass
> (2 of 1896 tests fail).
>

Jan,

it could be surely interesting reporting which exactly are the
failing tests ;-)

bye Sandro

j...@zalf.de

unread,
Apr 30, 2015, 5:33:17 AM4/30/15
to spatiali...@googlegroups.com
Thanks Sandro,

for our pleasure I added more "sexyness" :) Let me know if you have other ideas!

The failing tests are:
checkspatialmetadata1.testcase
invalidatestats3.testcase


You are right with all of your comments. But I am not sure if it will ever perform well on even medium large datasets (everything is in memory as far as I understand the technique). However, I am not at all an expert in writing Makefiles, figuring out what the best compiler options are. There is for sure still a lot of room for improving the build .. and emscripten will make progress as well. I was just very curious if it is possible at all.

Bye
Jan

Pepijn Van Eeckhoudt

unread,
Apr 30, 2015, 8:54:11 AM4/30/15
to spatiali...@googlegroups.com
Just for inspiration, have a look at http://sqliteonline.com. Spatialite + Leaflet integrated into that would be really cool.

Pepijn

j...@zalf.de

unread,
May 1, 2015, 11:37:49 AM5/1/15
to spatiali...@googlegroups.com
Yes, that would be nice. Although it already loads pretty slow. Another nice (and useful) idea might be to integrate it into the spatialite tutorials to make them interactive.

Meanwhile I played with the optimization flags and recompiled it. The web demo is much faster now. I also added a spatialindex test (port form demo4) that - slow but OK.  

j...@zalf.de

unread,
May 3, 2015, 6:44:16 AM5/3/15
to spatiali...@googlegroups.com
Sorry, it seems the testing script itself was responsible for those two failures. ;)

Bye
Jan

Am Donnerstag, 30. April 2015 10:43:41 UTC+2 schrieb sandro furieri:
Reply all
Reply to author
Forward
0 new messages