Variable substutition on CONNECTIONTYPE OGR CONNECTION OGRVRTDatasource (odbc)

Huub Fleuren hfl at HOME.NL
Sun May 14 14:55:56 EDT 2006


Thanks for the answer Paul, but i have the feeling that this is not 
applicable here
first of all: you're the first one ever to mention DATAPATTREN in the 
last half year of USERLIST messages and here is the complete documentation:

DATAPATTERN [regular expression]
    This defines a regular expression to be applied to requests to
    change DATA parameters via URL requests (i.e.
    map_layername_data=...). If a pattern doesn't exist then web users
    can't monkey with support files via URLs. This allows you to isolate
    one application from another if you desire, with the default
    operation being very conservative. See also TEMPLATEPATTERN
    <http://mapserver.gis.umn.edu/docs/reference/mapfile/mapObj#templatepattern>.

Well. My substitution is not in DATA, it's in CONNECTION: DATA referes 
to the CONNECTION <OGRVRTLayer  name/>



My LAYER definition looks like this: (following: 
http://www.remotesensing.org/gdal/ogr/ogr_sql.html)
 
    CONNECTIONTYPE OGR
    CONNECTION
                "<OGRVRTDataSource>
                    <OGRVRTLayer name='kpxy'>
                        <SrcDataSource>ODBC:admin/admin at anwb</SrcDataSource>
                        <SrcSQL>SELECT * FROM kpxy WHERE (x &gt; %xmin%) 
and (x &lt; %xmax%) and (y &gt; %ymin%) and (y &lt; %ymax%) and NOT 
(soort LIKE 'D')</SrcSQL>
                        <GeometryType>wkbPoint</GeometryType>
                        <LayerSRS>WGS84</LayerSRS>
                        <GeometryField encoding='PointFromColumns' x='x' 
y='y'/>
                    </OGRVRTLayer>
                </OGRVRTDataSource>"

    DATA "kpxy" # the name of the OGRVrtLayer

So there is no variable substitution in DATA.


I put in DATAPATTERN anyway, (regexp ey?) a string in quotes: (the 
parser didn't fall over them)  like these

DATAPATTERN "xmin|xmax|ymin|ymax"
DATAPATTERN "/xmin|xmax|ymin|ymax/"

It's not required is it?

I think a need another suggestion, but thanks anyway.

Regards, Huub


Paul Ramsey schreef:
> Huub,
>
> Yes, things changed in later versions (they got more secure!). Check 
> out the DATAPATTERN clause in the latest mapfile reference manual.
>
> Paul
>
> On 14-May-06, at 9:34 AM, Huub Fleuren wrote:
>
>> Hi List,
>>
>> Something changed, but what is it.
>>
>> I'm using somthing like the following, so a ODBC datasource for a 
>> OGRVRTLayer with variable substitution for the CONNECTION statement.
>> This works for me since i first used it in mapserv version 4.2.
>>
>> I compiled gdal 1.3.2 as i normally do; with Xerces, 2.7 this time.
>> ogrinfo works on a similar ovf file without variable substutution.
>>
>> If i get something in the log file (this is not always the case) on 
>> this layer it is:
>>    msDrawMap(): Image handling error. Failed to draw layer named 
>> &#39;kpxy&#39;.
>>    msOGRFileNextShape(): OGR error. SetAttributeFilter() not 
>> supported on ExecuteSQL() results.
>>
>> Does this mean that variable substitution is no longer supported 
>> here? I just want to make sure if it still is.
>>
>>    CONNECTION
>>                "<OGRVRTDataSource>
>>                    <OGRVRTLayer name='wwall'>
>>                        
>> <SrcDataSource>ODBC:admin/admin at db</SrcDataSource>
>>                        <SrcSQL>SELECT * FROM wwall WHERE (x &gt; 
>> %xmin%) and (x &lt; %xmax%) and (y &gt; %ymin%) and (y &lt; %ymax%) 
>> </SrcSQL>
>>                        <GeometryType>wkbPoint</GeometryType>
>>                        <GeometryField encoding='PointFromColumns' 
>> x='x' y='y'/>
>>                    </OGRVRTLayer>
>>                </OGRVRTDataSource>"
>>
>> What is the reason why this construction does not return the selected 
>> points anymore?
>>
>>
>> Regards, Huub
>
>



More information about the mapserver-users mailing list