[mapserver-dev] Layer names in OGR connection strings (undocumented feature causing problems)

Tamas Szekeres szekerest at gmail.com
Sun Mar 3 13:09:50 PST 2013


Hi,

According to a commit (made 11 years ago) in
rev1370<http://trac.osgeo.org/mapserver/changeset/1370>
the OGR connections strings are being split by the comma separators, see
the following fragment in msOGRFileOpen:

     papszTokens = CSLTokenizeStringComplex( conn_decrypted, ",", TRUE,
FALSE );

    if( CSLCount(papszTokens) > 0 )
      pszDSName = CPLStrdup( papszTokens[0] );
    if( CSLCount(papszTokens) > 1 )
      pszLayerDef = CPLStrdup( papszTokens[1] );

This behaviour causes issues if the syntax of the connection string may
normally expect commas, like with the issue:
http://trac.osgeo.org/gdal/ticket/4885


Does it make sense to split the connection strings this way?

According to the OGR driver
documentation<http://mapserver.org/en/input/vector/ogr.html>the layer
definitions should go to the DATA section and not to the
CONNECTION section.

I'd be in favour of removing this fragment from the code but I'm not sure
about all consequences.


Best regards,

Tamas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20130303/cfbda3a7/attachment.html>


More information about the mapserver-dev mailing list