Thursday, 19 May 2011

JTS arrives in JavaScript

As I predicted back in 2008, JTS has now colonized the JavaScript ecosystem, thanks to the work of Bjorn Hartell on JSTS. At least, the project has been launched - it's a bit unclear as to how much functionality is actually there.

I hope to see some slick browser-based UI clients pop up, using Canvas or perhaps SVG?

The language scorecard for JTS now looks like:

[Update: Jan 31 2013] - Added R to the list

9 comments:

strk said...

Don't forget PHP (via GEOS, included in 3.3.0 release)

D_Guidi said...

Only a note: actually the url for NTS is http://code.google.com/p/nettopologysuite

Bill Thorp said...

Aren't there Java => JavaScript converters/ compilers out there now? Do you know if anyone has tried to "magically" convert JTS to JS?

Dr JTS said...

I don't know if anyone's tried automatic conversion of JTS to JavaScript.

At one point I was thinking that it would be interesting to try using GWT to convert JTS, but I haven't found time to work on this.

It would certainly be the preferred option for providing JTS functionality in JS, from my point of view (assuming that performance was acceptable.) Manual ports tend to diverge and get stale over time.

Unknown said...

I tried JTS with GWT but some tweaks still need to be done because GWT doesn't support all java classes. I believe I can get most functionalities work soon.

Björn Harrtell said...

Hey, I recently got JSTS to the point where most core functionality is working.

PS. I wouldn't mind not having to do the port manually ;) Played around with GWT but couldn't get it to do what I wanted...

Dr JTS said...

Good stuff, Bjorn - I'm impressed.

It would certainly be nice to have a port generated automatically. That would help hugely with maintenance over time, too. Not sure how feasible that is with current technology, though.

Unknown said...

http://jtsgwt.appspot.com/
here is what I got. had to change a lot to got it work.I am still not very confident about the changes I made so I decided to mainly use JTS on server side. I'd love to share my progress, let me know if anyone is interested.

fmark said...

You can add R to your list (via the "rgeos" package, which surprisingly enough provides R bindings for GEOS).