public void TestStrm30()
        {
            w = 50;
            h = 20;
            latLongRegion = new RectangleF(lng - w * 0.5f, lat - h * 0.5f, w, h);
            long t0 = System.Environment.TickCount;
            long t1 = System.Environment.TickCount;
            TerrainHeightTextureFetcher fetcher = new Srtm30TextureFetcher();
            latLongRegion = new RectangleF(lng - w * 0.5f, lat - h * 0.5f, w, h);
            terrain = fetcher.FetchTerrain(latLongRegion);

            t0 = t1; t1 = System.Environment.TickCount;
            Console.WriteLine("Load: " + ((t1 - t0) / 10));
            DisplayTerrain(terrain, "terrainFetch30.png");
            t0 = t1; t1 = System.Environment.TickCount;
            Console.WriteLine("Save and show: " + ((t1 - t0) / 10));
        }
        void FetchLoresTerrain()
        {
            TerrainHeightTextureFetcher fetcher = new Srtm30TextureFetcher();
            Vector2 terrainLocation = new Vector2((float)MathExtensions.Round(initialTerrainLocation.X, 1), (float)MathExtensions.Round(initialTerrainLocation.Y, 1));

            loresTerrain = fetcher.FetchTerrain(GetCentredSquareRectangle(terrainLocation, DegreesToWorldUnits(9.999) / 1200.0f));
            TerrainEffect.WriteLoresTexture(loresTerrain);
            TerrainEffect.LoresTerrainCentreLocation = new Vector2(); //DegreesToWorldUnits(initialCameraLocation);
        }
        public void TestStrm30PixelMap()
        {
            PointF longLat = new PointF(lng, lat);
            TerrainHeightTextureFetcher fetcher = new Srtm30TextureFetcher();
            int w = 2048;
            int h = 2048;
            for (int i = 0; i < 2; i++)
            {
                for (int j = 0; j < 2; j++)
                {

                    Rectangle region = new Rectangle(700 + i * w, 1800 - j * h, w, h);

                    terrain = fetcher.FetchTerrain(longLat, region);

                    Image img = ImagingFunctions.CreateImageFromArray(terrain, ImagingFunctions.HsvColourMap(256));
                    ImagingFunctions.SaveAndDisplayImage(img, "terrainFetchPixel04" + i + j + ".png");
                }
            }
        }
        public void TestStrm30PixelRegion()
        {
            PointF longLat = new PointF(lng, lat);
            TerrainHeightTextureFetcher fetcher = new Srtm30TextureFetcher();
            Rectangle region = new Rectangle(0, 0, 2000, 1500);

            terrain = fetcher.FetchTerrain(longLat, region);

            Image img = ImagingFunctions.CreateImageFromArray(terrain, ImagingFunctions.HsvColourMap(256));
            ImagingFunctions.SaveAndDisplayImage(img, "terrainFetchPixel300.png");
            region = new Rectangle(0, 1500, 2000, 1500);

            terrain = fetcher.FetchTerrain(longLat, region);

            img = ImagingFunctions.CreateImageFromArray(terrain, ImagingFunctions.HsvColourMap(256));
            ImagingFunctions.SaveAndDisplayImage(img, "terrainFetchPixel302.png");
        }