imageThere are already Windows packages available for MapServer ready for deployment. However if you need to make a modification to the source files, apply a patch, or just want to see how MapServer is made then you can build MapServer from its C source files. Thanks to the ready made build kits this process should only take 10-15 minutes from start to finish.

Prerequisites: Microsoft Visual Studio with C++

1. Download the MapServer SDK (Software Development Kit) from http://www.gisinternals.com/sdk/. I’m using Visual Studio 2010, and building on a 32-bit Windows machine (still using XP..), so I’m using release-1600-dev

These build kits, provided by one of MapServer’s developers Tamas Szekeres,  contain everything you need to compile both MapServer and GDAL. Checking out all the files from the MapServer SVN repository is not enough, as this does not contain the GDAL or RegEx dependencies (DLLs that MapServer depends on), or SWIG – a tool used to create MapScript files for each of the different scripting languages available in MapServer such as Python, Ruby, PHP, Perl etc.

image OGR, created by Frank Warmerdam, is an open source library and set of command line utilities for reading and writing geospatial vector data using many different formats . It is the vector equivalent of GDAL which has similar functionality for rasters.

The name of the library is a vestige from when OGR used to stand for OpenGIS Simple Features Reference Implementation. However as OGR is not fully compliant with the OpenGIS Simple Feature specification the name was changed to OGR Simple Features Library (from the GDAL FAQ).

The latest additions to the OGR formats are the SQL Server 2008 geometry and geography. This enables spatial data in SQL Server 2008 to be reprojected, and converted to other formats (shapefiles, MapInfo, KML, GML, GeoJSON and any of the many other formats already supported by OGR) using freely available open source tools. Details on the associated OGR tools can be seen here.

The full MSSQLSpatial OGR driver notes and details are available online.

Continue reading »

Tamas Szekeres maintains a site with many different compiled versions of MapServer at http://vbkto.dyndns.org/sdk/ (the site can occasionally be overloaded or down). These are compiled daily direct from the source. It is a veritable Aladdin’s cave of treasures – especially if you are installing on a Windows Server, and even more so if you are installing for 64bit.

It gets even better though! Included in the installation are the latest SQL Server 2008 driver, 64 bit GDAL, and MapScript Python bindings. MapScript allows MapServer functions and classes to be scripted in a variety of languages.

As Python is becoming ubiquitous in the GIS world (opensource and proprietary), if you aren’t familiar with PHP then You can download the zip file and extract to a folder on your machine, in the example below I used C:\ms4w64 (old habits die hard!).

Continue reading »

I’m trying (and having) to start using Python more and more due to its ubiquity in the OpenSource GIS world. There are a number of add-ons and libraries for MapServer that require Python to function properly and/or quickly. It is also widely used for scripting both MapServer objects and for raster manipulation using GDAL. I initially set up Python under Apache to run the Tilecache tile server.

According to the ModPython site – “Python will run many times faster than traditional CGI and will have access to advanced features such as ability to retain database connections.”

Mod_python is an Apache module that embeds the Python interpreter within the server, and can be downloaded from their site. There are versions for both Unix and Windows, which makes it ideal for MapServer for Windows (MS4W). Ironically after saying that using Python for web applications is many times faster than CGI, the ModPython download page uses CGI..

Continue reading »