OGR ODBC spatial query has invalid resultset

Fabio D'Ovidio dovidio at PLANETEK.IT
Tue Sep 26 08:03:35 PDT 2006


Thank u ! I 'll try with this !

I have another problem. My table is a VIEW and It seems that OGR SQL doesn't connect to 
VIEWS but only connects to Tables

Is it true ?

On 26 Sep 2006 at 9:42, Frank Warmerdam wrote:

> Fabio D'Ovidio wrote:
> > Frank, please, what is wrong with this ??
> ...
> 
>      END
> >             CONNECTIONTYPE OGR
> >   CONNECTION "puglia/pug_iffi.shp"
> >  DATA "SELECT * from pug_iffi c LEFT JOIN 
> > 'ODBC:sa/@CartanetIFFI'.Query_IdFrana b ON c.IDFRANA = (b.cod_pro + b.id 
> > + b.subid)"
> >   END
> > 
> > It doesn't work !
> 
> Fabio,
> 
> I believe the problem is that the join operation is being evaluated by
> OGR, and the OGR "pseudo-SQL" interpreter does not know how to evaluate
> operations like "(b.cod_pro + b.id > + b.subid)".  It only knows how to
> do very simple key to key joins.
> 
> So, in this case the limited nature of OGR SQL joins is failing you.
> 
> This might work if you could create a regular column on your ODBC table
> with the merged key.  I will warn that OGR joins tend to be slow since
> each joined record is fetched by a distinct SQL SELECT operation.  So you
> should only use it for small numbers of records.
> 
> Best regards,
> -- 
> ---------------------------------------+--------------------------------------
> I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
> light and sound - activate the windows | http://pobox.com/~warmerdam
> and watch the world go round - Rush    | President OSGeo, http://osgeo.org


********************************************************************************************


 Ing. Fabio D'Ovidio
 WebGIS Staff
 Planetek Italia Srl
 via Massaua, 12 - 70123 Bari - Italy
 web : http ://www.planetek.it
 e-mail : dovidio at planetek.it

********************************************************************************************



More information about the MapServer-users mailing list