Brent,

I did something similar a while ago. I connected to an aspatial SQL Server instance using an OGR VRT definition pointing to an ODBC datasource:


    TYPE POINT
    CONNECTIONTYPE OGR
    CONNECTION "<OGRVRTDataSource>
<OGRVRTLayer name='mypoints'>
<SrcDataSource>ODBC:myuser/mypass@MyODBC,view_of_points</SrcDataSource>
<SrcSQL>
            SELECT * FROM  view_of_points
            WHERE  StatusID=%StatusID%
</SrcSQL>
<FID>PointID</FID>
<GeometryType>wkbPoint</GeometryType>
<GeometryField encoding='PointFromColumns' y='MyLatitude'  x='MyLongitude'/>
<LayerSRS>NAD83</LayerSRS>
</OGRVRTLayer>
</OGRVRTDataSource>"

    PROCESSING "CLOSE_CONNECTION=DEFER"

    DATA "view_of_points"

    PROJECTION
    'proj=longlat'
    'ellps=GRS80'
    'datum=NAD83'
    'no_defs'
    END

Note that StatusId was passed as a CGI variable.

Best Regards,
Brent Fraser


On 2/15/2011 4:36 PM, [email protected] wrote:
Hi,

I'm looking to set up a mapfile with an inline ovf data source as described in part 2 of section 5 at http://mapserver.org/input/vector/VirtualSpatialData.html

I'm also looking to embed an SQL in the ovf with a where clause, using runtime variable substitution as described at http://mapserver.org/cgi/runsub.html?highlight=variable

The latter says that such runtime substitution is supported in the CONNECTION & DATA fields within the LAYER object.

I'm unclear as to how a where clause can be inserted in the ovf definition, and am hoping that this will be in the CONNECTION or DATA fields, and is amenable to runtime variable substitution.

Basically with the URL including: &job_id=23
have an ovf where clause specified like: ... where job=%job_id%

 thus from this

have an ovf ODBC connection pass a where clause like: and job_id=23 ..."

This is connecting to an aspatial Oracle database returning up to 100 point features from a table with X Y columns..

Can anyone provide some hints on:

1. Is this possible?
2. How best to implement it?


Thanks,

   Brent Wood



_______________________________________________
mapserver-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapserver-users
_______________________________________________
mapserver-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to