image Installing Python modules on 32 bit Windows is a fairly simple process once you get to know the vocabulary of packages (Python scripts and libraries), eggs (similar to a bundled zip file), and the Cheeseshop (the Python “app store” equivalent – now renamed the Python Package Index or PyPi).

Many popular packages in PyPi have custom Windows installers that take care of both Python files and any associated DLLs. For example Shapely and NumPy.

For other packages the easiest way to add them to your Python installation is to use Setup Tools. Download the Windows setup package corresponding to your version of Python from http://pypi.python.org/pypi/setuptools and double click to install.

This adds an easy_install.exe to your C:\Python\Scripts folder that can be used to quickly add packages.  You run easy_install from the Windows command line followed by the name of the package. It searches the online PyPi for the best match for your Python version, and then downloads and installs it.

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 »

image There a number of benefits to using a cascading WMS service – a WMS service that is read and then forwarded on through an intermediary WMS server:

  • you can cache the service (for example with TileCache) to greatly improve performance
  • your application need only worry about a single point of connection, using WMS layers aggregated from many different sources
  • you can add additional metadata missing from the source
  • services can be reprojected (using GDAL)
  • you can merge WMS layers together and server them out as a new map layer

There are also some negatives:

  • you have additional server configuration to set up and maintain
  • if you are not adding or changing the WMS service you should probably connect to the WMS service directly in the client applications, otherwise there will be a performance hit
  • caching may contravene the licensing agreement of the original WMS source

The rest of this post details the steps in setting up a cascading WMS using MapServer. You need MapServer 5.4.1 or higher to implement a secure cascaded WMS service. This example uses a 64-bit version of MapServer 5.6 taken from Tamas Szekeres’s autobuilds site installed in a C:\ms4w64 folder. It also assumes MapServer has been configured with SSL as detailed in another post. In this example I use IIS and Windows Server 2003.

imageMapServer makes use of libcurl.dll to connect to web resources. The reason I’ve had to learn this is because libcurl.dll is vital when using MapServer as a WMS client, or “a cascading WMS server” – using MapServer to connect to another WMS server and then “forward” them as if they were any other map layer.

libcurl.dll is the library version of the command line tool cURL – a tool written in C (hence the name) that:

is a command line tool for transferring data with URL syntax, supporting FTP, FTPS, HTTP, HTTPS…curl supports SSL certificates, HTTP POST, HTTP PUT, FTP uploading…

..libcurl is most probably the most portable, most powerful and most often used C-based multi-platform file transfer library on this planet – be it open source or commercial. – http://curl.haxx.se/

imageThe following is the first in a series of posts related to configuring a 64-bit Windows server as a GIS server  using MapServer and Python.

Why move to 64-bit?

If a server’s operating system and hardware are 64-bit it seems a waste not to take advantage of them. It may be better to look at the question why move to 64-bit software, as why wouldn’t you move to 64-bit software?

Its nice to be able to claim one-upmanship over commercial GIS products who are only now bringing out 64 bit versions. However having gone through the pain of setting up Open Source GIS applications on Windows I’m not surprised companies took the time to simplify the process (and wait for Microsoft to do some of the legwork) rather than dealing with all the 32/64 bit support issues too early.

image Welcome to a veritable novella. I’ll jump straight to the end – there is no happy outcome, as yet, to this post there is a happy outcome! I have compiled a 64 bit PyISAPIe DLL (a program that runs Python at high speed under IIS), and it is up and running on Windows Server 2008 and IIS7. Many thanks to Phillip Stabon, the creator of PyISAPIe, for additional help, and for the latest version of PyISAPIe which makes compilation for different set ups much easier.

Some background information – I’ve not done any C++ for 10 years (and even then my most advanced program was to finish off a code sample on a hotel register for pirates – of the traditional kind). Also I’ve never used Subversion. Hence there are lots of pictures, and every step is detailed. If there’s anything missing let me know.

I’m not sure why I started doing this – the performance of Python using 32-bit version is fine, and since I started working on this Phillip Stabon, has mentioned he will be making a 64 bit DLL himself. However as there are many different versions of Python around, and different GIS tools rely on different versions it seemed a good idea to document how to do this from scratch.

In this example I’m using Visual Studio 2008, and a number of other tools that are detailed as I go along. I’ve also got the 64 bit compilation tools installed. There are a few notes from Phillip on compiling it for Windows 64-bit in the discussion lists (see quoted text underneath the post). Since this post was first published there is a newer discussion in the forums.

Anyway “How to Compile PyISAPIe for a 64-bit Server in 5 Easy Steps!”…

Continue reading »

This step should be simple. Run the Visual Studio 2008 SetUp program and check the “X64 Compilers and Tools” option under Visual C++

image5

Continue reading »