OGR Virtual problem with Where clause
Charlton Purvis
cplist at EARTHLINK.NET
Thu Mar 30 09:37:51 PST 2006
> I was trying to avoid using an OVF file as I'm using CGI and the next step
> was to look at dynamically changing the where clause from the URL
I've had a lot of luck embedding the OVF directly in the .map. I believe I
had to modify mapserv.c to do the % CGI variable substation to change
parameters in the OVF string, but it works great. I use it as part of a cgi
wrapper whose job is to help figure out what file matches things like my
time parameter. I'm not quite sure if this is what you had in mind, though.
Here's a simplified version of what I'm doing to pull data from a CSV whose
location is defined by %MY_PATH_VARIABLE_HERE%. Notice the EXPRESSION, too.
OGR r-o-c-k-s when it comes to ease of use w/ CSV's.
LAYER
NAME trk_line_blue_01
GROUP trk_line
PROJECTION
"init=epsg:4269"
END
CONNECTIONTYPE OGR
CONNECTION "<OGRVRTDataSource>
<OGRVRTLayer name='%MY_PATH_VARIABLE_HERE%'>
<SrcDataSource>%MY_PATH_VARIABLE_HERE%.csv</SrcDataSource>
<GeometryType>wkbLineString</GeometryType>
<GeometryField encoding='WKT' field='geom'/>
</OGRVRTLayer>
</OGRVRTDataSource>"
...
EXPRESSION ('[t]' eq '' and '[trk]' eq '01')
END
END
Charlton
More information about the MapServer-users
mailing list