Sunday, November 1, 2015

Setting-up OpenGeo and TileCache Servers


Installing OpenGeo Suite

In my previous post I talked about the impact that Boundless is having on my GGS 692: Web-based GIS course.  It turns out the impact is even more than I reported, since our final project for the course will be based on the Building a GeoNames Heat Map tutorial found on the Boundless website.

We were given a VirtualBox hard drive image at the beginning of the course, with Ubuntu 12.04 and all the software we would need for class, including the OpenGeo Suite. While I've been using this image, I want to be able to set up everything myself, so I'm going to try to install the OpenGeo software on an Ubuntu 14.04 virtual machine.  I'll be following the instructions for installing OpenGeo Suite 4.7 on Ubuntu 14.04 here.  Following those instructions, I did:
$ sudo su -
# wget -qO- | apt-key add -
# echo "deb trusty main" > /etc/apt/sources.list.d/opengeo.list
# apt-get update
# apt-get install opengeo-server
This installed 244 new packages, including each of the components listed here. The OpenGeo Suite is certainly free software, but it uses both Java and Mono, and I'm a Python fan, so while I'll learn to use GeoServer for class, I'm going to pursue another, lighter map server stack at the same time.


Installing TileCache

TileCache is an implementation of the Tile Map Service (TMS) specification written in Python.  I setup an Ubuntu 15.10 server for this project and installed tilecache with:
$ sudo aptitude install tilecache
It installed 17 dependencies, including python 2.7, along with the tilecache package.  I am beginning to wrap my head around how this map server works.  It is built on three layers:
The geospatial data objects are stored in a PostGIS database.  Mapnik turns the data into images (tiles), which TileCache serves through the web. TileCache implements the Tile Map Service (TMS), a specification developed by OSGeo.

On the client side, a JavaScript library like Leaflet assembles the tiles for viewing.

Continuing with the server installation:
$ sudo aptitude install python-mapnik
$ sudo aptitude install postgresql-9.4-postgis-2.1
 With the software for the two servers installed, my next task will be to load the data for my GIS 692 class onto the OpenGeo server and the Arlington County map data onto the TileCache server.