<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head>
<title></title>
<meta http-equiv="content-type" content="text/html;charset=utf-8"/>
<meta http-equiv="Content-Style-Type" content="text/css"/>
</head>
<body>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
Frank, please, what is wrong with this ??</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
<br />
</span>
</font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
LAYER</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
  NAME "pug2_iffi"</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
  TYPE POINT</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
  STATUS ON</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
  TEMPLATE  "query.html"</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
  TOLERANCEUNITS  PIXELS</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
  TOLERANCE 1000</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
  CLASS</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
    NAME "Pug2_iffi"</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
    # TEMPLATE</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
    STYLE</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
    SYMBOL  "circlefd"</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
    SIZE 7</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
    COLOR  127 255 0  </span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
    OUTLINECOLOR 0 0 0</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
   END</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
  END</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
  PROJECTION</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
                        #Lat/Lon</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
                        "init=EPSG:32633"</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
            END</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
            CONNECTIONTYPE OGR</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
  CONNECTION "puglia/pug_iffi.shp"</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
 DATA "SELECT * from pug_iffi c LEFT JOIN 'ODBC:sa/@CartanetIFFI'.Query_IdFrana b
ON c.IDFRANA = (b.cod_pro + b.id + b.subid)"</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
  END</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
<br />
</span>
</font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
It doesn't work !</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
<br />
</span>
</font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
On 26 Sep 2006 at 9:07, Frank Warmerdam wrote:</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
<br />
</span>
</font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
> Delfos, Jacob wrote:</span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
> > Hi List,</span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
> > </span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
> > Sorry about all the questions I have been sending. I'm hoping someone </span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
> > can shed light on this one.</span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
> > </span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
> > After a QueryByPoint or QueryByRect operation in PHP, the number of </span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
> > results is correct, but the resultCacheMemberObj always points to the </span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
> > first "getNumResults()" objects. If there are 4 results, it holds </span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
> > references to objects 1-4. For one result, it always points to the 1st </span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
> > object.</span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
> > </span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
> > This is -not- the case for QueryByAttributes, though. The </span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
> > resultCacheMemberObj is correct for this type of query.</span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
> > </span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
> > This only occurs for OGR ODBC layers. I have tried MDB and CSV, with the </span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
> > same problem…</span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
> > </span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
> > If anyone knows why, please let me know. If someone thinks this is a </span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
> > bug, I'll file it.</span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
> </span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
> Jacob,</span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
> </span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
> This occurs with OGR ODBC datasources that lack an FID column in the original</span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
> table.  Without an FID, OGR just assigns FIDs starting with zero to the</span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
> result set.</span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
> </span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
> The problem really bites when different constraints (spatial or attribute)</span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
> are in place at the point where the query is done, and when the results are</span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
> fetched - which is the case when you do spatial queries as the spatial query</span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
> apparently is cleared by mapserver before it starts fetching individual</span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
> results.</span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
> </span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
> The overall point is that two-stage queries (as done by mapserver) are</span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
> very unreliable against OGR datasources without a persistent FID, such as</span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
> some ODBC datasources.</span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
> </span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
> BTW, you can use the mapserver config variable ODBC_OGR_FID to force the</span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
> ODBC driver to pick a particular column as the FID.  Unfortunately this</span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
> is a global option so it only works smoothly if you have the same name</span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
> for the id of all tables you are accessing in a given mapserver map.  You</span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
> would add something like the following in the MAP section of your map file</span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
> to default to using the ID column of your odbc tables as the feature id.</span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
> </span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
>    CONFIG "ODBC_OGR_FID" "ID"</span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
> </span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
> Best regards,</span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
> -- </span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
> ---------------------------------------+--------------------------------------</span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
> I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam@pobox.com</span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
> light and sound - activate the windows | http://pobox.com/~warmerdam</span></font>
</div>
<div align="left">
<font face="Arial" color="#7f0000" size="2">
<span style=" font-size:10pt">
> and watch the world go round - Rush    | President OSGeo, http://osgeo.org</span></font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
<br />
</span>
</font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
<br />
</span>
</font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
********************************************************************************************</span></font>
</div>
<div align="left"><img src="cid:107101093.1159283986.11965" width="89" height="36" border="0" alt="graphic"/>
</div>
<div align="left">
<font face="Comic Sans MS" size="2">
<span style=" font-size:10pt">
<b><br />
</b>
</span>
</font>
</div>
<div align="left">
<font face="Comic Sans MS" size="2">
<span style=" font-size:10pt">
<b> Ing. Fabio D'Ovidio</b></span></font>
</div>
<div align="left">
<font face="Comic Sans MS" size="2">
<span style=" font-size:10pt">
 WebGIS Staff</span></font>
</div>
<div align="left">
<font face="Comic Sans MS" size="2">
<span style=" font-size:10pt">
 Planetek Italia Srl</span></font>
</div>
<div align="left">
<font face="Comic Sans MS" size="2">
<span style=" font-size:10pt">
 via Massaua, 12 - 70123 Bari - Italy</span></font>
</div>
<div align="left">
<font face="Comic Sans MS" size="2">
<span style=" font-size:10pt">
 web : </span></font>
<font face="Comic Sans MS" color="#0000ff" size="2">
<span style=" font-size:10pt">
http ://www.planetek.it</span></font>
</div>
<div align="left">
<font face="Comic Sans MS" size="2">
<span style=" font-size:10pt">
 e-mail : </span></font>
<font face="Comic Sans MS" color="#0000ff" size="2">
<span style=" font-size:10pt">
dovidio@planetek.it</span></font>
</div>
<div align="left">
<font face="Comic Sans MS" color="#0000ff" size="2">
<span style=" font-size:10pt">
<br />
</span>
</font>
</div>
<div align="left">
<font face="Arial" size="2">
<span style=" font-size:10pt">
********************************************************************************************</span></font>
</div>
</body>
</html>