[Mapserver-users] Virtual Spatial Data and SQL query

Frank Warmerdam warmerdam at pobox.com
Fri Jul 23 10:41:47 PDT 2004


ludovic gnemmi wrote:
> Hi all,
> I'm trying to set up a dynamic virtual spatial data
> connection to map X,Y coordinates (from a Mysql odbc
> connection) with OGR and phpmapscript.
> It works with a simple sql query like:
> <SrcSQL>SELECT * FROM table WHERE ...</SrcSQL>
> but doesn't work with a more complicated query with
> several tables and arithmetics operators (produce an
> apache error).
> I saw on the MapserverWiki:virtual spatial data
> tutorial that the latest version of the OGR ODBC
> driver passes the SQL directly to the ODBC driver. So
> i don't undestand why my query doesn't work...ODBC
> datasource is working properly, i've tested with
> success this sort of query with a direct ODBC client
> (Winsql-ODBC). Has anybody got an idea?
> I'm working on windows with the last release of
> mapserver-mapscript.
> Thanks a lot.

Ludovic,

Have you tried your ovf file with ogrinfo.exe?  It might be easier to get
respectible debug information this way.  Indeed the VRT layer does pass
on SrcSQL directives to the underlying driver, and the OGR ODBC driver should
just pass it off to the ODBC driver for the database in question.

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    | Geospatial Programmer for Rent




More information about the MapServer-users mailing list