Turfjs / turf

A modular geospatial engine written in JavaScript and TypeScript
https://turfjs.org/
MIT License
9.3k stars 941 forks source link

[Request] Old Documentation With Examples? #397

Closed roblav96 closed 7 years ago

roblav96 commented 8 years ago

Hello! Much love to this project. I'm learning so much about geospatial calculations =]

I was wondering if we could get the old docs back? turfjs.org/static/docs

The use of the live (and editable) mapped out examples was extremely important to my learning experience.

Is there anyway I can pull the old branch and build the docs myself?

morganherlocker commented 8 years ago

Hey @roblav96, thanks for the feedback. The recent change to docs allows us to iterate more quickly on things like adding features and fixing bugs. That said, we did have to temporarily drop a couple features, such as interactive examples. We definitely want to add these back with our new documentation system ASAP, although I have not looked too carefully yet into how we will go about this.

In the meantime, you can clone this repo and serve the old docs locally. Also, the examples are still available, just not interactively. You can run these with node and pipe the results to geojson.io using the geojsonio cli tool. A script to do that would look something like this:

// example.js
var turf = require('turf')

var pt = turf.point([10,10])
var buffered = turf.buffer(pt, 20, 'miles')

var fc = turf.featureCollection([pt, buffered])

// stringify the geojson you want to visualize and print it to the console
console.log(JSON.stringify(fc))

and run it like this to visualize the results:

# bash
node example.js | geojsonio

This will run the script and open a map showing your output results in a browser window.

cc @tmcw

roblav96 commented 8 years ago

This is wonderful! Just what I was looking for. I'll put this together and let you know how it goes.

Thank you so much for the efforts put into this project! It's people like you why I love programming so much.

roblav96 commented 8 years ago

After digging through the repo, I've come across exactly what I'm looking for:

Turf Examples

vcarl commented 8 years ago

@morganherlocker Is there a way to view the docs for a specific version of the library? We're still stuck on ~2.0.2 for the time being and I'm unfamiliar with Turf.

DenisCarriere commented 7 years ago

@roblav96 We've recently included maps for some of the TurfJS examples. Also a lot of the Javascript examples have been simplified to understand easier. http://turfjs.org/docs/

@vcarl I don't believe we will be maintaining versioned documentation. Feel free to submit a PR or a proposal on turf-www.

Closing this issue for now.