<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
<div>Hi</div><div><br></div><div>I tried your solution and it works in postgis layers, and i get my features highlited, the features are inserted in the Sqlite and i can get a csv or report. Still i cannot do a buffer with that features and i need to make this buffer!</div><div><br></div><div>The query service is already running fine, the problem was with the mapfile, i changed:</div><div><span style="font-size: 10pt;"><br></span></div><div><span style="font-size: 10pt;">DATA 'the_geom FROM "public"."pontos_sportgis" USING UNIQUE gid USING srid=4326'</span></div><div><br></div><div>to:</div><div><br></div><div>DATA 'the_geom from (select gid, tipo_infra, fotografia, tipo, nome, st_astext(the_geom) as wkt_geometry, the_geom from "public"."pontos_sportgis") as mytable using unique gid USING srid=4326'</div><div><br></div><div>Nevertheless i find it very strange the postgis layers not work with the default select service could it be something in the map file? or something in the table?</div><div><br></div><div>If someone else can give some help i will be very appreciated.</div><div><br></div><div>Thanks </div><div>Luis</div><br><div><div id="SkyDrivePlaceholder"></div><hr id="stopSpelling">From: Bob.Bistrais@maine.gov<br>To: luis.calisto@hotmail.com; geomoose-users@lists.osgeo.org<br>Subject: RE: [Geomoose-users] select and query in postgis layers<br>Date: Tue, 19 Feb 2013 19:33:21 +0000<br><br>



<style><!--
.ExternalClass p.ecxMsoNormal, .ExternalClass li.ecxMsoNormal, .ExternalClass div.ecxMsoNormal
{font-size:12.0pt;font-family:"Times New Roman","serif";}
.ExternalClass a:link, .ExternalClass span.ecxMsoHyperlink
{color:blue;text-decoration:underline;}
.ExternalClass a:visited, .ExternalClass span.ecxMsoHyperlinkFollowed
{color:purple;text-decoration:underline;}
.ExternalClass p
{font-size:12.0pt;font-family:"Times New Roman","serif";}
.ExternalClass span.ecxapple-tab-span
{;}
.ExternalClass span.ecxEmailStyle19
{font-family:"Calibri","sans-serif";color:#1F497D;}
.ExternalClass .ecxMsoChpDefault
{font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;}
.ExternalClass div.ecxWordSection1
{page:WordSection1;}

--></style>


<div class="ecxWordSection1">
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">I have found a partial fix to the problem.  I still cannot get my file GDB layer to highlight the selected shapes, but I can get a correct result for the Found
 Shapes line, and the results are also inserted to the SQLite file so you can output to csv or report.</span></p>
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span></p>
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Here’s what I did:  Make a backup copy of select.php.  Then, in select.php, look for the following line, at or about line 262:</span></p>
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">                $results = $results . $map->processquerytemplate(array(), false);</span></p>
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span></p>
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Below that line, add the following:</span></p>
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">                for($i=0; $i<=($layer->getNumResults() - 1); $i++){</span></p>
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">                                $result=$layer->getResult($i);</span></p>
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">                                $myShape=$layer->getShape($result);</span></p>
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">                                $foundShapes[] = $myShape;</span></p>
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">                }</span></p>
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span></p>
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">-save and try that.</span></p>
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span></p>
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">One thing I have not checked- if you use the same code on shapefiles, you may get duplicate results or Found Shapes may be twice what you expected, since the
 result shapes are being added twice.  I haven’t checked that far yet, but I think some code that will determine the file type can help eliminate such an error.</span></p>
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span></p>
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Hope this helps, but I’d still be interested in anyone else’s input.</span></p>
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span></p>
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span></p>
<p class="ecxMsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="ecxMsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> geomoose-users-bounces@lists.osgeo.org [mailto:geomoose-users-bounces@lists.osgeo.org]
<b>On Behalf Of </b>Luis Calisto<br>
<b>Sent:</b> Tuesday, February 19, 2013 1:08 PM<br>
<b>To:</b> geomoose-users@lists.osgeo.org<br>
<b>Subject:</b> [Geomoose-users] select and query in postgis layers</span></p>
</div>
</div>
<p class="ecxMsoNormal"> </p>
<div>
<p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">Hi</span></p>
<div>
<p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> </span></p>
</div>
<div>
<p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">i'm working with geomoose version 2.6.1</span></p>
</div>
<div>
<p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> </span></p>
</div>
<div>
<p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">I have some layers in shapefile but the most part is postgis.</span></p>
</div>
<div>
<p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">Everything is ok except that with the postgis layers the select and the query services do not work. The select returns well the attributes but says that "<b>Found Shapes: </b><span style="background:white">0"
 and does not highlight any feature. The query service return no value at all. The select and the query service is fine with the shapefile based layers and the identify service is fine with both layers.</span></span></p>
</div>
<div>
<p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> </span></p>
</div>
<div>
<p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";background:white">I followed the documentation in the demo but this documentation is made for shapefiles, maybe something is missing with my config. </span><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""></span></p>
</div>
<div>
<p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> </span></p>
</div>
<div>
<p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif";background:white">Anyone can help?</span><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""></span></p>
</div>
<div>
<p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> </span></p>
</div>
<div>
<p class="ecxMsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">Thanks</span></p></div><div>
</div>
</div>
</div></div>                                          </div></body>
</html>