Re: [mapserver-users] WMS Server problem
Tony Baylis schrieb: Hi guys, Apologies for adding another question related to a similar previous post but I too am having problems getting MapServer to serve a WMS layer. At this stage I can't get a GetCapabilities (it wants to download the mapserv file) or Mode=map to work via the browser. I have been able to get the layer to render correctly using openLayers in WMS mode however. The mapserv file is actually the response. If you save it and open it in an text editor you can view the content. The MapServer FAQ has also an entry to this question: http://mapserver.org/faq.html#when-i-do-a-getcapabilities-why-does-my-browser-want-to-download-mapserv-exe-mapserv Lars ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] WMS GetFeatureInfo on a WFS layer
Hi Arnd, Thanks for your answer We will try an other way. The 2nd given url is really a WFS server, I successfully send a GetFeature request with filter parameter. :) Thanks again, Y. 2010/3/24 Arnd Wippermann arnd.wipperm...@web.de Hi, as I know, you cann't request a WMS or WFS through a connection in your mapfile (results to Search return no result). Only with own data added as shapefile and so on, you can get a result for GetfeatureInfo requests. Wether mapinfo via ogr cann't request, i have no clue. But I would think, it should be possible. I have checked, that the url is a valid wfs server, also it seems, that it points to a wms server. Arnd -- *Von:* mapserver-users-boun...@lists.osgeo.org [mailto: mapserver-users-boun...@lists.osgeo.org] *Im Auftrag von *Yves Jacolin *Gesendet:* Mittwoch, 24. März 2010 10:24 *An:* mapserver-users *Betreff:* [mapserver-users] WMS GetFeatureInfo on a WFS layer Hi, I added a WFS layer in my mapfile and I am using MapServer as a WMS server. I would like to send a GetFeatureInfo request on this WFS layer but I always get a Search return no result as answer. Is it possible to request such layer? I get same problem with an OGR connection (mapInfo file). Does the problem could occur only with a polyline feature if we click always too far of the feature? Or the problem occur from the WFS service? The WFS service I want to request in my WMS service is http://carto.ecologie.gouv.fr/MEDD/wms.php?service_idx=17Wmap=sacarte.map Thanks in advance for your help, Y. -- Yves Jacolin Responsable Formation et Support Camptocamp France SAS Savoie Technolac, BP 352 73377 Le Bourget du Lac Cedex Tel : + 33 (0)4 79 26 57 97 http://www.camptocamp.com yves.jaco...@camptocamp.com -- Yves Jacolin Responsable Formation et Support Camptocamp France SAS Savoie Technolac, BP 352 73377 Le Bourget du Lac Cedex Tel : + 33 (0)4 79 26 57 97 http://www.camptocamp.com yves.jaco...@camptocamp.com ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] php mapscript
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
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] WMS GetFeatureInfo on a WFS layer
Hi Yves, Couple of things: First of all, you you should be able to do a GetFeatureInfo request on this WFS layer. There is a bug with latest versions of MapServer I believe trink and possibly 5.6 (I only test trunk). The bug is described at http://trac.osgeo.org/mapserver/ticket/3403, and It should now be fixed in svn. If you are builiding aginst trunk, please give it a try. Other notes on - I usually have a ows_latlonboundingbox set on the wfs layer - I usually add RADIUS=2 when doing a GetFeatureInfo request. hope it helps. best regards, Yves Jacolin wrote: Hi Arnd, Thanks for your answer We will try an other way. The 2nd given url is really a WFS server, I successfully send a GetFeature request with filter parameter. :) Thanks again, Y. 2010/3/24 Arnd Wippermann arnd.wipperm...@web.de mailto:arnd.wipperm...@web.de Hi, as I know, you cann't request a WMS or WFS through a connection in your mapfile (results to Search return no result). Only with own data added as shapefile and so on, you can get a result for GetfeatureInfo requests. Wether mapinfo via ogr cann't request, i have no clue. But I would think, it should be possible. I have checked, that the url is a valid wfs server, also it seems, that it points to a wms server. Arnd *Von:* mapserver-users-boun...@lists.osgeo.org mailto:mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org mailto:mapserver-users-boun...@lists.osgeo.org] *Im Auftrag von *Yves Jacolin *Gesendet:* Mittwoch, 24. März 2010 10:24 *An:* mapserver-users *Betreff:* [mapserver-users] WMS GetFeatureInfo on a WFS layer Hi, I added a WFS layer in my mapfile and I am using MapServer as a WMS server. I would like to send a GetFeatureInfo request on this WFS layer but I always get a Search return no result as answer. Is it possible to request such layer? I get same problem with an OGR connection (mapInfo file). Does the problem could occur only with a polyline feature if we click always too far of the feature? Or the problem occur from the WFS service? The WFS service I want to request in my WMS service is http://carto.ecologie.gouv.fr/MEDD/wms.php?service_idx=17Wmap=sacarte.map http://carto.ecologie.gouv.fr/MEDD/wms.php?service_idx=17Wmap=sacarte.map Thanks in advance for your help, Y. -- Yves Jacolin Responsable Formation et Support Camptocamp France SAS Savoie Technolac, BP 352 73377 Le Bourget du Lac Cedex Tel : + 33 (0)4 79 26 57 97 http://www.camptocamp.com yves.jaco...@camptocamp.com mailto:yves.jaco...@camptocamp.com -- Yves Jacolin Responsable Formation et Support Camptocamp France SAS Savoie Technolac, BP 352 73377 Le Bourget du Lac Cedex Tel : + 33 (0)4 79 26 57 97 http://www.camptocamp.com yves.jaco...@camptocamp.com mailto:yves.jaco...@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
Re: [mapserver-users] PHP MapScript: shape-classindex is always 0
Hi Peter, If you are sure that the shape use the different classes you specified in the mapfile (you probably see it in your map image), so I guess it could be a bug. Please fill a ticket with a test case. Assign it to aboudreault. regards, Alan On March 24, 2010 06:38:49 am Peter Hopfgartner wrote: Hello As I interpreted this, classindex should point to the right class of the instantiated shape. Unfortunatly, classindex is always 0. As a test I have a LAYER with 2 classes, CLASS NAME 'class1' EXPRESSION (([class] eq 1)) STYLE SYMBOL circle SIZE 7.0 OUTLINECOLOR 0 0 0 COLOR 0 128 0 END END CLASS NAME 'class2' EXPRESSION (([class] eq 2)) STYLE SYMBOL circle SIZE 7.0 OUTLINECOLOR 0 0 0 COLOR 0 0 128 END END In the PostGIS database are 4 point, 2 with class=1 and 2 with class=2, the generated map image shows the expected colors. The following script: ?php $mapfile = 'test.map'; $map = ms_newmapobj($mapfile); $layer = $map-getLayerByName('test'); $status = $layer-open(); $status = $layer-whichShapes($map-extent); while ($shape = $layer-nextShape()) { echo index: {$shape-index}\tclassindex: {$shape-classindex}\n; } $layer-close(); ? the following output: index: 0classindex: 0 index: 1classindex: 0 index: 2classindex: 0 index: 3classindex: 0 which is not what I expected. Am I missing something obvious or is this a MapServer bug? Regards, Peter -- 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: shape-classindex is always 0
I think I came across the same thing, or something related, when I was trying to generate KML using mapserver templates. I know I ended up recreating the class expression in my output instead of using the [shpclass] variable. Let me know if a bug is filed and I'll work up an example to submit. (mapserver 5.2) Josh Alan Boudreault wrote: Hi Peter, If you are sure that the shape use the different classes you specified in the mapfile (you probably see it in your map image), so I guess it could be a bug. Please fill a ticket with a test case. Assign it to aboudreault. regards, Alan On March 24, 2010 06:38:49 am Peter Hopfgartner wrote: Hello As I interpreted this, classindex should point to the right class of the instantiated shape. Unfortunatly, classindex is always 0. As a test I have a LAYER with 2 classes, CLASS NAME 'class1' EXPRESSION (([class] eq 1)) STYLE SYMBOL circle SIZE 7.0 OUTLINECOLOR 0 0 0 COLOR 0 128 0 END END CLASS NAME 'class2' EXPRESSION (([class] eq 2)) STYLE SYMBOL circle SIZE 7.0 OUTLINECOLOR 0 0 0 COLOR 0 0 128 END END In the PostGIS database are 4 point, 2 with class=1 and 2 with class=2, the generated map image shows the expected colors. The following script: ?php $mapfile = 'test.map'; $map = ms_newmapobj($mapfile); $layer = $map-getLayerByName('test'); $status = $layer-open(); $status = $layer-whichShapes($map-extent); while ($shape = $layer-nextShape()) { echo index: {$shape-index}\tclassindex: {$shape-classindex}\n; } $layer-close(); ? the following output: index: 0classindex: 0 index: 1classindex: 0 index: 2classindex: 0 index: 3classindex: 0 which is not what I expected. Am I missing something obvious or is this a MapServer bug? Regards, Peter No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.437 / Virus Database: 271.1.1/2769 - Release Date: 03/25/10 07:33:00 ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] WMS GetFeatureInfo on a WFS layer
Hello, Indeed, I built the last stable release of MapServer, good point ;) We will test with another release or waiting for the next one. Thanks for your tips ! Regards, Y. 2010/3/25 Yewondwossen Assefa yass...@dmsolutions.ca Hi Yves, Couple of things: First of all, you you should be able to do a GetFeatureInfo request on this WFS layer. There is a bug with latest versions of MapServer I believe trink and possibly 5.6 (I only test trunk). The bug is described at http://trac.osgeo.org/mapserver/ticket/3403, and It should now be fixed in svn. If you are builiding aginst trunk, please give it a try. Other notes on - I usually have a ows_latlonboundingbox set on the wfs layer - I usually add RADIUS=2 when doing a GetFeatureInfo request. hope it helps. best regards, Yves Jacolin wrote: Hi Arnd, Thanks for your answer We will try an other way. The 2nd given url is really a WFS server, I successfully send a GetFeature request with filter parameter. :) Thanks again, Y. 2010/3/24 Arnd Wippermann arnd.wipperm...@web.de mailto: arnd.wipperm...@web.de Hi, as I know, you cann't request a WMS or WFS through a connection in your mapfile (results to Search return no result). Only with own data added as shapefile and so on, you can get a result for GetfeatureInfo requests. Wether mapinfo via ogr cann't request, i have no clue. But I would think, it should be possible. I have checked, that the url is a valid wfs server, also it seems, that it points to a wms server. Arnd *Von:* mapserver-users-boun...@lists.osgeo.org mailto:mapserver-users-boun...@lists.osgeo.org [mailto:mapserver-users-boun...@lists.osgeo.org mailto:mapserver-users-boun...@lists.osgeo.org] *Im Auftrag von *Yves Jacolin *Gesendet:* Mittwoch, 24. März 2010 10:24 *An:* mapserver-users *Betreff:* [mapserver-users] WMS GetFeatureInfo on a WFS layer Hi, I added a WFS layer in my mapfile and I am using MapServer as a WMS server. I would like to send a GetFeatureInfo request on this WFS layer but I always get a Search return no result as answer. Is it possible to request such layer? I get same problem with an OGR connection (mapInfo file). Does the problem could occur only with a polyline feature if we click always too far of the feature? Or the problem occur from the WFS service? The WFS service I want to request in my WMS service is http://carto.ecologie.gouv.fr/MEDD/wms.php?service_idx=17Wmap=sacarte.map http://carto.ecologie.gouv.fr/MEDD/wms.php?service_idx=17Wmap=sacarte.map Thanks in advance for your help, Y. -- Yves Jacolin Responsable Formation et Support Camptocamp France SAS Savoie Technolac, BP 352 73377 Le Bourget du Lac Cedex Tel : + 33 (0)4 79 26 57 97 http://www.camptocamp.com yves.jaco...@camptocamp.com mailto:yves.jaco...@camptocamp.com -- Yves Jacolin Responsable Formation et Support Camptocamp France SAS Savoie Technolac, BP 352 73377 Le Bourget du Lac Cedex Tel : + 33 (0)4 79 26 57 97 http://www.camptocamp.com yves.jaco...@camptocamp.com mailto:yves.jaco...@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.cahttp://www.dmsolutions.ca/ Phone: (613) 565-5056 (ext 14) Fax: (613) 565-0925 -- Yves Jacolin Responsable Formation et Support Camptocamp France SAS Savoie Technolac, BP 352 73377 Le Bourget du Lac Cedex Tel : + 33 (0)4 79 26 57 97 http://www.camptocamp.com yves.jaco...@camptocamp.com ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] PHP MapScript: shape-classindex is always 0
Hi Alan Thynk you for your support! I've files http://trac.osgeo.org/mapserver/ticket/3406 and attached all files necessary to reproduce the problem. Due to the current slowness of the OsGeo the bug is filed twice, I've marked 3404 as a duplicate, sorry for the annoyance. Regards, Peter Alan Boudreault wrote: Hi Peter, If you are sure that the shape use the different classes you specified in the mapfile (you probably see it in your map image), so I guess it could be a bug. Please fill a ticket with a test case. Assign it to aboudreault. regards, Alan On March 24, 2010 06:38:49 am Peter Hopfgartner wrote: Hello As I interpreted this, classindex should point to the right class of the instantiated shape. Unfortunatly, classindex is always 0. As a test I have a LAYER with 2 classes, CLASS NAME 'class1' EXPRESSION (([class] eq 1)) STYLE SYMBOL circle SIZE 7.0 OUTLINECOLOR 0 0 0 COLOR 0 128 0 END END CLASS NAME 'class2' EXPRESSION (([class] eq 2)) STYLE SYMBOL circle SIZE 7.0 OUTLINECOLOR 0 0 0 COLOR 0 0 128 END END In the PostGIS database are 4 point, 2 with class=1 and 2 with class=2, the generated map image shows the expected colors. The following script: ?php $mapfile = 'test.map'; $map = ms_newmapobj($mapfile); $layer = $map-getLayerByName('test'); $status = $layer-open(); $status = $layer-whichShapes($map-extent); while ($shape = $layer-nextShape()) { echo index: {$shape-index}\tclassindex: {$shape-classindex}\n; } $layer-close(); ? the following output: index: 0classindex: 0 index: 1classindex: 0 index: 2classindex: 0 index: 3classindex: 0 which is not what I expected. Am I missing something obvious or is this a MapServer bug? Regards, Peter -- Dott. Peter Hopfgartner R3 GIS Srl - GmbH Via Johann Kravogl-Str. 2 I-39012 Meran/Merano (BZ) Email: peter.hopfgart...@r3-gis.com Tel. : +39 0473 494949 Fax : +39 0473 069902 www : http://www.r3-gis.com XING : http://www.xing.com/go/invita/8917535 ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] PHP MapScript: shape-classindex is always 0
Hi Josh, this is funny! I've hit this bug while working on a KML export, too. I've extracted a minimal test and it is attached to http://trac.osgeo.org/mapserver/ticket/3406. Regards, Peter Josh Hevenor wrote: I think I came across the same thing, or something related, when I was trying to generate KML using mapserver templates. I know I ended up recreating the class expression in my output instead of using the [shpclass] variable. Let me know if a bug is filed and I'll work up an example to submit. (mapserver 5.2) Josh Alan Boudreault wrote: Hi Peter, If you are sure that the shape use the different classes you specified in the mapfile (you probably see it in your map image), so I guess it could be a bug. Please fill a ticket with a test case. Assign it to aboudreault. regards, Alan On March 24, 2010 06:38:49 am Peter Hopfgartner wrote: Hello As I interpreted this, classindex should point to the right class of the instantiated shape. Unfortunatly, classindex is always 0. As a test I have a LAYER with 2 classes, CLASS NAME 'class1' EXPRESSION (([class] eq 1)) STYLE SYMBOL circle SIZE 7.0 OUTLINECOLOR 0 0 0 COLOR 0 128 0 END END CLASS NAME 'class2' EXPRESSION (([class] eq 2)) STYLE SYMBOL circle SIZE 7.0 OUTLINECOLOR 0 0 0 COLOR 0 0 128 END END In the PostGIS database are 4 point, 2 with class=1 and 2 with class=2, the generated map image shows the expected colors. The following script: ?php $mapfile = 'test.map'; $map = ms_newmapobj($mapfile); $layer = $map-getLayerByName('test'); $status = $layer-open(); $status = $layer-whichShapes($map-extent); while ($shape = $layer-nextShape()) { echo index: {$shape-index}\tclassindex: {$shape-classindex}\n; } $layer-close(); ? the following output: index: 0classindex: 0 index: 1classindex: 0 index: 2classindex: 0 index: 3classindex: 0 which is not what I expected. Am I missing something obvious or is this a MapServer bug? Regards, Peter No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.437 / Virus Database: 271.1.1/2769 - Release Date: 03/25/10 07:33:00 ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users -- Dott. Peter Hopfgartner R3 GIS Srl - GmbH Via Johann Kravogl-Str. 2 I-39012 Meran/Merano (BZ) Email: peter.hopfgart...@r3-gis.com Tel. : +39 0473 494949 Fax : +39 0473 069902 www : http://www.r3-gis.com XING : http://www.xing.com/go/invita/8917535 ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
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
Sven, I don't know really what's happen in your case. but getShape/getFeature seem to return NULL or FALSE. It's not an object, so there is no -values array and -free method available neither. Alan On March 25, 2010 10:52:12 am Sven Schroeter wrote: 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 ___ 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
[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
[mapserver-users] Labeling problem
Hi, I have a problem labeling in true type. This is an extract from my WORKING mapfile, using TYPE BITMAP. If I substitute TYPE BITMAP with TYPE truetype, It still works, but no label is shown.. Any idea? thanks, Kiks LAYER NAME CG_GEO_TESTI TYPE ANNOTATION STATUS OFF CONNECTIONTYPE PLUGIN PLUGIN C:\programmi\ms4w\Apache\specialplugins\msplugin_mssql2008.dll CONNECTION Driver={SQL Server Native Client 10.0};Server=localhost\SQLEXPRESS;Database=GIS;Trusted_Connection=yes; DATA G_POSIZIONE FROM CG_GEO_TESTI WITH(INDEX(SPATIAL_CG_GEO_TESTI)) USING UNIQUE ID_TESTO USING SRID=3003 LABELITEM 'TESTO' METADATA wms_title Testi catastali gml_include_items all END DUMP TRUE PROJECTION init=epsg:3003 END OPACITY 100 MAXSCALEDENOM 1 MINSCALEDENOM 2000 CLASS STYLE COLOR 0 0 0 OUTLINECOLOR 255 255 255 WIDTH 3 END LABEL COLOR 0 0 0 OUTLINECOLOR 255 255 255 TYPE BITMAP OUTLINEWIDTH 5 FONT georgia # TYPE truetype # SIZE 12 # ANGLE [ANGOLO] POSITION AUTO PARTIALS FALSE END END END -- View this message in context: http://n2.nabble.com/Labeling-problem-tp4798590p4798590.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
[mapserver-users] Loadquery in MAPSERVER 5.6.1
Hi, After upgrade the MS4W 2.3.1 ( Mapserver 5.2.1 ) to MS4W 3.0 ( MAPSERVER 5.6.1 ) my aplication stop to run when try use the function LOADQUERY. Not have message error, but the map not render image with selection. I'm note that file (bin) generated by SAVEQUERY ( MS4W 2.3.1 ) is diferent to the file(txt) generated in MS4W 3.0. I searched for modifications in this functions, but i'm not found. The same aplication generated this two files with function savequery run in MS4W 2.3.1 ( Mapserver 5.2.1 ) test.mapqy $X ÎüêJÀçm¡ ×Y=À 4 Ý-HÀK !9™ô9À and run in MS4W 3.0 ( MAPSERVER 5.6.1 ) test.mapqy MapServer Query - Generated by msSaveQuery() 0 5 6 -1 -1 -1 0 0 -1 -1 -1 -1 23 -1 0 NULL NULL -1 0 any suggenstions ? -- Alexandre Trindade Programador PHP ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Status of ticket 2181 (Fix handling of NODATA values (for DTED files))
Hi all, I was wondering what the status was of ticket 2181 (http://trac.osgeo.org/mapserver/ticket/2181), specifically the patch that is supposed to fix the handling of NODATA values when using average or bilinear resampling. I'm using the mapserver 5.6.1 and am running into that resampling issue. Is this something that is planned to be merged at some point? Thanks, Jason ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] Extreme data-driven Symbology with CGI mapserver
All, I'm looking for advice (or at least a reality check). The short story: Can CGI mapserver generate a legend on the fly for a varying number of classes (class names from a database)? The Long story: --- I'm storing feature geometry in a database and I'd like to store symbology too. In theory, this would allow a users/admins to add layers and classes in an adhoc manner, and I'd like mapserver (in std CGI mode, I'd like to avoid MapScript if possible) to automatically render the features AND produce a meaningful standard graphic legend. So my database tables would look like: Tables for storing things: -- Geom Table (lots of rows, one per feature): pkGeomIDThe primary key WKT The WKT/WKB geometry of a feature fkClassID Foreign key to Class table Class Table (a few rows, for unique symbology): pkClassid ClassName A nice name to put in the legend fkLayerID Foreign key to Layer table Color The color of the line (eg 255 0 0) Layer Table (only a couple of rows, just for organizing the classes): pkLayerID LayerName A nice name to put in the legend And a view, joining the above tables, so Mapserver can render the features: -- Render View: pkGeomID WKT LayerName ClassName Color While this will likely work for rendering the features, I'm doubtful that mapserver will be able to keep track of the class names for a legend. While I can set the color from a database attribute: CLASS NAME 'SetByCGI?' STYLE COLOR [Color] END # Style END # Class it is not possible to set the CLASS NAME that way. It is possible (I think) to set it with a CGI variable (something like map.layer[0].Class[0]=NAME+quot;Trailsquot;) but that would not allow for the dynamic number of classes. Or would it? If I put 10 class defs in my map file, then pass as many names as needed (up to 10) in the URL perhaps I could get a meaningful legend. Or maybe WFS is the answer... Or I'll likely need to switch to MapScript. If there's any interest in doing this via CGI, perhaps we could collaborate on an enhancement. Thanks! Brent Fraser ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
Re: [mapserver-users] Status of ticket 2181 (Fix handling of NODATA values (for DTED files))
Jason Beverage wrote: Hi all, I was wondering what the status was of ticket 2181 (http://trac.osgeo.org/mapserver/ticket/2181), specifically the patch that is supposed to fix the handling of NODATA values when using average or bilinear resampling. I'm using the mapserver 5.6.1 and am running into that resampling issue. Is this something that is planned to be merged at some point? Jason, I have some funded time to work on MapServer raster bugs. I'll try and take a crack at it in the next day or so. Best regards, -- ---+-- I set the clouds in motion - turn up | Frank Warmerdam, warmer...@pobox.com light and sound - activate the windows | http://pobox.com/~warmerdam and watch the world go round - Rush| Geospatial Programmer for Rent ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
[mapserver-users] List all symbols on PHP ms_map_object
I want read all symbols available in a mapfile for listing. Documentation says that I can request symbol references by calling ms_map_obj-getSymbolById( id ). What is not well defined on documentation is if those id are numbered from zero to n-1 symbol. so I can loop over the list. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users