Smathermather's Weblog

Remote Sensing, GIS, Ecology, and Oddball Techniques

Archive for the ‘Formats’ Category

More geojson.io work– i.e. a little node and on a little ubuntu

Posted by smathermather on September 11, 2013

Continuing a previous post https://smathermather.wordpress.com/2013/08/24/a-public-sector-use-for-geojson-io/, I have been exploring the use of geojson.io for an easy to deploy way for folks to edit geojson.  For my purposes this led to a dive into node.

Getting node to run well on ubuntu is not as easy as:

sudo apt-get install node

Nope, tried that. Better to use/get a newer version of node. For this we turn to PPAs (Personal Package Archives).

Install Node:

sudo apt-get install g++ curl libssl-dev apache2-utils
sudo apt-get install git-core
sudo apt-get install python-software-properties python g++ make
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs

Now get our geojson.io:

git clone git://github.com/mapbox/geojson.io
cd geojson.io

Now we need to leverage nodes package management. geojson.io comes with a “shrinkwrap” file called package.json which tells the package manager the dependencies. thus the install command is simple:

sudo npm install 

Don’t use the -g flag above– the makefile expects relative paths for the dependencies.

Then we use make to minify the javascript, etc:

make 

and serve with ahem serve:

sudo npm install -g serve 

Now we can run a quick test of it served up using serve

sudo serve -p 80 

A deeper dive will customize this for our launch, but this is enough to test the basic frameworks for getting geojson.io running.

Extra note– as far as I can tell, there’s some Jekyll magic going on too, so it maybe simple to post this on github as well.

Anyone gotten any further with this? Any tips and tricks?

Posted in Formats, GeoJSON, github, Governance | Tagged: , , , | Leave a Comment »