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

Robert Sanson SansonR at asurequality.com
Sun Aug 24 20:03:37 PDT 2008


Is it possible to send a value for the where condition to Mapserver via
a variable added to the end of a WMS call? Mapserver would then put this
variable value into the FILTER statement for the OGR connection.
 
Many thanks,
 
Robert Sanson
 
Robert Sanson, BVSc, MACVSc, PhD
Geospatial Services
AsureQuality Limited
PO Box 585, Palmerston North
NEW ZEALAND

Phone: +64 6 351-7990
Fax: +64 6 351-7919
Mobile: 021 448-472
E-mail: sansonr at asurequality.com 

>>> Frank Warmerdam <warmerdam at pobox.com> 29/05/2008 10:55 p.m. >>>
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 

_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org 
http://lists.osgeo.org/mailman/listinfo/mapserver-users 

------------------------------------------------------------------
The contents of this email are confidential to AsureQuality. If you have received this communication in error please notify the sender immediately and delete the message and any attachments. The opinions expressed in this email are not necessarily those of AsureQuality. This message has been scanned for known viruses before delivery. AsureQuality supports the Unsolicited Electronic Messages Act 2007. If you do not wish to receive similar communications in future, please notify the sender of this message.
------------------------------------------------------------------


This message has been scanned for malware by SurfControl plc. www.surfcontrol.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20080825/2125cda5/attachment.htm>


More information about the MapServer-users mailing list