[gdal-dev] OGR dynamic query
Frédéric Therrien
fredth at hotmail.com
Mon Sep 22 11:07:11 EDT 2008
Hey, thx for the answer, but maybe I wasn't clear enought. I'm using ogr with a map file for a mapserver (an later on a GIS). My question is, is it possible to pass a parameter from the gis/wms call to the ogr query, passing by openlayer-ms4w then the map file.
Frank, you said I can use SetAttributeFilter, but how does it work ?
Thx for your help
Frédéric Therrien
> Date: Mon, 22 Sep 2008 10:46:35 -0400
> From: warmerdam at pobox.com
> To: fredth at hotmail.com
> CC: gdal-dev at lists.osgeo.org
> Subject: Re: [gdal-dev] OGR dynamic query
>
> Frédéric Therrien wrote:
> > Hey guys, I'm using ogr to perform select statement in a database for a
> > mapserver/gis. I would like to know something. Is it possible to build
> > dynamic query ? Here is an example:
> >
> > Select * from Table where field1 > X
> >
> > Where X can vary depending on the query. I would like to use this
> > feature for time display (display information since a date and this date
> > can be feed by the user in the user interface).
> >
> > Thx for you help.
>
> Frédéric,
>
> I don't know anything about your application, but of course it is
> generally possible to do dynamic queries. This would normally be
> accomplished by assembling the query string dynamically in your
> application before passing it to ExecuteSQL() or SetAttributeFilter().
>
> Note that "OGR SQL" requires that the right side of any comparison be
> a constant, so you can't compare two fields in a non-database datasource
> (if that is what you were thinking). You can do anything supported by
> SQL in a real RDBMS.
>
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20080922/8702d38c/attachment-0001.html
More information about the gdal-dev
mailing list