OGR Source and Parameter Query

Matthew Holger mholger at OPTERA.NET
Fri Sep 10 17:42:21 EDT 2004


On Fri, Sep 10, 2004 at 12:48:28PM -0400, Frank Warmerdam wrote:
> Tim,
>
> Are you using a virtual OGR dataset to access the MS-SQL database?  If so,
> you can replace the <SrcLayer> element with a <SrcSQL> element with a custom
> query selecting on some criteria.  If you want to make this dynamic (ie. the
> key passed in by the user somehow) things will get substantially harder.
> One approach would be to use mapscript, and alter your ovf definition on the
> fly.  Another would be have the ovf definition embedded in the .map file and
> parameter substitution to substitute in our extra criteria.  I have never
> tried doing the parameter substitution myself.

The approach I took was just to create a completely new layer in mapscript,
and then use mapscript to add points to that layer for every row of data the
SQL query gave me.

So far, it's working pretty well, but I'm not sure if it's the most efficient
route to getting dynamically selected data into a map, but it does certainly
provide a high level of flexibility.

Cheers!
-Matt.



More information about the mapserver-users mailing list