[mapserver-users] c# mapscript: a strange behavior with ovf inline connection

Pietro Giannini pgiannini at bytewise.it
Sun Jan 25 09:32:47 EST 2009


Tamas, you are right.
Now I flush the virtual layer connection string in a .ovf file and set the
CONNECTION of the layer to the path of this file. All works fine.

Evidently the OGR driver FIRST counts the charachters of the CONNECTION
property and LATER attempts to parse it to understand it is not a file
path but a inline virtual layer description.

A little uncomfortable... still other garbage in tmp dir... :)

Many thanks
bye
.................................pg

On Ven, Gennaio 23, 2009 20:31, Tamas Szekeres wrote:
> Pietro,
>
> I doubt it it's a C# specific issue. Actually mapserver use
> MS_MAXPATHLEN=1024 as the upper limit of the length of the file pathes. In
> this case it seems something like SHAPEPATH is already definied in your
> mapfile which is concatenated with the connection string by the mapserver
> ogr driver. In this regard I don't see any reason why PHP mapscript
> behaves
> differently (assuming you define SHAPEPATH in both cases).
>
> I think however the OGR driver should also consider the connection is not
> always define a physical path actually so this might be a issue to be
> handled.
>
>
> Best regards,
>
> Tamas
>
>
>
>
>
> 2009/1/23 Pietro Giannini <pgiannini at bytewise.it>
>
>> Hi list.
>>
>> I found a strange error in c# mapscript on drawing a map image when a
>> layer has a virtual spatial data connection.
>>
>> The error is:
>> System.ApplicationException was unhandled by user code
>>  Message="msBuildPath(): Unable to access file.
>> (C:\\svil\\EMS\\map\\<OGRVRTDataSource>\n<OGRVRTLayer
>> name='object'>\n<SrcDataSource>ODBC:sa/Password123 at EMS_object
>> </SrcDataSource>\n<SrcLayer>object</SrcLayer>\n<FID>Id</FID>\n<SrcSQL>\nSELECT
>> Dim_Unit.Id, Dim_Unit.Description, Dim_Unit.Icon AS Icon, [...] FROM
>> Dim_Unit WHERE Dim_Unit.Id [...]
>> </SrcSQL>\n<GeometryType>wkbPoint</GeometryType>\n<GeometryField
>> encoding='PointFromColumns' x='LON'
>> y='LAT'/>\n</OGRVRTLayer>\n</OGRVRTDataSource>: path is too long"
>>  Source="mapscript_csharp"
>>
>> ([...] = omissis due to lenght of the query)
>>
>> the error occurs only:
>> - in mapscript_csharp, I tried with php_mapscript and it does not occur;
>> - if the ovf connection string is INLINE at layer level, when I use the
>> classic .ovf file it does not occur;
>> - if the ovf connection string is longer than 1022 characters (!)
>>
>> other infos, if useful:
>> - ODBC connection to a MS SQLserver 2005;
>> - development in ASP.NET (VS2005), the deploy environment is a Share
>> Point
>> portal, the application is embedded in a WebPart.
>>
>> Any idea?
>> many thanks
>> bye ..................................pg
>>
>>
>>
>> --
>> Pietro Giannini
>> Bytewise srl - Area GIS
>> 41°50'38.58"N 12°29'13.39"E
>>
>> _______________________________________________
>> mapserver-users mailing list
>> mapserver-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>>
>




More information about the mapserver-users mailing list