commas in CONNECTION string cause MapServer to fail

Mark Adams Mark.Adams at DPRA.COM
Thu Apr 20 15:39:26 EDT 2006


Frank (and Stephane),

Miraculous! - removing the tablename from the <SrcDataSource> element,
and referencing the VRT layername in the DATA element, solved the
problem. Everything else I kept the same.

What I find a bit strange about that is that previously, even if I
removed the tablename from the <SrcDataSource> element, it would crap
out on the commas in the <SrcSQL> element. Now it no longer craps out on
the commas elsewhere in the connection string, and all is fine.

I will look into enhancing the documentation on the web site - can I
change these documents myself, or should I forward the changes to
someone else (like yourself)?

Thanks to both of you for your assistance.

------------------------------
Mark Adams
Senior Analyst & Project Manager
Cuesta Systems (DPRA Canada)
5230 South Service Road
Burlington, ON L7L 5K2
Phone: 905-333-4544 x14
Fax: 905-333-0455
Email: mark.adams at dpra.com


-----Original Message-----
From: Frank Warmerdam [mailto:fwarmerdam at gmail.com] On Behalf Of Frank
Warmerdam
Sent: April 20, 2006 3:12 PM
To: Mark Adams
Cc: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: Re: [UMN_MAPSERVER-USERS] commas in CONNECTION string cause
MapServer to fail

Mark Adams wrote:
> Like I said, if I put this in the OVF file instead of including it 
> inline, it works. Inline, it craps out at the first comma. I can test 
> this by removing the tablename from the SrcDataSource element for 
> example, and then it craps out at SrcSQL instead - first comma it
finds. 
> Here is the LAYER definition:
> 
>  
> 
> LAYER
> 
>  NAME 'References'
> 
>  CONNECTIONTYPE OGR
> 
>  #CONNECTION 
> "ODBC:MINFWHSE_P1/MINFWHSE_P1 at MINFWHSE_P1,MINFT_WH2_REFER_REFERENCE"
> 
>  #CONNECTION "REFERENCES_minf_read.ovf"
> 
>  CONNECTION "<OGRVRTDataSource>

Mark,

The OGR code in mapserver expects to split CONNECTION strings into a
datasource name, and a layer # (or name) and it does this based on a
comma
in the connection string.

It seems that you do nothing to select the layer to be used.  I guess
mapserver must implicitly choose the 1st.   The "new" approach to
specifying
the layer is to put the name in the DATA keyword.

I would really like to remove support from mapserver for the old
"datasource,layer" support in the connection string but this is likely
to
cause non-trivial amounts of breakage.

/me checks the code.

Wonderful news!  If you define the layer in a DATA keyword, then
MapServer
won't try and parse it out of your connection string and things should
work!

So try:

   CONNECTION '<OGR...'
   DATA 'Reference_Query'

If this fixes the problem, could you try and add some relative comments
for
updates to the appropriate documents on the web site?  At least the OGR
howto
and the OVF example document.

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 OSGF,
http://osgeo.org



More information about the mapserver-users mailing list