Smathermather's Weblog

Remote Sensing, GIS, Ecology, and Oddball Techniques

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?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: