Memory issue

Jun 7, 2009 at 10:35 AM

Hi guys,

I'm using Proj.Net in a project development oriented to radio propagation simulation. The application imports srtm maps (WGS84) into its native projected coordinate system: UTM (ED50), and also it exports back some computed signal field strength layers to Google Earth through an image overlay. As you can imagine, a transformation between coordinate systems is mandatory. The problem I'm dealing with is that every time the reprojection's method is called the consumption of memory increases enormously, even reaching 600Mb, and this memory it is not freed at the end.

Do anyone know something about this? Maybe the problem is in my code, or I'm skipping any step. I followed the example provided in the FAQ section. This is the code for one of the reprojection's method (the other method is similar but reversed).

public static List<double[]> UTM50toGEO84rapid(List<double[]> input, int huso, bool hemisfNorte)
{
                       
            // Setup central meridian and northing reference.

            int mercentral, falsenorthing;
            mercentral = ((huso - 30) * 6) - 3;
           
            if (hemisfNorte) { falsenorthing = 0; }
            else { falsenorthing = 10000000; }

            // Setup WKT strings
            // SCP Input (Sistema de coordenadas proyectadas).
            // SCG Output (Sistema de coordenadas geograficas).

            string UTM50in =  "PROJCS[\"ED_1950_UTM\", "
                              + "GEOGCS[\"GCS_European_1950\", "
                              + "DATUM[\"D_European_1950\", "
                              + "SPHEROID[\"International_1924\",6378388,297], "
                              + "TOWGS84[-131.0320,-100.2510,-163.3540,-1.2438,-0.0195,-1.1436,9.3900]], "
                              + "PRIMEM[\"Greenwich\",0], "
                              + "UNIT[\"Degree\",0.017453292519943295]], "
                              + "PROJECTION[\"Transverse_Mercator\"], "
                              + "PARAMETER[\"False_Easting\",500000], "
                              + "PARAMETER[\"False_Northing\"," + falsenorthing.ToString() + "], "
                              + "PARAMETER[\"Central_Meridian\"," + mercentral.ToString() + "], "
                              + "PARAMETER[\"Scale_Factor\",0.9996], "
                              + "PARAMETER[\"Latitude_Of_Origin\",0], "
                              + "UNIT[\"Meter\",1]]";
           
            string GEO84out =   "GEOGCS[\"GCS_WGS_1984\", "
                              + "DATUM[\"D_WGS_1984\", "
                              + "SPHEROID[\"WGS_1984\",6378137,298.257223563]], "
                              + "PRIMEM[\"Greenwich\",0], "
                              + "UNIT[\"Degree\",0.01745329251994328]]";

          
            // TRANSFORMATION.
           
            IProjectedCoordinateSystem SCPin = CoordinateSystemWktReader.Parse(UTM50in) as IProjectedCoordinateSystem;
            IGeographicCoordinateSystem SCGout = CoordinateSystemWktReader.Parse(GEO84out) as IGeographicCoordinateSystem;

            CoordinateTransformationFactory ctfactory = new CoordinateTransformationFactory();
            ICoordinateTransformation transformador = ctfactory.CreateFromCoordinateSystems(SCPin, SCGout);

            List<double[]> output = transformador.MathTransform.TransformList(input);

            SCPin = null;
            SCGout = null;
            ctfactory = null;
            transformador = null;

            return output;
        }

 

By the way, Im using Vista Business x64 as development platform and VC# 2008 Express Ed. although the app will run in any Win (XP presumibly). Any help would be great! Regards from Spain. Sorry for my english :-)