By Rupert
mapserver
Installing Mapserver on MacOSX (by source)
Jul 26th
Just noticed that William of kyngchaos has updated the mapserver binary for MacOSX.
But right now, I need to tile these images bought from GeoEye, so I need TIFF support. Below is a summary of getting Mapserver installed by source. Note that I have the necessary GEOS, GDAL from kyngchaos as well from this ealier post.
1. Download the ff files:
-rw-r--r--@ 1 rupert admin 564313 Jul 26 10:32 agg-2.5.tar.gz
-rw-r--r--@ 1 rupert admin 1345700 Jul 26 10:22 gd-2.0.35.tar.gz
-rw-r--r--@ 1 rupert admin 613261 Jul 26 10:22 jpegsrc.v6b.tar.gz
-rw-r--r--@ 1 rupert admin 796551 Jul 26 10:22 libpng-1.2.29.tar.gz
-rw-r--r--@ 1 rupert admin 1948751 Jul 26 09:55 mapserver-5.2.0.tar.gz
-rw-r--r--@ 1 rupert admin 1336295 Jul 26 11:11 tiff-3.8.2.tar.gz
2. Install in the ff order:
- jpegsrc
- libpng
- gd (if you have trouble installing gd, then follow this pdf:installing_gd2_on_os_x_server)
- agg (make only)
- tiff
- mapserver
3. For mapserver, please install using the ff configure switches:
./configure \ --with-agg=/myhome/rupert/mapserver/agg-2.5 \ --with-jpeg \ --with-gd \ --with-freetype \ --with-png \ --with-ogr \ --with-proj \ --with-gd \ --with-httpd=/usr/local/apache2/bin/httpd \ --with-tiff \ --with-wfs \ --with-wcs \ --with-sos \ --with-wmsclient \ --with-wfsclient \ --with-tiff \ --with-gdal=/usr/local/bin/gdal/gdal-config \ --with-geos=/usr/local/bin/geos-config \ --with-postgis=/usr/local/pgsql/bin/pg_config
4. Mapserver output
rupert:mapserver-5.2.0 rupert$ ./mapserv -v MapServer version 5.2.0 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=GEOS INPUT=TIFF INPUT=EPPL7 INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE
Installing Mapserver on MacOSX Leopard (the easy way)
May 6th
The easiest way to install mapserver on your Leopard is by downloading and installing dmg files from www.kyngchaos.com (courtesy of William Kyngesburye). These binaries were also noted from Mapserver’s Download Page.
1. Download the ff binaries in order (please note the version numbers at the time of writing):
1. UnixImageIO_Framework-1.0.22a.dmg
2. FreeType_Framework-2.3.5-3.dmg
3. GEOS_Framework-3.0.0-2.dmg
4. PROJ_Framework-4.6.0-1.dmg
5. SQLite3_Framework-3.5.7-1.dmg
6. MapServer-5.0.2-2.dmg
2. Once installed, you can copy the mapserv binaries to your apache cgi-bin
sudo cp /Library/WebServer/CGI-Executables/mapserv /usr/local/apache2/cgi-bin/
3. Check the mapserv output
rupert:~ rupert$ /usr/local/apache2/cgi-bin/mapserv -v MapServer version 5.0.2 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP OUTPUT=SWF OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUPPORTS=GEOS INPUT=EPPL7 INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE
This is actually the first time I was able to install mapserver NOT BY SOURCE and still achieve the same binaries that I wanted (with AGG support). Full credit should be given to William.
Using TileCache, OpenLayers, Mapserver for Projection 900913
Apr 8th
I had a few problems with TileCache the other week which I am eager to blog about, since I knew for sure that later on, I might encounter the same. I don’t have the exact errors with me right now, so I’m jotting this down from my head…
- Classic Resolutions problem. Use extent_type=loose
- Can not set image type
UPDATED (JAN 11, 2010): Classic Resolutions problem:
How are resolutions calculated? Assuming we have:
Original:
Lower Left (LL) or minx, miny: 12453557, -5434940
Upper Right (UR) or max, maxy: 16980842, -1180729
maxResolution = (max – minx)/tilesize = (16980842 – 12453557)/512 = 8842.353
where tilesize = 512.
Therefore, we can set/guess for max so that we have maxResolution as a whole number.
Adjusted:
minx, miny: 12453557, -5434940
maxx, maxy: 16980661, -1180729
gives a maxResolution (whole number) of 8842.
Now, you can use 8842 in both the TileCache.cfg and OpenLayers Javascript. More >
Installing Mapserver on Debian (reprise)
Mar 28th
As noted from my previous blog post regarding Mapserver on Debian, you don’t get AGG with Mapserver when installing directly from Debian packages. Thus, it would be better to install Mapserver by source. However, debian still helps because it would install all the necessary libraries needed for compiling mapserver. More >
Passing Parameters to Mapserver
Jan 4th
I was bitten 4 hours searching for this in the mailing list. I have a postgis layer defined in mapserver map file as follows:
LAYER
NAME "pois"
STATUS DEFAULT
GROUP "pois"
TYPE POINT
CONNECTIONTYPE postgis
PROCESSING "CLOSE_CONNECTION=DEFER"
CONNECTION "user=lbs password=xtlme15n dbname=beijing_stat host=192.168.1.211 port=5432"
#DATA "the_geom from (SELECT poi_id, the_geom FROM poi WHERE new_block_id = 7) as foo USING UNIQUE poi_id USING SRID=4326"
DATA "the_geom from poi as foo USING UNIQUE poi_id USING SRID=4326"
FILTER "new_block_id=%myid%"
CLASS
NAME "block-pois"
STYLE
SYMBOL "circle"
COLOR 255 0 0
SIZE 10
END
END
ENDTraditionally, I could append and change the FILTER attribute by passing it to the Mapserver CGI as follows:
map.pois.filter=new_block_id%3D700.
Apparently, this changed with Mapserver 5.0. Please see MapServer 4.10 to 5.0 Migration Guide. Thanks to this mailing list thread, it turned out that we need to pass a value to a custom variable set in the mapfile for security reasons. Hope this one, goes in to the docs. I was hoping to comment out in the Mapserver Documentation but registration is holding me off with a ‘Connection Refused’.
Comments