[mapserver-users] question regarding postgis

Jan Hartmann jhart at frw.uva.nl
Thu Sep 5 07:48:27 EDT 2002


Hankley, Chip wrote:

>I'm pretty sure that there is NOT a pre-compiled binary (for windows) that
>has PostGIS support on the DMSolutions site. I think that you'll have to use
>the CGI mapserver for now... (if you want to do PostGIS).
>
>Chip
>  
>

I compiled PostGIS support into my Windows MapServer sourcetree half a 
year ago. At that time I needed to add two  #defines for BIG_ENDIAN and 
LITTLE_ENDIAN in mappostgis.c (added in the regular distribution since 
then, I think), and add compile and link directives both in the main 
Makefile.vc and in the PHP-Mapscript Makefile.vc: -DUSE _POSTGIS and the 
paths to libpqdll.lib and the libpq include directory in the Makefile 
variables POSTGIS_LIB and POSTGIS_INC. The required PostgreSQL libraries 
are available for Windows, although the complete PostgreSQL database 
system is not (as yet). 

This means that with some minor patches it is possible to access layers 
from a PostGIS server with both CGI and PHP Mapserver. However,  
PostGIS  cannot be running on the same server as the (Windows) 
MapServer, as PostgreSQL cannot be compiled for native Windows (yet). 
This leads to severe performance problems, as a MapServer request for a 
PostGIS layer will cause the complete vector layer to be transported 
over the net. Only then it can be rendered by MapServer. For that reason 
I completely switched over to Linux, and can't produce the binaries any 
more,.

It shouldn't be too difficult to add those directives in the regular 
MapServer distribution. As a general rule MapServer support for 
MS-Windows compilation is excellent, so I don't understand why PostGIS 
isn't taken in as an option for compilation or in the binary 
distributions. Am I overlooking some difficulties here?

Jan Hartmann
Department of Geography
University of Amsterdam
jhart at frw.uva.nl




More information about the mapserver-users mailing list