public void SaveTerrainHeight(ImportSettings settings)
        {
            bool   prefixFP   = false;
            var    CurSim     = settings.CurSim;
            OSDMap simInfoMap = new OSDMap();

            // leave these out of serialization
            simInfoMap["ObjectsPrimitives"] = true;
            simInfoMap["ObjectsAvatars"]    = true;
            simInfoMap["Client"]            = true;
            simInfoMap["SharedData"]        = true;
            simInfoMap["Caps"]          = true;
            simInfoMap["DeadObjects"]   = true;
            simInfoMap["KilledObjects"] = true;
            var exceptFor = new HashSet <object>()
            {
                typeof(IList), typeof(IDictionary), typeof(object)
            };

            OSD.AddObjectOSD0(CurSim.Stats, simInfoMap, typeof(Simulator.SimStats), exceptFor, true, prefixFP);
            //@todo OSD.AddObjectOSD0(CurSim.SharedData, simInfoMap, typeof(Simulator.SimPooledData), exceptFor, true, prefixFP);
            OSD.AddObjectOSD0(CurSim, simInfoMap, typeof(Simulator), exceptFor, true, prefixFP);
            string output = OSDParser.SerializeLLSDXmlString(simInfoMap);

            {
                lock (fileWriterLock) File.WriteAllText(terrainDir + "simInfoMap.llsd", output);
            }
            AddRelated(CurSim.TerrainBase0, AssetType.Texture);
            AddRelated(CurSim.TerrainBase1, AssetType.Texture);
            AddRelated(CurSim.TerrainBase2, AssetType.Texture);
            AddRelated(CurSim.TerrainBase3, AssetType.Texture);
            AddRelated(CurSim.TerrainDetail0, AssetType.Texture);
            AddRelated(CurSim.TerrainDetail1, AssetType.Texture);
            AddRelated(CurSim.TerrainDetail2, AssetType.Texture);
            AddRelated(CurSim.TerrainDetail3, AssetType.Texture);
            AddExportUser(CurSim.SimOwner);
            var Terrain = CurSim.Terrain;

            if (Terrain == null)
            {
                Failure("Terrain missing completely");
                return;
            }
            Client.Grid.RequestMapItems(CurSim.Handle, GridItemType.LandForSale, GridLayerType.Terrain);
            var number  = CurSim.Terrain.Length;
            var missing = 0;

            foreach (TerrainPatch patch in Terrain)
            {
                if (patch != null && patch.Data != null && patch.Data.Length > 0)
                {
                    continue;
                }
                missing++;
            }
            var terrainReady = (missing == 0);

            if (!terrainReady)
            {
                Failure("Terrain missing chunks/total=" + missing + "/" + number);
            }
            if (terrainReady || forced)
            {
                SaveToDisk(terrainDir + "terrain.patches", Terrain);
                SaveTerrainRaw32(dumpDir + "../terrains/heightmap.r32");
                if (!terrainReady)
                {
                    Failure("SaveTerrainHeight Saved but not ready");
                }
                else
                {
                    Success("SaveTerrainHeight Success");
                }
                return;
            }
            Failure("Unable to SaveTerrainHeight (use --force)");
        }