News for hackers. Stuff that matters.
Re:Turf – A modular GIS engine written in JavaScript by mattdesl on Wednesday December 24, 2014 @03:26PM (#8794416)
Re-posting what I said in r/javascript. I'm digging the modularity.

My only complaint would be that some of those modules do not really need to be "turf" specific. For example, "turf-is-clockwise" would be more Unixy if it was just "is-clockwise" or "is-polygon-clockwise". This would help improve discoverability and make them nicer to use alongside other generic npm modules, like:

simplify-path, delaunay-triangulate, triangulate-contours, chaikin-smooth, convex-hull

etc.

I also think the turf modules would appeal to other uses than just GIS. They are generic enough to be useful in games, interactive apps, etc. :)

Re:Turf – A modular GIS engine written in JavaScript by ldng on Wednesday December 24, 2014 @12:39PM (#8793666)
Has anyone tested this with a ~500 MB dataset ? Say the parcels of a city. How does it perform ?
Re:Turf – A modular GIS engine written in JavaScript by morganherlocker on Wednesday December 24, 2014 @12:55PM (#8793743)
Here are some rough benchmarks[1]

Performance will vary widely depending on which functions you are calling and characteristics of the data. Some types of analysis will quickly process 500 MB, and others you will probably want to use some sort of indexing strategy.

For pure javascript indexers, check out rbush[2] (R-Tree indexes) and tile-cover[3] (map tile indexes), both of which are as fast or faster than the C++ indexers used in most mainstream spatial databases.

Expect these benchmarks to improve in the coming months as we push the limits with new, faster algorithms as well.

[1] https://gist.github.com/morganherlocker/a9041f2491c63b541cb2

[2] https://github.com/mourner/rbush

[3] https://github.com/mapbox/tile-cover

Re:Turf – A modular GIS engine written in JavaScript by ldng on Wednesday December 24, 2014 @01:08PM (#8793812)
Thanks ! I'll have a deeper look at all that later. I was wondering if you were using r-tree indexes (I haven't looked at the code yet). Rbush certainly looks interesting.
Re:Turf – A modular GIS engine written in JavaScript by mbq on Wednesday December 24, 2014 @07:36PM (#8795029)
It is sad that substantial part of this lib assumes flat Earth; it will work well on a city scale, but one has to expect spectacular fails on a longer distances and near the poles :/
Re:Turf – A modular GIS engine written in JavaScript by morganherlocker on Wednesday December 24, 2014 @09:08PM (#8795190)
Distance calculations account for this and geodesic buffer support is on the way. This is close to top of my priority list right now.
Re:Turf – A modular GIS engine written in JavaScript by mrec on Wednesday December 24, 2014 @01:08PM (#8793810)
All examples currently failing, getting an error page instead of turf.min.js:

"This request has been blacklisted for sending too much traffic to rawgit.com. Please contact the owner of the site that sent you here and ask them to use cdn.rawgit.com instead, which has no traffic limit."

Re:Turf – A modular GIS engine written in JavaScript by morganherlocker on Wednesday December 24, 2014 @01:19PM (#8793865)
Thanks for the heads up! Everything is back up now.
Re:Turf – A modular GIS engine written in JavaScript by rektide on Wednesday December 24, 2014 @12:56PM (#8793745)
I'd just started learning about what's offered in Geotools.JS (https://github.com/jillesvangurp/geotools-js). This looks way way more comprehensive; very cool.
Re:Turf – A modular GIS engine written in JavaScript by metastew on Wednesday December 24, 2014 @12:29PM (#8793622)
Have you thought about porting it to Meteor's Atmosphere (https://atmospherejs.com/i/publishing)? You'd only need to set up a Meteor Developer account and then create a Meteor package file and export the library for Meteor's usage (afaik).

I'm curious if this supports Leaflet too?

Re:Turf – A modular GIS engine written in JavaScript by uptown on Wednesday December 24, 2014 @12:33PM (#8793634)
Here's the Mapbox blog post about it, where they confirm easy integration with Leaflet:

https://www.mapbox.com/blog/turf-gis-for-web-maps/

Re:Turf – A modular GIS engine written in JavaScript by morganherlocker on Wednesday December 24, 2014 @12:41PM (#8793684)
> Have you thought about porting it to Meteor's Atmosphere

We currently support npm, bower, and a CDN build on Mapbox. Additional package managers can be added if there is a community need.

> I'm curious if this supports Leaflet too?

Turf is not tied to any visualization framework. GeoJSON in - GeoJSON out; display it where you want (or don't display it at all).

Re:Turf – A modular GIS engine written in JavaScript by sandyshankar on Friday December 26, 2014 @05:51AM (#8798615)
Found this blog visualizing turfjs modules with mapbox.js (http://rousseau.io/turf-mapboxjs/)
Re:Turf – A modular GIS engine written in JavaScript by thomasfoster96 on Wednesday December 24, 2014 @07:35PM (#8795026)
Does anyone know how widely this is being used in production? Turf looks pretty good and I've had my eye on it for a while, but I'm not willing to get too attached to it if it has performance issues, and I'd like to hear about other people's experiences.
Re:Turf – A modular GIS engine written in JavaScript by noer on Wednesday December 24, 2014 @01:53PM (#8794034)
wow, that looks beautiful! i used GIS pretty extensively when I worked in the public sector. I've sort of stopped doing any kind of mapping work, but this makes me want to find a project!
Re:Turf – A modular GIS engine written in JavaScript by whalesalad on Wednesday December 24, 2014 @01:49PM (#8794015)
I wish I had a use for this because the documentation is beautiful.
Re:Turf – A modular GIS engine written in JavaScript by elinchrome on Wednesday December 24, 2014 @11:35AM (#8793396)
In the demo wombats code, shouldn't 'miles' be in a constant somewhere? That seem messy.
Re:Turf – A modular GIS engine written in JavaScript by uptown on Wednesday December 24, 2014 @12:32PM (#8793629)
The source has awareness of miles, kilometers, radians, and degrees as units of measure. Passing it in the demo is just specifying which one you're expecting results to use in its calculations.
Re:Turf – A modular GIS engine written in JavaScript by maxerickson on Wednesday December 24, 2014 @01:09PM (#8793820)
Does it just punt on miles<->longitude? I looked at the code some and don't see where it would ever deal with projections.

(jsts mentions coordinates systems in comments, but I don't where it ever does anything about them)

Re:Turf – A modular GIS engine written in JavaScript by morganherlocker on Wednesday December 24, 2014 @03:26PM (#8794415)
Wgs84 data is assumed for distance calculations. If you need to convert your data on the fly, I typically recommend proj4js.
Re:Turf – A modular GIS engine written in JavaScript by ldng on Wednesday December 24, 2014 @05:00PM (#8794681)
Maybe you could document that more explicitly. Basically defining the scope of the project and where to look for complementary tools like proj4js and rbush for instance.
Re:Turf – A modular GIS engine written in JavaScript by maxerickson on Wednesday December 24, 2014 @04:11PM (#8794552)
I'm talking about buffering and such, "1 mile" isn't a sensible measure in latlong. I didn't carefully analyze the code, so maybe I'm just missing something.