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:

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

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

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

    ReplyDelete
  4. 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.

    ReplyDelete
  5. 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.

    ReplyDelete
  6. 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...

    ReplyDelete
  7. 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.

    ReplyDelete
  8. 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.

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

    ReplyDelete