Re: [mapserver-users] DrawQuery problem

2011-04-07 Thread Oscar Testa


  
  
Steve,

i have removed open and close clauses. After that, the drawquery
draw the map correctly!!
Thanks a lot

Oscar

El 05/04/11 17:33, Lime, Steve D (DNR) escribi:

  
  
  
  
Looks like youre running against 5.6.6. You
dont need to open/close layers after doing a query. The
underlying code leaves the layer open and preserves the
result set on the database server. It may be that by calling
close() especially youre losing the result set in PostGIS.
You dont need to open/close layers anyway just to use
getResult().

Try:
- Calling drawQuery before your post query
processing. If it works that tells you the problem is in
your post-processing code.
- Removing the layer open/close calls from your
post query processing.

Steve


  
From: Oscar Testa [mailto:ote...@gmail.com] 
Sent: Tuesday, April 05, 2011 2:24 PM
To: Lime, Steve D (DNR)
Subject: Re: [mapserver-users] DrawQuery problem
  


Steve,
  
  i send you this mail because the list reject the message, i
  don't know the reason.
  
  the query returns rows, here the code:
  
   if ($x0 == $x1 || $y0 == $y1){
   $my_point = ms_newPointObj();
   $my_point-SetXY($x0,$y0);
   $bQquery =
  @$map-queryByPoint($my_point,MS_MULTIPLE,0);
   }
   else{
   $my_rect = ms_newRectObj();
   $my_rect-setextent($x0,$y0,$x1,$y1);
   $bQuery = @$map-queryByRect($my_rect);
   }
  
   if ($bQuery == MS_SUCCESS){
   $sQueryLayers = "layers=";
   $sQueryId = "id=";
   for ($i=0;$isizeof($iLayers);$i++){
$oLayer = $map-getLayer($iLayers[$i]);
if ($oLayer-status == MS_ON)
 if ($oLayer-getNumResults()  0){
  $oLayer-open();
  $bResults = true;
 for ($j=0;$j$oLayer-getNumResults();$j++){
  $oResult = $oLayer-getResult($j);
  $sQueryId = $sQueryId .
  $oResult-shapeindex . ";";
 }
 $oLayer-close();
  $sQueryLayers = $sQueryLayers . $oLayer-name
  . "|"; 
 $sQueryId = substr($sQueryId,0,strlen($sQueryId) -
  1) . "|";
 }
   }
   $sQueryLayers =
  substr($sQueryLayers,0,strlen($sQueryLayers) - 1);
   $sQueryId = substr($sQueryId,0,strlen($sQueryId) - 1);
  
  The results is viewed in $sQueryId, a string with codes
  inside, printed via echo.
  
  When the draw method is called, or when drawQuery method is
  called without a query, the results is a valid map with no
  error messages in the debug file. When a query is performed,
  the debug file contents the next:
  
  [[Fri Apr 1 15:41:24 2011].623504 getSymbol(): Symbol
  definition error. Parsing error near (I):(line 181)
  [Fri Apr 1 15:41:24 2011].623825 getSymbol(): Symbol
  definition error. Parsing error near (II):(line 181)
  [Fri Apr 1 15:41:24 2011].624023 getSymbol(): Symbol
  definition error. Parsing error near (III):(line 181)
  [Fri Apr 1 15:41:24 2011].624231 getSymbol(): Symbol
  definition error. Parsing error near (IV):(line 181)
  [Fri Apr 1 15:41:24 2011].624407 getSymbol(): Symbol
  definition error. Parsing error near (V):(line 181)
  [Fri Apr 1 15:41:24 2011].624593 getSymbol(): Symbol
  definition error. Parsing error near (VI):(line 181)
  [Fri Apr 1 15:41:24 2011].624753 getSymbol(): Symbol
  definition error. Parsing error near (VII):(line 181)
  [Fri Apr 1 15:41:24 2011].625063 getSymbol(): Symbol
  definition error. Parsing error near (I):(line 181)
  [Fri Apr 1 15:41:24 2011].625235 getSymbol(): Symbol
  definition error. Parsing error near (II):(line 181)
  [Fri Apr 1 15:41:24 2011].625398 getSymbol(): Symbol
  definition error. Parsing error near (III):(line 181)
  [Fri Apr 1 15:41:24 2011].625559 getSymbol(): Symbol
  definition error. Parsing error near (IV):(line 181)
  [Fri Apr 1 15:41:24 2011].625755 getSymbol(): Symbol
  definition error. Parsing error near (V):(line 181)
  [Fri Apr 1 15:41:24 2011].625916 getSymbol(): Symbol
  definition error. Parsing error near (VI):(line 181)
  [Fri Apr 1 15:41:24 2011].626109 getSymbol(): Symbol
  definition error. Parsing error near (VII):(line 181)
  [Fri Apr 1 15:41:24 2011].62

Re: [mapserver-users] DrawQuery problem

2011-04-06 Thread Oscar Testa


  
  


Steve,

i have removed open and close clauses. After that, the drawquery
draw the map correctly!!
Thanks a lot

Oscar

El 05/04/11 17:33, Lime, Steve D (DNR) escribi:

  
  
  
  
Looks like youre running against 5.6.6. You
dont need to open/close layers after doing a query. The
underlying code leaves the layer open and preserves the
result set on the database server. It may be that by calling
close() especially youre losing the result set in PostGIS.
You dont need to open/close layers anyway just to use
getResult().

Try:
- Calling drawQuery before your post query
processing. If it works that tells you the problem is in
your post-processing code.
- Removing the layer open/close calls from your
post query processing.

Steve

 

  

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


Re: [mapserver-users] DrawQuery problem

2011-04-05 Thread Oscar Testa


  
  


Steve,

the query returns rows, here the code:

 if ($x0 == $x1 || $y0 == $y1){
 $my_point = ms_newPointObj();
 $my_point-SetXY($x0,$y0);
 $bQquery = @$map-queryByPoint($my_point,MS_MULTIPLE,0);
 }
 else{
 $my_rect = ms_newRectObj();
 $my_rect-setextent($x0,$y0,$x1,$y1);
 $bQuery = @$map-queryByRect($my_rect);
 }

 if ($bQuery == MS_SUCCESS){
 $sQueryLayers = "layers=";
 $sQueryId = "id=";
 for ($i=0;$isizeof($iLayers);$i++){
  $oLayer = $map-getLayer($iLayers[$i]);
  if ($oLayer-status == MS_ON)
   if ($oLayer-getNumResults()  0){
$oLayer-open();
$bResults = true;
   for ($j=0;$j$oLayer-getNumResults();$j++){
$oResult = $oLayer-getResult($j);
$sQueryId = $sQueryId . $oResult-shapeindex .
";";
   }
   $oLayer-close();
$sQueryLayers = $sQueryLayers . $oLayer-name .
"|"; 
   $sQueryId = substr($sQueryId,0,strlen($sQueryId) - 1) .
"|";
   }
 }
 $sQueryLayers = substr($sQueryLayers,0,strlen($sQueryLayers) -
1);
 $sQueryId = substr($sQueryId,0,strlen($sQueryId) - 1);

The results is viewed in $sQueryId, a string with codes inside,
printed via echo.

When the draw method is called, or when drawQuery method is called
without a query, the results is a valid map with no error messages
in the debug file. When a query is performed, the debug file
contents the next:

[[Fri Apr 1 15:41:24 2011].623504 getSymbol(): Symbol definition
error. Parsing error near (I):(line 181)
[Fri Apr 1 15:41:24 2011].623825 getSymbol(): Symbol definition
error. Parsing error near (II):(line 181)
[Fri Apr 1 15:41:24 2011].624023 getSymbol(): Symbol definition
error. Parsing error near (III):(line 181)
[Fri Apr 1 15:41:24 2011].624231 getSymbol(): Symbol definition
error. Parsing error near (IV):(line 181)
[Fri Apr 1 15:41:24 2011].624407 getSymbol(): Symbol definition
error. Parsing error near (V):(line 181)
[Fri Apr 1 15:41:24 2011].624593 getSymbol(): Symbol definition
error. Parsing error near (VI):(line 181)
[Fri Apr 1 15:41:24 2011].624753 getSymbol(): Symbol definition
error. Parsing error near (VII):(line 181)
[Fri Apr 1 15:41:24 2011].625063 getSymbol(): Symbol definition
error. Parsing error near (I):(line 181)
[Fri Apr 1 15:41:24 2011].625235 getSymbol(): Symbol definition
error. Parsing error near (II):(line 181)
[Fri Apr 1 15:41:24 2011].625398 getSymbol(): Symbol definition
error. Parsing error near (III):(line 181)
[Fri Apr 1 15:41:24 2011].625559 getSymbol(): Symbol definition
error. Parsing error near (IV):(line 181)
[Fri Apr 1 15:41:24 2011].625755 getSymbol(): Symbol definition
error. Parsing error near (V):(line 181)
[Fri Apr 1 15:41:24 2011].625916 getSymbol(): Symbol definition
error. Parsing error near (VI):(line 181)
[Fri Apr 1 15:41:24 2011].626109 getSymbol(): Symbol definition
error. Parsing error near (VII):(line 181)
[Fri Apr 1 15:41:24 2011].626523 msPostGISLayerOpen called:
the_geom from (select distinct ua.oid as oid, ua.the_geom as
the_geom, ua.id_region from unidades_academicas as ua, instituciones
as i WHERE i.univ_id = ua.univ_id AND i.id_tipo_institucion = 1 )
AS foo using SRID=4326 using UNIQUE oid
[Fri Apr 1 15:41:24 2011].626554 msPostGISLayerOpen: No connection
in pool, creating a fresh one.
[Fri Apr 1 15:41:24 2011].644796
msConnPoolRegister(UNIVERSIDADES,user=postgres
dbname=cpres_normalizada_ona password=postgres host=localhost
port=5433,0x7f0dd44ec890)
[Fri Apr 1 15:41:24 2011].644912 msPostGISLayerFreeItemInfo called.
[Fri Apr 1 15:41:24 2011].644928 msPostGISLayerFreeItemInfo called.
[Fri Apr 1 15:41:24 2011].644938 msPostGISLayerGetItems called.
[Fri Apr 1 15:41:24 2011].644948 msPostGISParseData called.
[Fri Apr 1 15:41:24 2011].645035 msPostGISParseData:
unique_column=oid, srid=4326, geom_column_name=the_geom,
table_name=(select distinct ua.oid as oid, ua.the_geom as the_geom,
ua.id_region from unidades_academicas as ua, instituciones as i
WHERE i.univ_id = ua.univ_id AND i.id_tipo_institucion = 1 ) AS foo
[Fri Apr 1 15:41:24 2011].645054 msPostGISLayerGetItems executing
SQL: select * from (select distinct ua.oid as oid, ua.the_geom as
the_geom, ua.id_region from unidades_academicas as ua, instituciones
as i WHERE i.univ_id = ua.univ_id AND i.id_tipo_institucion = 1 )
AS foo where false limit 0
[Fri Apr 1 15:41:24 2011].695722 msPostGISLayerInitItemInfo called.
[Fri Apr 1 15:41:24 2011].695894 msPostGISLayerInitItemInfo called.
[Fri Apr 1 15:41:24 2011].695982 msPostGISLayerWhichShapes called.
[Fri Apr 1 15:41:24 2011].696012 msPostGISParseData called.
[Fri Apr 1 15:41:24 2011].696131 msPostGISParseData:
unique_column=oid, srid=4326, 

Re: [mapserver-users] DrawQuery problem

2011-04-01 Thread Oscar Testa


  
  
Steve,

the query returns rows, here the code:

 if ($x0 == $x1 || $y0 == $y1){
 $my_point = ms_newPointObj();
 $my_point-SetXY($x0,$y0);
 $bQquery = @$map-queryByPoint($my_point,MS_MULTIPLE,0);
 }
 else{
 $my_rect = ms_newRectObj();
 $my_rect-setextent($x0,$y0,$x1,$y1);
 $bQuery = @$map-queryByRect($my_rect);
 }

 if ($bQuery == MS_SUCCESS){
 $sQueryLayers = "layers=";
 $sQueryId = "id=";
 for ($i=0;$isizeof($iLayers);$i++){
  $oLayer = $map-getLayer($iLayers[$i]);
  if ($oLayer-status == MS_ON)
   if ($oLayer-getNumResults()  0){
$oLayer-open();
$bResults = true;
   for ($j=0;$j$oLayer-getNumResults();$j++){
$oResult = $oLayer-getResult($j);
$sQueryId = $sQueryId . $oResult-shapeindex .
";";
   }
   $oLayer-close();
$sQueryLayers = $sQueryLayers . $oLayer-name .
"|"; 
   $sQueryId = substr($sQueryId,0,strlen($sQueryId) - 1) .
"|";
   }
 }
 $sQueryLayers = substr($sQueryLayers,0,strlen($sQueryLayers) -
1);
 $sQueryId = substr($sQueryId,0,strlen($sQueryId) - 1);

The results is viewed in $sQueryId, a string with codes inside,
printed via echo.

When the draw method is called, or when drawQuery method is called
without a query, the results is a valid map with no error messages
in the debug file. When a query is performed, the debug file
contents the next:

[[Fri Apr 1 15:41:24 2011].623504 getSymbol(): Symbol definition
error. Parsing error near (I):(line 181)
[Fri Apr 1 15:41:24 2011].623825 getSymbol(): Symbol definition
error. Parsing error near (II):(line 181)
[Fri Apr 1 15:41:24 2011].624023 getSymbol(): Symbol definition
error. Parsing error near (III):(line 181)
[Fri Apr 1 15:41:24 2011].624231 getSymbol(): Symbol definition
error. Parsing error near (IV):(line 181)
[Fri Apr 1 15:41:24 2011].624407 getSymbol(): Symbol definition
error. Parsing error near (V):(line 181)
[Fri Apr 1 15:41:24 2011].624593 getSymbol(): Symbol definition
error. Parsing error near (VI):(line 181)
[Fri Apr 1 15:41:24 2011].624753 getSymbol(): Symbol definition
error. Parsing error near (VII):(line 181)
[Fri Apr 1 15:41:24 2011].625063 getSymbol(): Symbol definition
error. Parsing error near (I):(line 181)
[Fri Apr 1 15:41:24 2011].625235 getSymbol(): Symbol definition
error. Parsing error near (II):(line 181)
[Fri Apr 1 15:41:24 2011].625398 getSymbol(): Symbol definition
error. Parsing error near (III):(line 181)
[Fri Apr 1 15:41:24 2011].625559 getSymbol(): Symbol definition
error. Parsing error near (IV):(line 181)
[Fri Apr 1 15:41:24 2011].625755 getSymbol(): Symbol definition
error. Parsing error near (V):(line 181)
[Fri Apr 1 15:41:24 2011].625916 getSymbol(): Symbol definition
error. Parsing error near (VI):(line 181)
[Fri Apr 1 15:41:24 2011].626109 getSymbol(): Symbol definition
error. Parsing error near (VII):(line 181)
[Fri Apr 1 15:41:24 2011].626523 msPostGISLayerOpen called:
the_geom from (select distinct ua.oid as oid, ua.the_geom as
the_geom, ua.id_region from unidades_academicas as ua, instituciones
as i WHERE i.univ_id = ua.univ_id AND i.id_tipo_institucion = 1 )
AS foo using SRID=4326 using UNIQUE oid
[Fri Apr 1 15:41:24 2011].626554 msPostGISLayerOpen: No connection
in pool, creating a fresh one.
[Fri Apr 1 15:41:24 2011].644796
msConnPoolRegister(UNIVERSIDADES,user=postgres
dbname=cpres_normalizada_ona password=postgres host=localhost
port=5433,0x7f0dd44ec890)
[Fri Apr 1 15:41:24 2011].644912 msPostGISLayerFreeItemInfo called.
[Fri Apr 1 15:41:24 2011].644928 msPostGISLayerFreeItemInfo called.
[Fri Apr 1 15:41:24 2011].644938 msPostGISLayerGetItems called.
[Fri Apr 1 15:41:24 2011].644948 msPostGISParseData called.
[Fri Apr 1 15:41:24 2011].645035 msPostGISParseData:
unique_column=oid, srid=4326, geom_column_name=the_geom,
table_name=(select distinct ua.oid as oid, ua.the_geom as the_geom,
ua.id_region from unidades_academicas as ua, instituciones as i
WHERE i.univ_id = ua.univ_id AND i.id_tipo_institucion = 1 ) AS foo
[Fri Apr 1 15:41:24 2011].645054 msPostGISLayerGetItems executing
SQL: select * from (select distinct ua.oid as oid, ua.the_geom as
the_geom, ua.id_region from unidades_academicas as ua, instituciones
as i WHERE i.univ_id = ua.univ_id AND i.id_tipo_institucion = 1 )
AS foo where false limit 0
[Fri Apr 1 15:41:24 2011].695722 msPostGISLayerInitItemInfo called.
[Fri Apr 1 15:41:24 2011].695894 msPostGISLayerInitItemInfo called.
[Fri Apr 1 15:41:24 2011].695982 msPostGISLayerWhichShapes called.
[Fri Apr 1 15:41:24 2011].696012 msPostGISParseData called.
[Fri Apr 1 15:41:24 2011].696131 msPostGISParseData:
unique_column=oid, srid=4326, 

[mapserver-users] DrawQuery problem

2011-03-31 Thread Oscar Testa


  
  


Hello,

i'am using mapserver in ubuntu Maverick (10.10). Php version is
5-3-3-1 ubuntu 9.3. 
Mapscript description:


  

  MapServer Version 
  MapServer version 5.6.6 OUTPUT=GIF OUTPUT=PNG
OUTPUT=JPEG OUTPUT=WBMP OUTPUT=SWF OUTPUT=SVG SUPPORTS=PROJ
SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV
SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT
SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER
SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUPPORTS=THREADS
SUPPORTS=GEOS SUPPORTS=RGBA_PNG INPUT=EPPL7 INPUT=POSTGIS
INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE 


  PHP MapScript Version 
  ($Revision: 10204 $ $Date: 2010-06-02 06:57:48
-0700 (Wed, 02 Jun 2010) $) 

  


I have a project in php, with connection to postgis. When
map-draw is called the image is generated correctly.
When i do a querybyrect query to the map, the drawquery doesn't draw
the image. 
If necesary i have debug information, and error log.

Please help, i can't find the problem!

Regards
Oscar

  

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


RE: [mapserver-users] DrawQuery problem

2011-03-31 Thread Lime, Steve D (DNR)
I guess we need more information. A script snippet, confirmation the query is 
returning results, error messages, etc...

Steve

From: mapserver-users-boun...@lists.osgeo.org 
[mailto:mapserver-users-boun...@lists.osgeo.org] On Behalf Of Oscar Testa
Sent: Thursday, March 31, 2011 12:34 PM
To: mapserver-users@lists.osgeo.org
Subject: [mapserver-users] DrawQuery problem


Hello,

i'am using mapserver in ubuntu Maverick (10.10). Php version is 5-3-3-1 ubuntu 
9.3.
Mapscript description:
MapServer Version

MapServer version 5.6.6 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP 
OUTPUT=SWF OUTPUT=SVG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE 
SUPPORTS=ICONV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT 
SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER 
SUPPORTS=FASTCGI SUPPORTS=THREADS SUPPORTS=GEOS SUPPORTS=RGBA_PNG INPUT=EPPL7 
INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE

PHP MapScript Version

($Revision: 10204 $ $Date: 2010-06-02 06:57:48 -0700 (Wed, 02 Jun 2010) $)


I have a project in php, with connection to postgis. When map-draw is called 
the image is generated correctly.
When i do a querybyrect query to the map, the drawquery doesn't draw the image.
If necesary i have debug information, and error log.

Please help, i can't find the problem!

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


[mapserver-users] DrawQuery problem

2011-03-30 Thread Oscar Testa


  
  
Hello,

i'am using mapserver in ubuntu Maverick (10.10). Php version is
5-3-3-1 ubuntu 9.3. 
Mapscript description:


  

  MapServer Version 
  MapServer version 5.6.6 OUTPUT=GIF OUTPUT=PNG
OUTPUT=JPEG OUTPUT=WBMP OUTPUT=SWF OUTPUT=SVG SUPPORTS=PROJ
SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV
SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT
SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER
SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUPPORTS=THREADS
SUPPORTS=GEOS SUPPORTS=RGBA_PNG INPUT=EPPL7 INPUT=POSTGIS
INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE 


  PHP MapScript Version 
  ($Revision: 10204 $ $Date: 2010-06-02 06:57:48
-0700 (Wed, 02 Jun 2010) $) 

  


I have a project in php, with connection to postgis. When
map-draw is called the image is generated correctly.
When i do a querybyrect query to the map, the drawquery doesn't draw
the image. 
If necesary i have debug information, and error log.

Please help, i can't find the problem!

Regards
Oscar
  

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