[mapserver-users] question regarding postgis

Jan Hartmann jhart at frw.uva.nl
Mon Sep 9 07:59:37 EDT 2002


Hello Jens (hope this also answers Nyon's question),

Let's clear some possible confusion at first: there are two versions of 
MapServer for Windows: native and cygwin, and one version of PostGis for 
Windows: cygwin. I haven't been able to find a working version of 
PostgreSQL for native Windows, which is under development (can anyone 
give me some pointers to non-Cygwin PostgreSQL for Windows)?

If you use Cygwin for both, you shouldn't have any problem; Cygwin 
installation is just a variant of Unix, and is well documented and 
supported. For MapServer see the docs at 
http://mapserver.gis.umn.edu/doc36/mapserver-Cygwin-howto.html, and for 
PostGreSQL Norman Vine's posting at 
http://mapserver.gis.umn.edu/wilma/mapserver-users/0209/msg00078.html 
and the PG-Cygwin mailing list 
(http://archives.postgresql.org/pgsql-cygwin/). In Cygwin-MapServer, 
PostGis is just another option to add in the standard configure script. 
I haven't use either of them. I use Cygwin all the time on my Windows 
box, but not for server applications, as I find this easier and more 
stable on a regular Linux machine. If you prefer a Windows environment 
for your server (or are bound to it), Cygwin seems to be mature enough 
according to several postings on this list.

Native Windows is another matter. MapServer is very well supported on 
Windows. Compilation is relatively straightforward, with most 
configurations available as options in the Makefile, and binaries can be 
downloaded for four different configurations. PostGis however has not 
yet been added to the configuration options in the Makefiles, although 
everything you need is in place. Also, there are no precompiled binaries 
available (yet) with PostGis support. Daniel Morissette has put it on 
the todo list "as time permits", so probably it won't be done tomorrow 
or perhaps even this week. There are not many changes required in the 
Makefiles however. I posted a few lines on this in 
http://mapserver.gis.umn.edu/wilma/mapserver-users/0209/msg00077.html
You wrote that you were able to compile MapServer CGI with PostGIS 
support, but were unable to get the PHP version running. Perhaps you 
forgot to adapt the Makefile in the PHP directory also (at least that 
was my error at first). You need to put in -DUSE_POSTGIS and the paths 
to the pgsql libraries there too, else you will end up with an 
error-free compilation, a PostGis enabled MapServer CGI and no 
PHP-PostGIS functionality. I stopped my own Windows development half a 
year ago, so I cannot produce recent binaries. However, if you are 
really stuck and Daniel can't find time in the foreseeable future, drop 
me a mail and I'll see what I can do.

With this PostGIS enabled MapServer you can access any PostGIS database, 
whether on different machines or on the same, Linux, Cygwin, native or 
whatever. I just tested it against a database on a a remote Linux 
machine within our very fast University network. This was not fast 
enough for productivity purposes (as you say, the whole vector layer has 
to be transported over the net), so I switched MapServer to the same 
Linux machine, where it ran only slightly slower with PostGis than when 
using shapefiles. I didn't try the other way round (switching PostGIS to 
Windows), as I had read this was not stable yet. According to several 
postings on this list, this already seems to be a viable solution at 
this time.

I would like to point out however a very important way of use of PostGis 
on remote servers: you can create maps from layers on different 
computers. Say, you have a mapfile like:

LAYER
   CONNECTIONTYPE POSTGIS
   CONNECTION "my first postgis server"
    DATA "some sql"
   etc..
END
LAYER
    CONNECTIONTYPE POSTGIS
    CONNECTION "My second postgis server"
    DATA "some more sql"
    etc ...
END
LAYER
    DATA "my local shapefile
    etc ...
END

You effectively create a map from a combination of local data and data 
from two different mapping servers. This is OpenGis with a vengeance! It 
works just like a WMS application, only with far much more functionality 
  in retrieving and displaying layers. Moreover, the retrieving language 
is standard SQL, which can build very powerful mapping queries, and will 
be expanded shortly by a set of OGR topology operators. This is ways and 
ways ahead of anything the OpenGis Consortium has reached till now. (As 
an addendum, you can also put the DATA-query outside the mapfile in the 
parameter-string of the calling web page. This makes it even more like 
an immensely more powerful WMS call). I am trying this out on our 
Beowulf cluster with some dozens of nodes and it looks very promising 
indeed! I can't put it up for public use as yet, for the cluster is 
being mostly used for things like cracking the genetic code and 
searching for black holes at the other end of the universe, so people 
won't like you guys prying in to get a map of Itasca, Minnesota (say). 
As soon as the results are less shaky I'll try to reserve some parts of 
it for public display.

Jan


Jens Günther wrote:

The problem is : what run's where!

We are running all (the  cgi and the mapscript and postgis/gresql) on 
the same windows machine. The compilation process of mapscript on 
windows (necessary for postgis-support) is a "little bit" dirty (you 
have to change a lot of makefiles). We mailed this problem (and asked 
for binaries) one week before. Do you have mapscript binaries with 
postgis support for windows?

The point with the two servers sounds interesting to me. What about the 
performance? How fast is it (all the necessary geometries are fetched 
over the network)?
We are planning, to implement a solution with some more machines. It 
would be great, to know about other users experience with it.

Regards
Jens Günther

Jens Günther wrote:
> 
> The problem is : what run's where!
> 
> We are running all (the  cgi and the mapscript and postgis/gresql) on the same windows machine. The compilation process of mapscript on windows (necessary for postgis-support) is a "little bit" dirty (you have to change a lot of makefiles). We mailed this problem (and asked for binaries) one week before. Do you have mapscript binaries with postgis support for windows?
> 
> The point with the two servers sounds interesting to me. What about the performance? How fast is it (all the necessary geometries are fetched over the network)? 
> 
> We are planning, to implement a solution with some more machines. It would be great, to know about other users experience with it.
> 
> Regards
> Jens Günther
> guenther_jens at web.de
> ______________________________________________________________________________
> Die clevere Geldreserve: der DiBa-Privatkredit. Funktioniert wie ein Dispo, 
> ist aber viel gunstiger! Alle Infos: http://diba.web.de/?mc=021104
> 
> 





More information about the mapserver-users mailing list