[mapserver-users] Problem with loading map file using C# map script

Murty Maganti MMaganti at oriongis.com
Wed Feb 18 17:03:35 EST 2009


Thanks a lot. It resolved my issue.

 

Murty

 

From: Tamas Szekeres [mailto:szekerest at gmail.com] 
Sent: Wednesday, February 18, 2009 4:43 PM
To: Murty Maganti
Cc: mapserver-users at lists.osgeo.org
Subject: Re: [mapserver-users] Problem with loading map file using C#
map script

 

Murty,


I've investigated the problem it seems having the same name for each
connection causes that the same connection is used from the connection
pool when opening the second layer by the OGR driver. But if you close
the first layer before opening the second it should work correctly then,
like:

            string mapfile1 = Path.Combine(Application.StartupPath,
@"..\..\mapfile1.map");
            mapObj map1 = new mapObj(mapfile1);
            layerObj lyr1 = map1.getLayer(0);
            lyr1.open();
            string field1 = lyr1.getItem(0);
            lyr1.close();

            string mapfile2 = Path.Combine(Application.StartupPath,
@"..\..\mapfile2.map");
            mapObj map2 = new mapObj(mapfile2);
            layerObj lyr2 = map2.getLayer(0);
            lyr2.open();
            string field2 = lyr2.getItem(0);
            lyr2.close();

Best regards,

Tamas




2009/2/18 Murty Maganti <MMaganti at oriongis.com>

Hi

 

I have posted the test application. But the email is waiting for
approval of moderator (as the attachment size is 75 KB and I think
allowed is only 40 KB). 

 

Thanks

Murty

 

From: Tamas Szekeres [mailto:szekerest at gmail.com] 
Sent: Tuesday, February 17, 2009 6:33 PM


To: Murty Maganti
Cc: mapserver-users at lists.osgeo.org
Subject: Re: [mapserver-users] Problem with loading map file using C#
map script

 

Hmmm. I haven't found such an issue before.


If you could post an example that would be helpful to reproduce this.

Best regards,

Tamas



2009/2/18 Murty Maganti <MMaganti at oriongis.com>

Hi 

 

I have a issue loading a map file through map script and need help.

 

I have two map info (tab) files with same name but in two different
folders. I have two map files each containing each layer. I am loading
these map files using C# map script (each map file is loaded in to a
separate mapObj on a separate thread). At run time, when I debug the
second mapObj, the layer has items (layerObj.getItem()) from the first
layer loaded by the first map file. I verified 'shapepath' on mapObj and
it is pointing to correct path. There is nothing wrong there. I am
surprised how is it caching the item info, just by the file name (file
name is same but they are completely from different folders).

 

When I load the map file one more time (again a different .Net thread,
it shows up correct fields).

 

Within my app (Asp.Net), I can consistently replicate this.

 

Thanks

Murty

 


_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20090218/f8cb0cc6/attachment-0001.html


More information about the mapserver-users mailing list