Re: [mapserver-users] Why mapfile parsing is so slow on Windows

2010-03-29 Thread Rahkonen Jukka
Hi,
 
Sorry, I can't help you with your question but I would also like to know the 
answer if this is a common behaviour.  I checked with my mapfile which has 
about 2000 lines and parsing time is something like 0.1 seconds on Windows.  
How long is your quite a long mapfile?
 
I suppose that making parsing faster would mean that there should be some kind 
of cache or then a super fast disk.  Is anybody using ramdisks nowadays?
 
-Jukka Rahkonen-




Lähettäjä: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] Puolesta Erdem Guven
Lähetetty: 25. maaliskuuta 2010 17:47
Vastaanottaja: mapserver-users@lists.osgeo.org
Aihe: [mapserver-users] Why mapfile parsing is so slow on Windows


Hello,

I have a quite long mapfile. On Linux it takes about 2.5 seconds to 
draw an image but on Windows it takes more than 10 seconds. 

I used same source (5.6.1) and same configuration parameters to compile 
on both platforms. 

So I used a debugger and realized that it spends more than half of the 
time to parse the mapfile.

Why mapfile parsing is so slow on Windows? What can I do about that?

Erdem


___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] php mapscript

2010-03-29 Thread Sven Schroeter

Hi,
thank you very much, shapeObj resultsGetShape is the solution.
resultsGetShape works fine.
But I don't understand why shapeObj getFeature is in the documentation?

Sven


- Original Message - 
From: Worth Lutz

To: 'Sven Schroeter' ;
Sent: Friday, March 26, 2010 11:09 PM
Subject: RE: [mapserver-users] php mapscript


This problem is due to the new single pass query in 5.6.

I have marked your code with what I am using.

Try these mods marked with *:


@$datQuery = $query_layer-queryByRect($qRect);

//number of objects
$resnum = $query_layer-getNumResults();  echo number of objects: 
.$resnum.br;


//if query success
if ($datQuery == MS_SUCCESS) {
//  $query_layer-open();  // REMOVE OPEN AND CLOSE ***

 //first row
 $result = $query_layer-getResult(0);


 //$shpobj = 
$query_layer-getShape($result-tileindex,$result-shapeindex);
 // resultsGetShape is now the way to get the shape object 
***
 // note: change of order in arguments 

 $shpobj = $query_layer-resultsGetShape($result-shapeindex, 
$result-tileindex);



 //read attribute
 $attr = $shpobj-values;

 //write headline
 echo 'table cellspacing=0 cellpadding=2 border=1 tr';
 foreach($attr as $name=$wert) {
  echo 'td bgcolor=#CC'.$name.'/td';
 }
 echo '/tr';

 //write datasets
 for ($j=0; $j$query_layer-getNumResults(); $j++) {
  $result = $query_layer-getResult($j);


  //$shpobj = 
$query_layer-getShape($result-tileindex,$result-shapeindex);
  // see note above 
**
  $shpobj = $query_layer-resultsGetShape($result-shapeindex, 
$result-tileindex);



  $ri = $result-tileindex;
  $si = $result-shapeindex;
  $attr = $shpobj-values;
  echo 'tr id=row'.$si.' ';
  foreach($attr as $name=$wert) {
   echo 'td'.$wert.'/td';
  }
  echo '/tr';
  $shpobj-free();
 }
//  $query_layer-close();  // REMOVE OPEN AND CLOSE ***
 echo '/table';

} // end success
...


-Original Message-
From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Sven Schroeter

Sent: Thursday, March 25, 2010 10:52 AM
To: mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] php mapscript

Alan,
thanks for the reply, I tried it with getFeature(), but there comes the same
error.
nextShape() works only after msWhichShapes and here I need a rectobj.
But I want to use the script for queryByShape and queryByAttributes too.
Why there comes no array in $attr = $shpobj-values; ?
Any idea?
Sven

- Original Message - 
From: Alan Boudreault aboudrea...@mapgears.com

To: mapserver-users@lists.osgeo.org
Cc: Sven Schroeter schroe...@netgis.de
Sent: Thursday, March 25, 2010 2:32 PM
Subject: Re: [mapserver-users] php mapscript



Sven,

getShape() is deprecated. Use rather getFeature(). I suggest to also take
a
look at the nextShape() function:
http://mapserver.org/mapscript/php/index.html#layerobj-class

Alan

On March 25, 2010 09:18:50 am Sven Schroeter wrote:

Hi,
I have an old php mapscript code that works fine with mapserver 5.02 or
 5.2, but not with 5.6.1.
The code runs an attribute tabe from a postgis layer and different querys
i.e. queryByRect:

...
@$datQuery = $query_layer-queryByRect($qRect);

 //number of objects
 $resnum = $query_layer-getNumResults();
 echo number of objects: .$resnum.br;

 //if query success
if ($datQuery == MS_SUCCESS) {
  $query_layer-open();

  //first row
  $result = $query_layer-getResult(0);
  $shpobj =
$query_layer-getShape($result-tileindex,$result-shapeindex);
  //read attribute
  $attr = $shpobj-values;

  //write headline
  echo 'table cellspacing=0 cellpadding=2 border=1 tr';
  foreach($attr as $name=$wert) {
   echo 'td bgcolor=#CC'.$name.'/td';
  }
  echo '/tr';

  //write datasets
  for ($j=0; $j$query_layer-getNumResults(); $j++) {
   $result = $query_layer-getResult($j);
   $shpobj =
 $query_layer-getShape($result-tileindex,$result-shapeindex); $ri =
 $result-tileindex;
   $si = $result-shapeindex;
   $attr = $shpobj-values;
   echo 'tr id=row'.$si.' ';
   foreach($attr as $name=$wert) {
echo 'td'.$wert.'/td';
   }
   echo '/tr';
   $shpobj-free();
  }
  $query_layer-close();
  echo '/table';

} // end success
...

In ms 5.6.1 the query is also successful (I get the correct number of
objects) but there comes following warning:
Invalid argument supplied for foreach() in ... Fatal error: Call to a
 member function free() on a non-object in ...
No object? Why? What has changed?
Thanks
Sven



___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users



--
Alan Boudreault
Mapgears
http://www.mapgears.com






___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users 


RE: [mapserver-users] php mapscript

2010-03-29 Thread Worth Lutz
I don't think that the documentation has caught up with the changes in the
program.  People using older versions of MapServer have to use the older
method and the new method is used for 5.6+ version.  It was described
briefly in the migration document but took me some experimentation to get
results.

Worth

-Original Message-
From: Sven Schroeter [mailto:schroe...@netgis.de] 
Sent: Monday, March 29, 2010 4:18 AM
To: Worth Lutz
Cc: mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] php mapscript

Hi,
thank you very much, shapeObj resultsGetShape is the solution.
resultsGetShape works fine.
But I don't understand why shapeObj getFeature is in the documentation?

Sven


- Original Message - 
From: Worth Lutz
To: 'Sven Schroeter' ;
Sent: Friday, March 26, 2010 11:09 PM
Subject: RE: [mapserver-users] php mapscript


This problem is due to the new single pass query in 5.6.

I have marked your code with what I am using.

Try these mods marked with *:


@$datQuery = $query_layer-queryByRect($qRect);

 //number of objects
 $resnum = $query_layer-getNumResults();  echo number of objects: 
.$resnum.br;

 //if query success
if ($datQuery == MS_SUCCESS) {
//  $query_layer-open();  // REMOVE OPEN AND CLOSE ***

  //first row
  $result = $query_layer-getResult(0);


  //$shpobj = 
$query_layer-getShape($result-tileindex,$result-shapeindex);
  // resultsGetShape is now the way to get the shape object 
***
  // note: change of order in arguments 

  $shpobj = $query_layer-resultsGetShape($result-shapeindex, 
$result-tileindex);


  //read attribute
  $attr = $shpobj-values;

  //write headline
  echo 'table cellspacing=0 cellpadding=2 border=1 tr';
  foreach($attr as $name=$wert) {
   echo 'td bgcolor=#CC'.$name.'/td';
  }
  echo '/tr';

  //write datasets
  for ($j=0; $j$query_layer-getNumResults(); $j++) {
   $result = $query_layer-getResult($j);


   //$shpobj = 
$query_layer-getShape($result-tileindex,$result-shapeindex);
   // see note above 
**
   $shpobj = $query_layer-resultsGetShape($result-shapeindex, 
$result-tileindex);


   $ri = $result-tileindex;
   $si = $result-shapeindex;
   $attr = $shpobj-values;
   echo 'tr id=row'.$si.' ';
   foreach($attr as $name=$wert) {
echo 'td'.$wert.'/td';
   }
   echo '/tr';
   $shpobj-free();
  }
//  $query_layer-close();  // REMOVE OPEN AND CLOSE ***
  echo '/table';

} // end success
...


-Original Message-
From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Sven Schroeter
Sent: Thursday, March 25, 2010 10:52 AM
To: mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] php mapscript

Alan,
thanks for the reply, I tried it with getFeature(), but there comes the same
error.
nextShape() works only after msWhichShapes and here I need a rectobj.
But I want to use the script for queryByShape and queryByAttributes too.
Why there comes no array in $attr = $shpobj-values; ?
Any idea?
Sven

- Original Message - 
From: Alan Boudreault aboudrea...@mapgears.com
To: mapserver-users@lists.osgeo.org
Cc: Sven Schroeter schroe...@netgis.de
Sent: Thursday, March 25, 2010 2:32 PM
Subject: Re: [mapserver-users] php mapscript


 Sven,

 getShape() is deprecated. Use rather getFeature(). I suggest to also take
 a
 look at the nextShape() function:
 http://mapserver.org/mapscript/php/index.html#layerobj-class

 Alan

 On March 25, 2010 09:18:50 am Sven Schroeter wrote:
 Hi,
 I have an old php mapscript code that works fine with mapserver 5.02 or
  5.2, but not with 5.6.1.
 The code runs an attribute tabe from a postgis layer and different querys
 i.e. queryByRect:

 ...
 @$datQuery = $query_layer-queryByRect($qRect);

  //number of objects
  $resnum = $query_layer-getNumResults();
  echo number of objects: .$resnum.br;

  //if query success
 if ($datQuery == MS_SUCCESS) {
   $query_layer-open();

   //first row
   $result = $query_layer-getResult(0);
   $shpobj =
 $query_layer-getShape($result-tileindex,$result-shapeindex);
   //read attribute
   $attr = $shpobj-values;

   //write headline
   echo 'table cellspacing=0 cellpadding=2 border=1 tr';
   foreach($attr as $name=$wert) {
echo 'td bgcolor=#CC'.$name.'/td';
   }
   echo '/tr';

   //write datasets
   for ($j=0; $j$query_layer-getNumResults(); $j++) {
$result = $query_layer-getResult($j);
$shpobj =
  $query_layer-getShape($result-tileindex,$result-shapeindex); $ri =
  $result-tileindex;
$si = $result-shapeindex;
$attr = $shpobj-values;
echo 'tr id=row'.$si.' ';
foreach($attr as $name=$wert) {
 echo 'td'.$wert.'/td';
}
echo '/tr';
$shpobj-free();
   }
   $query_layer-close();
   echo '/table';

 } // end success
 ...

 In ms 5.6.1 the query is also successful (I get the correct number of
 

Re: AW: [mapserver-users] WMS GetFeatureInfo on a WFS layer

2010-03-29 Thread Yves Jacolin
Hi,

Reading again my email, it seems I mix several email response.
Le mercredi 24 mars 2010 22:55:46, Arnd Wippermann a écrit :
 I have checked, that the url is a valid wfs server, also it seems, that it
 points to a wms server.

You are right, the url sent was a WMS server, if you change wms.php by wfs.php 
it become a WFS server :)

Regards,

Y.
-- 
Yves Jacolin

Responsable Formation et Support
Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 26 57 98
Fax : 04 79 70 15 81
Mail : yves.jaco...@camptocamp.com
http://www.camptocamp.com
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] GetLegendGraphics with GROUP layer

2010-03-29 Thread Yves Jacolin
Hello,

One more question about WMS services and MapServer. Is it possible de get a 
GetLegendGraphics with a GROUPed layer?

If I used directly the layer NAMe parameter, I get my picture, if I use the 
GROUP parameter, I get no response (empty picture).

Thanks,

Y.
-- 
Yves Jacolin

Responsable Formation et Support
Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 26 57 98
Fax : 04 79 70 15 81
Mail : yves.jaco...@camptocamp.com
http://www.camptocamp.com
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] GetLegendGraphics with GROUP layer

2010-03-29 Thread Bart van den Eijnden
No not supported AFAIK.

Best regards,
Bart

On Mar 29, 2010, at 1:43 PM, Yves Jacolin wrote:

 Hello,
 
 One more question about WMS services and MapServer. Is it possible de get a 
 GetLegendGraphics with a GROUPed layer?
 
 If I used directly the layer NAMe parameter, I get my picture, if I use the 
 GROUP parameter, I get no response (empty picture).
 
 Thanks,
 
 Y.
 -- 
 Yves Jacolin
 
 Responsable Formation et Support
 Camptocamp France SAS
 Savoie Technolac, BP 352
 73377 Le Bourget du Lac, Cedex
 
 Tel : 00 33 4 79 26 57 98
 Fax : 04 79 70 15 81
 Mail : yves.jaco...@camptocamp.com
 http://www.camptocamp.com
 
 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] GetLegendGraphics with GROUP layer

2010-03-29 Thread Yewondwossen Assefa

Yves Jacolin wrote:

Hello,


One more question about WMS services and MapServer. Is it possible de 
get a GetLegendGraphics with a GROUPed layer?



If I used directly the layer NAMe parameter, I get my picture, if I 
use the GROUP parameter, I get no response (empty picture).



It does not. Will add it for the next release 
(http://trac.osgeo.org/mapserver/ticket/3410)


regards,


Thanks,


Y.
--
Yves Jacolin


Responsable Formation et Support
Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex


Tel : 00 33 4 79 26 57 98
Fax : 04 79 70 15 81
Mail : yves.jaco...@camptocamp.com
http://www.camptocamp.com


___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users
  



--

Assefa Yewondwossen   
Software Analyst   

Email: yass...@dmsolutions.ca
http://www.dmsolutions.ca/


Phone: (613) 565-5056 (ext 14)
Fax:   (613) 565-0925



___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] msencrypt problems

2010-03-29 Thread AlessandroOggioni

Dear user-forum,
I'm try to use msencrypt tool in my mapserver + pmapper using a
documentation (http://mapserver.org/utilities/msencrypt.html). Visualization
map it is ok, but when I try to use a zoo to layer or query the browser
stay to loading.
I have config my map file like:
MAP
...
CONFIG MS_ENCRYPTION_KEY path/mykey.txt
...
LAYER
...
CONNECTIONTYPE postgis
CONNECTION host=host port=5432 dbname=dbname
password={8BD971E7BA5705373C2E91861331B886} user=postgres
...
END
END

I have add PATH of Environmental Variable c:/ms4w/Apache/cgi-bin and a new
variable like: MS_ENCRYPTION_KEY path/mykey.txt

I have start setenv.bat file in my ms4w application.
This it' my log error
[Mon Mar 29 11:21:51 2010] [error] [client 127.0.0.1] PHP Warning: 
pg_connect() [function.pg-connect]: Unable to connect to PostgreSQL server:
FATAL:  password authentication failed for user postgres in
C:\\ms4w\\apps\\pmapper-4.0\\incphp\\map\\pmaplayer.php on line 57, referer:
http://localhost/pmapper-4.0/map.phtml
[Mon Mar 29 11:21:51 2010] [error] [client 127.0.0.1] P.MAPPER: Could not
connect to database, referer: http://localhost/pmapper-4.0/map.phtml
[Mon Mar 29 11:21:51 2010] [error] [client 127.0.0.1] PHP Warning: 
pg_last_error(): supplied argument is not a valid PostgreSQL link resource
in C:\\ms4w\\apps\\pmapper-4.0\\incphp\\map\\pmaplayer.php on line 59,
referer: http://localhost/pmapper-4.0/map.phtml
[Mon Mar 29 11:21:51 2010] [error] [client 127.0.0.1] P.MAPPER: PG
Connection error: , referer: http://localhost/pmapper-4.0/map.phtml

Any solution.
Thanks in advant
Best Regards
Alessandro 
-- 
View this message in context: 
http://n2.nabble.com/msencrypt-problems-tp4817669p4817669.html
Sent from the Mapserver - User mailing list archive at Nabble.com.
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] GetLegendGraphics with GROUP layer

2010-03-29 Thread Yves Jacolin
Yewondwossen, Bart,

thanks for your answer.

Y.
Le lundi 29 mars 2010 14:39:53, Yewondwossen Assefa a écrit :
 Yves Jacolin wrote:
  Hello,
 
 
  One more question about WMS services and MapServer. Is it possible de
  get a GetLegendGraphics with a GROUPed layer?
 
 
  If I used directly the layer NAMe parameter, I get my picture, if I
  use the GROUP parameter, I get no response (empty picture).

 It does not. Will add it for the next release
 (http://trac.osgeo.org/mapserver/ticket/3410)

 regards,

  Thanks,
 
 
  Y.
  --
  Yves Jacolin
 
 
  Responsable Formation et Support
  Camptocamp France SAS
  Savoie Technolac, BP 352
  73377 Le Bourget du Lac, Cedex
 
 
  Tel : 00 33 4 79 26 57 98
  Fax : 04 79 70 15 81
  Mail : yves.jaco...@camptocamp.com
  http://www.camptocamp.com
  
 
  ___
  mapserver-users mailing list
  mapserver-users@lists.osgeo.org
  http://lists.osgeo.org/mailman/listinfo/mapserver-users

-- 
Yves Jacolin

Responsable Formation et Support
Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 26 57 98
Fax : 04 79 70 15 81
Mail : yves.jaco...@camptocamp.com
http://www.camptocamp.com
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] offtopic, qgis website down?

2010-03-29 Thread Andy Colson

Sorry to be off topic, qgis.org seems to have gone away.

http://downforeveryoneorjustme.com/

says its down for everyone.

I asked google for a qgis forum or mailing list, which it gave me, and 
they don't seem to be talking about it.



Anyone know the status of qgis.org?

-Andy
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] How to do that kind of querying using CGI (with Openlayers)

2010-03-29 Thread Paul james
Hello guys...

The application has a Search Window, with all Roads listed...
The user will choose one road, so my map should highlight that road and zoom
in (if possible)...

I already did that using C# Mapscript, but I dont know how to do that using
CGI/OL...

Any ideas?

Thanks

Paul
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] offtopic, qgis website down?

2010-03-29 Thread Andy Colson

Yeah, an admin on this list fixed it and sent me a note.

-Andy

On 3/29/2010 3:02 PM, Luigi Castro Cardeles wrote:

Here is working qgis.org http://qgis.org.

[]'s
Luigi Castro Cardeles


2010/3/29 Andy Colson a...@squeakycode.net mailto:a...@squeakycode.net

Sorry to be off topic, qgis.org http://qgis.org seems to have gone
away.

http://downforeveryoneorjustme.com/

says its down for everyone.

I asked google for a qgis forum or mailing list, which it gave me,
and they don't seem to be talking about it.


Anyone know the status of qgis.org http://qgis.org?

-Andy
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org mailto:mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users




___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] Mapserver browser compatability

2010-03-29 Thread Brian Barrett
Hello,

 

I'm trying to get my mapserver installation to work across all major
browsers. Currently the installation works well in internet explorer,
but in most other browsers, the map loads but my list of layers displays
only one checkbox (no layer names). There are also problems with some of
the map interaction features in non-IE browsers. 

 

I assume there is a javascript problem.

 

How can I identify the cause of this error?

 

I've validated the html of the map page (I've managed to fix all but one
error which is related to the IE ondragstart property)

 

Many thanks for any guidance

 

Brian

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


RE: [mapserver-users] php mapscript

2010-03-29 Thread Worth Lutz
I'm just a MapServer user.  I've copied this reply to the list so your
comments will be seen.

 

Worth

 

  _  

From: Cristiano Sumariva [mailto:sumar...@gmail.com] 
Sent: Monday, March 29, 2010 7:28 AM
To: Worth Lutz
Subject: Re: [mapserver-users] php mapscript

 

To me would be very good that mapserver documentation includes a since
version.subversion.release flag at documentation function names like php
does on their site.

And for those changes and breaks on code the user contribution on end of
function descriptions would be welcome too.

Example from php

pg_connect
(PHP 4, PHP 5)
resource pg_connect ( string $connection_string )

http://br2.php.net/manual/en/function.pg-connect.php

2010/3/29 Worth Lutz w...@mindspring.com

I don't think that the documentation has caught up with the changes in the
program.  People using older versions of MapServer have to use the older
method and the new method is used for 5.6+ version.  It was described
briefly in the migration document but took me some experimentation to get
results.

Worth

-Original Message-
From: Sven Schroeter [mailto:schroe...@netgis.de]
Sent: Monday, March 29, 2010 4:18 AM
To: Worth Lutz
Cc: mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] php mapscript

Hi,
thank you very much, shapeObj resultsGetShape is the solution.
resultsGetShape works fine.
But I don't understand why shapeObj getFeature is in the documentation?

Sven


- Original Message -
From: Worth Lutz
To: 'Sven Schroeter' ;
Sent: Friday, March 26, 2010 11:09 PM
Subject: RE: [mapserver-users] php mapscript


This problem is due to the new single pass query in 5.6.

I have marked your code with what I am using.

Try these mods marked with *:


@$datQuery = $query_layer-queryByRect($qRect);

 //number of objects
 $resnum = $query_layer-getNumResults();  echo number of objects:
.$resnum.br;

 //if query success
if ($datQuery == MS_SUCCESS) {
//  $query_layer-open();  // REMOVE OPEN AND CLOSE ***

 //first row
 $result = $query_layer-getResult(0);


 //$shpobj =
$query_layer-getShape($result-tileindex,$result-shapeindex);
 // resultsGetShape is now the way to get the shape object
***
 // note: change of order in arguments

 $shpobj = $query_layer-resultsGetShape($result-shapeindex,
$result-tileindex);


 //read attribute
 $attr = $shpobj-values;

 //write headline
 echo 'table cellspacing=0 cellpadding=2 border=1 tr';
 foreach($attr as $name=$wert) {
  echo 'td bgcolor=#CC'.$name.'/td';
 }
 echo '/tr';

 //write datasets
 for ($j=0; $j$query_layer-getNumResults(); $j++) {
  $result = $query_layer-getResult($j);


  //$shpobj =
$query_layer-getShape($result-tileindex,$result-shapeindex);
  // see note above
**
  $shpobj = $query_layer-resultsGetShape($result-shapeindex,
$result-tileindex);


  $ri = $result-tileindex;
  $si = $result-shapeindex;
  $attr = $shpobj-values;
  echo 'tr id=row'.$si.' ';
  foreach($attr as $name=$wert) {
   echo 'td'.$wert.'/td';
  }
  echo '/tr';
  $shpobj-free();
 }
//  $query_layer-close();  // REMOVE OPEN AND CLOSE ***
 echo '/table';

} // end success
...


-Original Message-
From: mapserver-users-boun...@lists.osgeo.org
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Sven Schroeter
Sent: Thursday, March 25, 2010 10:52 AM
To: mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] php mapscript

Alan,
thanks for the reply, I tried it with getFeature(), but there comes the same
error.
nextShape() works only after msWhichShapes and here I need a rectobj.
But I want to use the script for queryByShape and queryByAttributes too.
Why there comes no array in $attr = $shpobj-values; ?
Any idea?
Sven

- Original Message -
From: Alan Boudreault aboudrea...@mapgears.com
To: mapserver-users@lists.osgeo.org
Cc: Sven Schroeter schroe...@netgis.de
Sent: Thursday, March 25, 2010 2:32 PM
Subject: Re: [mapserver-users] php mapscript


 Sven,

 getShape() is deprecated. Use rather getFeature(). I suggest to also take
 a
 look at the nextShape() function:
 http://mapserver.org/mapscript/php/index.html#layerobj-class

 Alan

 On March 25, 2010 09:18:50 am Sven Schroeter wrote:
 Hi,
 I have an old php mapscript code that works fine with mapserver 5.02 or
  5.2, but not with 5.6.1.
 The code runs an attribute tabe from a postgis layer and different querys
 i.e. queryByRect:

 ...
 @$datQuery = $query_layer-queryByRect($qRect);

  //number of objects
  $resnum = $query_layer-getNumResults();
  echo number of objects: .$resnum.br;

  //if query success
 if ($datQuery == MS_SUCCESS) {
   $query_layer-open();

   //first row
   $result = $query_layer-getResult(0);
   $shpobj =
 $query_layer-getShape($result-tileindex,$result-shapeindex);
   //read attribute
   $attr = $shpobj-values;

   //write headline
   echo 

Re: [mapserver-users] How to do that kind of querying using CGI (with Openlayers)

2010-03-29 Thread Richard Greenwood
One approach is to use a very simple template to retrieve the min/max
extent from MapServer. Then parse the extent in javascript and use
that to set the OL extent. So basically you are making two calls to
MapServer, one to get the extent and another one to highlight the
road. The template for the extent would look something like
[MINX] [MINY] [MAXX] [MAXY]
Better check the documentation on that as I forget if it's MINX or
something slightly different.

Rich


On Mon, Mar 29, 2010 at 2:02 PM, Paul james paulj...@gmail.com wrote:
 Hello guys...

 The application has a Search Window, with all Roads listed...
 The user will choose one road, so my map should highlight that road and zoom
 in (if possible)...

 I already did that using C# Mapscript, but I dont know how to do that using
 CGI/OL...

 Any ideas?

 Thanks

 Paul

 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users





-- 
Richard Greenwood
richard.greenw...@gmail.com
www.greenwoodmap.com
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users