[mapserver-users] SQL SELECT statement in a OGR connection (DGN)

Frank Warmerdam warmerdam at pobox.com
Thu May 29 06:55:36 EDT 2008


Gabriela Messner wrote:
> Hi all,
> 
> I´m do not how to use de SQL SELECT statement to select several values 
> in a OGR connection to a DGN file with a layer named 'level'. For this 
> layer, i´d like to select the values '1,3,5'. The object LAYER is posted 
> below.
> 
> Thanks in advanced.
> 
> LAYER
> NAME sheet5000
> STATUS ON
> TYPE line
> CONNECTIONTYPE OGR
> CONNECTION "D:\sheet5000.DGN"
> #how do i use the SQL SELECT statement?
> DATA "level=1,5,7"

Gabriela,

I would suggest trying:

CONNECTIONTYPE OGR
CONNECTION "D:\sheet5000.DGN"
DATA "elements"
FILTER "WHERE level in (1,5,7)"

With CONNECTIONTYPE OGR you can prefix your FILTER with the keyword
WHERE and the rest will be passed through to OGR as an SQL style
attribute filter.

In DGN files there is only one layer, named elements, so we provide that
in the DATA statement.

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



More information about the mapserver-users mailing list