Again c# Unable to load DLL (mapscript)
Tamas Szekeres
szekerest at GMAIL.COM
Fri Jul 21 06:36:45 PDT 2006
Hi,
> But...
> this is a very simple sample code I did:
>
> //mapObj
> mapObj map = new mapObj(@"C:\ms4w\apps\sample\sample1.map");
> Console.WriteLine("xmin: " + map.extent.minx.ToString() + ", ymin: " +
> map.extent.miny.ToString() + ", xmax: " + map.extent.maxx.ToString() + ",
> ymax: " + map.extent.maxy.ToString());
> //shapefileObj
> shapefileObj shapefile = new shapefileObj(@"C:\temp\province",5);
> Console.WriteLine ("Num shapes = " + shapefile.numshapes);
> Console.WriteLine("Num Layers:" + map.numlayers);
> for (int i=0; i<map.numlayers; i++)
> {
> //layerObj
> layerObj layer = map.getLayer(i);
> Console.WriteLine("Layer [" + i + "] name: " + layer.name);
> }
> map.setImageType("jpeg");
> map.setSize(400,400);
> //imageObj
> imageObj image = map.draw();
> image.save(@"c:\temp\out4.jpg", map);
> Console.WriteLine("Image URL = " + image.imageurl + "; Image path = " +
> image.imagepath);
>
> and this is the output:
>
> xmin: 0, ymin: 0, xmax: 0, ymax: 0
> Num shapes = 0
> Num Layers:1
> Layer [0] name: province
> Image URL = ; Image path =
>
> why the initial extent is 0 for each coordinate? (in the map file is not
> so...)
Could you post the mapfile you have used?
> Why numShapes is 0? (it should be 103...)
You have created shapefileObj with mode = 5. This setting will create
a new empty shapefile by default. Use -1 as the mode parameter if you
want to open an existing file.
> why the generated blank map is not inserted in the imageurl and imagepath
> properties of the mapObj?
>
Have you set WEB.IMAGEPATH and WEB.IMAGEURL in you map file?
> Is there anywhere a C# API to MapServer?
>
What do you mean? For a description of the SWIG mapscript API visit:
http://mapserver.gis.umn.edu/docs/reference/mapscript
For the C# specific issues see:
http://mapserver.gis.umn.edu/docs/howto/mapscriptcscompile
> Whate are your future plans for using C# library in ASP .NET projects?
> (somewhere in this forum I was reading that the library is not usable from
> ASP .NET)
>
My plan is to have the C# API fully supported for the ASP.NET
application models.
To achieve this we should reconsider how mapserver supports the
execution of the multiple threads. For more details see:
http://mapserver.gis.umn.edu/docs/faq/thread_safety
http://mapserver.gis.umn.edu/development/rfc/ms-rfc-15
These issues also apply to the other languages having multiple threads
executed simultaneously.
Best Regards,
Tamas
More information about the MapServer-users
mailing list