R: R: [mapserver-dev] Re: Problem with projectionObj

GMail itacasoft at gmail.com
Tue Oct 4 12:33:37 EDT 2011


Yes, I think this is a permission issue, as most of IIS related problems ...
I also made another try:

I ported the previous code to a simple, simple console application. Well,
while the ASP.NET version fails both with IIS and with the VS2010 web
debugger, the console program works smoothly, producing all 10 image maps
and even filling the MS_ERRORFILE file with lots of stuff. Tried also with a
remote Windows 2008 Server, even there the web version does not work.
Here is the code:


///BEGIN

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OSGeo.MapServer;
using System.IO;

namespace GenerateMap
{
    class Program
    {
        const string MERCATORE_PROJ4 = "+proj=merc +a=6378137 +b=6378137
+lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null
+wktext  +no_defs";
        const string WGS84_PROJ4 = "+proj=longlat +ellps=WGS84 +datum=WGS84
+no_defs";


        static void DrawAMap(int index)
        {
            bool exists;
            string filename =
@"C:\usr\lavoro\progetti\SilverlightMapServer\GisData\Demo\Terni\terni.map";

            mapObj map = null;

            try
            {
                map = new mapObj(filename);
            }
            catch (Exception ex)
            {
                string msg = ex.Message;
                Console.WriteLine(msg);
            }


            int w = 800;
            map.width = w;


            int h = 600;
            map.height = h;


            rectObj bbox = new rectObj(12.6198865008904, 42.5498576637217,
12.6710248924462, 42.5784118606357, 0);


            map.setProjection(MERCATORE_PROJ4);

            projectionObj projMercatore = new
projectionObj(MERCATORE_PROJ4);
            projectionObj projWGS84 = new projectionObj(WGS84_PROJ4);

            try
            {
                ///HERE first time OK, second time hangs
                bbox.project(projWGS84, projMercatore);
            }
            catch (Exception ex)
            {
                string msg = ex.Message;
                Console.WriteLine(msg);
            }

            //map.extent = bbox;
            map.setExtent(bbox.minx, bbox.miny, bbox.maxx, bbox.maxy);

            imageObj image = map.draw();

            MemoryStream memstrm = new MemoryStream(image.getBytes());
            memstrm.Position = 0;

            FileStream outStream = File.OpenWrite("mapimage" +
index.ToString() + ".png");
            memstrm.WriteTo(outStream);
            outStream.Flush();
            outStream.Close();

            bbox.Dispose();
            projWGS84.Dispose();
            projMercatore.Dispose();
            image.Dispose();
            map.Dispose();
        }




        static void Main(string[] args)
        {
            for (int i = 0; i < 10; i++)
            {
                DrawAMap(i);
            }

        }
    }
}

///END


It seems there is a big problem with MapScript 6.0.1 (from MS4W) + ASP.NET +
IIS 7.0. Anybody has the same environment? Experiencing problems?



-----Messaggio originale-----
Da: mapserver-dev-bounces at lists.osgeo.org
[mailto:mapserver-dev-bounces at lists.osgeo.org] Per conto di Daniel
Morissette
Inviato: martedì 4 ottobre 2011 17:42
A: mapserver-dev at lists.osgeo.org
Oggetto: Re: R: [mapserver-dev] Re: Problem with projectionObj

On 11-10-04 11:37 AM, GMail wrote:
> Thanks for your answer.
> The first explanation is not possible, because the same code works for IIS
> 6.0, while it does not on IIS 7.0.
> The second is something I do not understand: using MapScript and ASP.NET I
> do not have a process "mapserv" that can crash ... but I understand that
if
> the IIS handler process crashes or hangs in some way, it may block the
> output buffer, and this is likely. But this does not explain why this
> happens only on IIS 7.0 and not on IIS 6.0. How can I have more log
> information?
>

Maybe a permission issue? Sorry, I'm no IIS expert, just guessing...

Maybe try using MS_ERRORFILE "windowsdebug" with tools such as DebugView 
and see if that makes any difference?

http://mapserver.org/optimization/debugging.html#step-1-set-the-ms-errorfile
-variable


-- 
Daniel Morissette
http://www.mapgears.com/
Provider of Professional MapServer Support since 2000

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



More information about the mapserver-dev mailing list