MapFish installation
MapFish is composed of two parts: MapFish Client and MapFish Server.
MapFish Client is a JavaScript library based on OpenLayers and Ext.
MapFish Server is itself composed of two parts: MapFish Server Framework and MapFish Server Libraries.
MapFish Server Framework provides a Python development framework based on the Pylons web development framework.
MapFish Server Libraries provides Python, Java, and PHP libraries to be used by application programmers as helpers to implement MapFish web services.
Download
You can either download the current stable version or get the development version from the SVN repository.
MapFish Client
To install MapFish Client you just need to have the client/ directory of the MapFish source tree in a web directory.
For example, on the Debian-based system with Apache, the default web directory is /var/www/wwwroot.
Then, you should be able to point your browser to the client/examples directory and play with the provided examples.
Note that some examples (e.g. search) rely on web services. They are configured to use web services provided on Camptocamp servers. For those to work, you'll need to copy the proxy.cgi script (located under client/examples/ to your web server's CGI directory (/usr/lib/cgi-bin/ for Apache on Debian-based systems).
See the examples to understand how to make use of MapFish in your web pages. Also, refer to How ToUse Widgets.
Also, refer to How ToBuild to know how to build a compressed MapFish library.
MapFish Server Framework
To be able to create MapFish projects based on MapFish Server Framework you must install that framework.
Windows users: follow the instructions on How ToInstall Windows (contributed by Fabio D'Ovidio).
The framework is a Python package, a.k.a Python egg. You can install the MapFish egg either in your system-wide Python environment or in a virtual Python environment. The following steps assume that you install it in a virtual environment. Just adapt the instructions if you do it otherwise.
Install gcc, libc6-dev, libpq-dev, python, python-dev and libgeos-dev packages. For debian:
apt-get install gcc libc6-dev libpq-dev python python-dev libgeos-dev
Install setuptools if not already installed:
cd /tmp wget http://peak.telecommunity.com/dist/ez_setup.py python ez_setup.py
Install virtualenv:
easy_install virtualenv
Now you can create your virtual python environment (with your regular login):
cd /path/to/somewhere/ virtualenv vpython
Now is time to install the MapFish egg and its dependencies. Two choices here: either install the pre-built MapFish egg located on http://dev.camptocamp.com/packages/eggs/, or install a MapFish egg built from MapFish source.
To install pre-built MapFish egg:
cd vpython /path/to/somewhere/vpython/bin/easy_install -f http://dev.camptocamp.com/packages/eggs/ MapFish
To install MapFish egg from source (assuming that you have MapFish source tree located in /path/to/somewhere/MapFish/):
cd /path/to/somewhere/MapFish/server/python /path/to/somewhere/vpython/bin/python setup.py install
Last thing to do is manually install the psycopg2 egg. Try:
/path/to/somewhere/vpython/bin/easy_install psycopg2
If that doesn't work (because the psycopg2 site is down), install the psycopg2 package of your distribution. On a Debian-based system, do the following as root:
apt-get install python-psycopg2
You now have MapFish Server Framework installed. You should be all set to go ahead and create MapFish projects. See How ToUse Map Fish Server to learn about the steps to create MapFish projects. You can also look at How ToInstall Map Fish Sample to know how to install the sample MapFish project.
MapFish Server Library
At this time, MapFish Server Library includes:
- Python modules, which provide
- geometry SQLAlchemy type
- helper code for generating SQLAlchemy spatial requests matching MapFish Protocol
- Java library for generating GeoJSON, namely mapfish-geo-lib)
The Python modules are in MapFish Python egg (see above).
To build mapfish-geo-lib, follow these steps:
- download maven from http://maven.apache.org/download.html and gunzip it
- cd into /path/to/somewhere/MapFish/server/java/mapfish-geo-lib and launch the Maven build:
/path/to/apache-maven-2.0.8/bin/mvn package
This should create the jar file mapfish-geo-lib-0.1.jar.
