Re: [UMN_MAPSERVER-USERS] Mapscript with php as apache module

2006-12-25 Thread Rob Cermak
For Mapserver 4.10 and PHP 5.1.6:

Add this line after all the PHP tests...

 test -f "/usr/include/php/Zend/acconfig.h" &&
PHP_SRC_DIR="/usr/include/php/" &&
PHP_CONFIG_H="/usr/include/php/Zend/acconfig.h"

It is a hack, but it will make the module compile for Apache2/PHP5.  Be
sure to have the php-devel or like package loaded.  Once PHP stops moving
headers around maybe a fix will sneak into the configure script for
Mapserver.  The permutations needed in the last couple updates have been
numerous.

We are using prefork with no problems.

Several versions of Mapserver compiled fine with PHP5 once you find the
correct header files and locations.

Details on our manual installation can be gleemed from here:
  https://db.aoos.org/wiki/index.php/AOOS_Systems_Software

Our base operating system is 32-bit 2007.0 Mandriva

Rob

On Fri, December 22, 2006 5:39 am, Daniel Morissette wrote:
> Gregor Mosheh wrote:
>>
>> Reading those bugzilla entries, that's very encouraging. Thanks for
>> pointing those out, Antti.
>>
>> Any "it works for me" with Unix, Apache 2 (thread or prefork), PHP 5
>> as a
>> DSO, using a lot of PHP/Mapscript? Is there an "official" word on the
>> stability of this configuration? Or am I gonna have to try it myself
>> for a
>> few days and post a "it seems to work for me"? :)
>
> Yes, version 4.10 should be safe to use with PHP as an Apache module, I
> am not aware of any outstanding issue on that front... 4.6.1 and 4.8
> might be okay too, but I'm not sure, so using 4.10 is the safest way to
> go.
>
> Daniel
> --
> Daniel Morissette
> http://www.mapgears.com/
>


-- 
Alaska Ocean Observing System
Database Manager
907-474-7948 (skype:rob_cermak)


[UMN_MAPSERVER-USERS] patch for SLD (vs. 4.8.3)

2006-09-12 Thread Rob Cermak
Hi,

We have a patch for the SLD rendering for the colormap.  It seems that it is
documented to take doubles, but all floats passed via SLD become ints through
use of atoi.

This patch only takes care of the ColorMap.  This allows color rendering of
float values.

http://ak.aoos.org/data/patch/mapserver_483_mapogcsld.patch

If some change could work into 4.10, that would be great.

Cheers,
Rob

--- mapogcsld.c.orig2006-09-12 15:30:39.0 -0800
+++ mapogcsld.c 2006-09-12 15:32:24.0 -0800
@@ -2354,6 +2354,7 @@
 char szExpression[100];
 int nClassId = 0;
 double dfOpacity = 1.0;
+char *pch, *pchPrevious;

 if (!psRoot || !psLayer)
   return;
@@ -2403,10 +2404,32 @@
 sColor.blue = hex2int(pszPreviousColor+5);

 /* ?? Test if pszPreviousQuality < pszQuantity */
-sprintf(szExpression,
-"([pixel] >= %d AND [pixel] < %d)",
-atoi(pszPreviousQuality),
-atoi(pszQuantity));
+
+   /* pszQuantity and pszPreviousQuality may be integer or 
float */
+   pchPrevious=strchr(pszPreviousQuality,'.');
+   pch=strchr(pszQuantity,'.');
+   if (pchPrevious==NULL && pch==NULL) {
+ sprintf(szExpression,
+ "([pixel] >= %d AND [pixel] < %d)",
+ atoi(pszPreviousQuality),
+ atoi(pszQuantity));
+   } else if (pchPrevious != NULL && pch==NULL) {
+ sprintf(szExpression,
+ "([pixel] >= %f AND [pixel] < %d)",
+ atof(pszPreviousQuality),
+ atoi(pszQuantity));
+   } else if (pchPrevious == NULL && pch != NULL) {
+ sprintf(szExpression,
+ "([pixel] >= %d AND [pixel] < %f)",
+ atoi(pszPreviousQuality),
+ atof(pszQuantity));
+   } else {
+ sprintf(szExpression,
+ "([pixel] >= %f AND [pixel] < %f)",
+ atof(pszPreviousQuality),
+ atof(pszQuantity));
+   }
+
 if (psLayer->numclasses < MS_MAXCLASSES)
 {
 initClass(&(psLayer->class[psLayer->numclasses]));
@@ -2456,7 +2479,15 @@
 sColor.red = hex2int(pszColor+1);
 sColor.green= hex2int(pszColor+3);
 sColor.blue = hex2int(pszColor+5);
-sprintf(szExpression, "([pixel] = %d)", atoi(pszQuantity));
+
+   /* pszQuantity may be integer or float */
+   pch=strchr(pszQuantity,'.');
+   if (pch==NULL) {
+ sprintf(szExpression, "([pixel] = %d)", atoi(pszQuantity));
+   } else {
+ sprintf(szExpression, "([pixel] = %f)", atof(pszQuantity));
+   }
+
 if (psLayer->numclasses < MS_MAXCLASSES)
 {
 initClass(&(psLayer->class[psLayer->numclasses]));


Rob
-- 
Alaska Ocean Observing System
Database Manager
907-474-7948


Re: [UMN_MAPSERVER-USERS] PHP5 mapserver + mapscript

2005-11-14 Thread Rob Cermak
Peter,

We are running Mapserver/Mapscript under apache2/php5 on Mandrake 10.2 
(Linux). 

We are using a combo of source and source RPMS to get the job done.

Build notes of various parts can be found here:
  http://ak.aoos.org/dev/mapserver.html

Rob

On Thu, 27 Oct 2005, Ing.Peter Misovic wrote:

> Thank to all for your help. I gonna to try it under Linux.
> 
> Nice day.
> 
> Peter
> 
> On 10/27/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > Hello Peter,
> >
> > You can use MapServer and MapScript with PHP 5.
> >
> > For Windows you can use the precompiled binaries at
> > http://dl.maptools.org/dl/, latest is mapserver-4.6.1-win32-
> > php5.0.5.zip
> >
> > I don't know if there are any easy-installers for Linux available, the
> > FGS installer from MapTools is for PHP 4
> > (http://www.maptools.org/fgs/).
> >
> > But you can compile all needed things yourself of course, see
> > http://ms.gis.umn.edu/docs/howto/verboselinuxinstall for more info.
> >
> > Also don't forget to search the MapServer mailing list.
> >
> > Regards,
> >
> > Emil
> >
> >
> > - Oorspronkelijk bericht -
> > Van: "Ing.Peter Misovic" <[EMAIL PROTECTED]>
> > Datum: donderdag, oktober 27, 2005 1:05 pm
> > Onderwerp: [UMN_MAPSERVER-USERS] PHP5 mapserver + mapscript
> >
> > > Dear all,
> > > at first I start work with I like to know if I can use
> > > mapserver+mapscript with php5.
> > >
> > >
> > > Thank you to all.
> > >
> > >
> > > Peter
> > >
> >
> 

-- 
Rob Cermak : 907-474-7948 : FAX 907-474-7204 : PGP = 0x75869A6E
Alaska Ocean Observing System : Data Management 
School of Fisheries and Ocean Sciences : University of Alaska Fairbanks
[EMAIL PROTECTED] : [EMAIL PROTECTED]
[EMAIL PROTECTED] : [EMAIL PROTECTED]