[mapserver-dev] Layer names in OGR connection strings (undocumented feature causing problems)
Brent Fraser
bfraser at geoanalytic.com
Mon Mar 4 14:25:07 PST 2013
Tamas,
No doc that I know of. I knew of the technique of adding
comma-separated table names to connection strings from years ago when I
was trying to improve the performance of an ODBC connection
(http://www.gdal.org/ogr/drv_odbc.html). Stating the table names
relieves the driver from enumerating all the tables (and views etc) in
the schema. Maybe I had reviewed the source code; I can't recall...
Best Regards,
Brent Fraser
On 3/4/2013 2:20 PM, Tamas Szekeres wrote:
> Brent,
>
> Could you point me to the documentation where this syntax is
> mentioned? Is this specific to OGR tile indexes?
>
> Best regards,
>
> Tamas
>
>
>
> 2013/3/3 Brent Fraser <bfraser at geoanalytic.com
> <mailto:bfraser at geoanalytic.com>>
>
> Tamas,
> if I understand correctly you are talking about connection
> strings like:
>
> CONNECTIONTYPE OGR
> TILEINEX "PG:dbname='PN2010_0911' host='thinkcentre1'
> port='5432' user='PN2010_0911' password='PN2010_0911',images"
>
> note the comma and table name at the end.
> See
> http://lists.osgeo.org/pipermail/mapserver-dev/2011-April/011194.html
>
>
> Best Regards,
> Brent Fraser
>
> On 3/3/2013 2:09 PM, Tamas Szekeres wrote:
>> 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
>>
>>
>>
>>
>> _______________________________________________
>> mapserver-dev mailing list
>> mapserver-dev at lists.osgeo.org <mailto:mapserver-dev at lists.osgeo.org>
>> http://lists.osgeo.org/mailman/listinfo/mapserver-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20130304/f8e0224f/attachment.html>
More information about the mapserver-dev
mailing list