Geospatial Analysis for Fun and Profit

Posted on January 7, 2019
> Epistemic status: A brief tutorial on Turf.js, 
trying to be the resource I would have wanted.
(There are not many turf.js tutorials out there, which is tedious...) 

While I for a while enjoyed tools such as Leaflet.js or MapBox, only recently have I been able to get spatial analysis libraries installed in Python. Thanks to Unofficial Windows Binaries for Python Extension Packages website, geospatial analysis libraries that were once a trouble to install now work on my computer.

This has proven helpful because practicing those libraries meant Turf.js, a JavaScript library devoted to geospatial analysis, makes a lot more sense now, and is pretty useful actually!

For example, imagine if one was a city planner, and wanted to track the locations of electric bikes, let us assume a data set which is a part of one I am working with:

With leaflet, while points and other geoJSON features can be made and added with ease, geospatial analysis requires other tools.

For example, to see the distance between points, one can do this with turf.js:

By doing this, one can easily check the distance between two points. In my case, I am currently looking into the average location of where Lime Bike and Scooters are located, so this lets me see how far the average parked location is moving during a set period of time.

Next, what if one wants to see what is the general area where the scooters are contained in? With Turf.js, this is also possible:

Beyond these tools just highlighted, their are other useful tools in turf.js as well.

An additional note:

With some basic stats, geospatial analysis can be made even more useful. For example, add in some calculation of the standard deviation, the average change in location can be made even more useful!

While there is a lot more to doing geospatial analysis by programming then these various examples, they are still interesting and worth taking a look at.