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:
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.
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.
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 :/
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."
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).
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.
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!
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.
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.
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.
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. :)