- Introduction
Mobilemaps Nearby-Engine can be made to work with most any mapserver, or Web service conforming to the Open GIS Consortium standard. However, our favoured configuration uses the open source MapServer from the University of Minnesota. The hcslmap script is custom to the High Country Mapserver, and uses the rendering engine of MapServer (shp2img) for displaying a single image, but provides it's own map caching mechanism.
It has preconfigured layers for street-level through world-wide level maps, and these layers can be added or subtracted. Much of this document is an extension on MapServer's own installation files, so please refer to the MapServer website for further information. http://mapserver.gis.umn.edu/
This document may be somewhat out of date because MapServer is under continual development. We recommend getting the latest stable version of each of the libraries rather than those shown in these installation notes:
- Dependencies
To be installed in this order: (library version numbers will differ)
freetype-2.0.5.tar.gz
jpegsrc.v6b.tar.gz
libpng-1.2.1.tar.gz
gd-1.8.4.tar.gz
proj-4.4.4.tar.gz
ms_3.5.tar.gz
- FreeType 2 (2.x works the others don't seem to)
$ tar -zxvf freetype-2.4.tar.gz (or whatever version)
$ cd freetype
$ cd lib
#For a .o file: gcc -c -Iarch/ansi -I. arch/ansi/freetype.c
#For ansi static library
$ gcc -c -Iarch/ansi tt*.c
$ ar -r libfreetype.a tt*.o
$ cp libfreetype.a /usr/lib
#Note: there are some ways to speed up the fonts for unix by
#keeping them in memory.
#See the INSTALL file with FreeType
#The rest may not be necessary?
$ cd ..
$ ./configure
$ make
#Edit out the line which builds the test case on a 'make install' in Makefile
#It requires X to be installed.
$ make install
#Notes for Redhat 7.2:
$ cp libfreetype.a /usr/local/lib
$ cp ft2build.h /usr/include
$ cp -R freetype /usr/include
$ cp -R /usr/include/freetype /usr/include/freetype2
- Go to the `freetype2' directory.
- Unix (any C compiler should work):
$ make setup (don't worry, this will invoke a configure script)
$ make
$ make install
Alternatively, you can pass parameters to the configure script
within the CFG variable, as in:
$ make setup CFG="--prefix=/usr"
$ make
$ make install
-Make version 3.78.1 or newer is needed.
- Jpeg
$ tar -zxvf jpegsrc.v6b.tar.gz
$ cd jpeg-6b
$ ./configure
$ make
$ make install #puts into /usr/local/bin. But also want the .h files in /usr/include
$ cp *.h /usr/include
$ cp *.a /usr/lib #Gets static library into machine library file
- Libpng
$ tar -zxvf libpng-1.2.1.tar.gz
$ cd libpng-1.2.1
$ cp scripts/makefile.gcc Makefile #Read INSTALL for other makefiles on different platforms
#This creates the static file
$ make
$ cp *.a /usr/lib
$ cp *.h /usr/include
- GD
$ tar -zxvf gd-1.8.4.tar.gz
$ cd gd-1.8.4
#Modify the Makefile: must be compiled with HAVE_LIBFREETYPE to include fonts
#Also ensure the lib settings and include settings are correct
#This may be necessary for the include files too:
#cp libfreetype.a /usr/local/lib
$ make
$ make install
- Proj
$ tar -zxvf proj-4.4.4.tar.gz
$ cd proj-4.4.4
$ ./configure
$ make
$ make install
#This may be needed if /usr/local/lib is not on path
#>>> Paul Ramsey 10/26/01 11:25AM >>>
#A more elegant solution is to edit /etc/ld.so.conf and add
#/usr/local/lib to the list of directories. Then run 'ldconfig' to bring
#all the library information up to date. Things should then work. (For
#some reason, distributions do not have /usr/local/lib in ld.so.conf by
#default, even though the directory exists by default in their
#distributions. Must be to keep the newbies down.).
#Note: this option seems to require a reboot to function.
#Or possibly:
#cp /usr/local/include/nad_list.h /usr/include
#cp /usr/local/include/pro* /usr/include
#cp /usr/local/lib/libproj.a /usr/lib
#Warning: after doing a ldconfig, the g++ links can be mislaid and you must
#ln -s /lib/libc-2.2.4.so ld-linux.so.2
#ln -s /lib/libc-2.2.4.so libc.so.6
#However, do so at your own risk! This could disable your whole machine.
#
- Mapserver
$ tar -zxvf ms_3.5.tar.gz
$ cd mapserver_3.5/
$ ./configure --with-proj --with_freetype=/usr/local/lib #proj option is needed for projections
#freetype option is if having problems
#detecting where freetype library was installed (your
#directory may be different!)
#Also: On one occasion I needed to rename /usr/local/lib/libproj.so to something else
#so that the static libraries would be used. It was due to a different version of glibc.
- Making directories
$ cd cgi-bin
$ mkdir hcslmap
$ cd hcslmap
$ cp [your MapServer path]/mapserver/mapserver_3.5/shp2img .
$ chmod 755 shp2img
$ mkdir temp
$ mkdir data
$ mkdir fonts
$ cp [your hcsl path]/hcslmap .
$ cp [your hcsl path]/hcslmap_test .
$ chmod 755 hcslmap
$ chmod 755 hcslmap_test
$ chmod 766 temp #make temp folder writeable
$ chown nobody temp #ownership to webserver
- Upload sample data and fonts
To test the map-server is working
Download esriworldmap.tar.gz from mobilemaps.com into
hcslmap/data/esriworldmap/
$ cd hcslmap/data/esriworldmap
$ tar -zxvf esriworldmap.tar.gz
$ cd hcslmap/data
$ cp [your MapServer path]/mapserver/mapserver_3.5/tile4ms .
$ ./test_index.sh
Please refer to
HOWTO_US_STREETS.txt Section 2. Street-level maps
for information on downloading and installing street-level US data.
- Sanity Check
$ su nobody #Or su httpd, whichever is web server's user
$ ./hcslmap_test n=90 s=0 #or ./hcslmap n=90 s=0 when all US layers are present.
#Should display a half screen of gobbledegook - ie. a .gif or .png being printed
#to stdout.
- If it isn't working
* Check the paths at the top of hcslmap script
* Check the permissions of the directories and files in temp, data