public override void complete()
        {
            NumberFormat nfMegabyte = NumberFormat.Instance;
            NumberFormat nfCounts   = NumberFormat.Instance;

            nfCounts.GroupingUsed            = true;
            nfMegabyte.MaximumFractionDigits = 2;

            LOGGER.info("completing read...");
            this.tileBasedGeoObjectStore.complete();

            LOGGER.info("start writing file...");

            try
            {
                if (this.configuration.OutputFile.exists())
                {
                    LOGGER.info("overwriting file " + this.configuration.OutputFile.AbsolutePath);
                    this.configuration.OutputFile.delete();
                }
                MapFileWriter.writeFile(this.configuration, this.tileBasedGeoObjectStore);
            }
            catch (IOException e)
            {
                LOGGER.log(Level.SEVERE, "error while writing file", e);
            }

            LOGGER.info("finished...");
            LOGGER.fine("total processed nodes: " + nfCounts.format(this.amountOfNodesProcessed));
            LOGGER.fine("total processed ways: " + nfCounts.format(this.amountOfWaysProcessed));
            LOGGER.fine("total processed relations: " + nfCounts.format(this.amountOfRelationsProcessed));

            LOGGER.info("estimated memory consumption: " + nfMegabyte.format(+((Runtime.Runtime.totalMemory() - Runtime.Runtime.freeMemory()) / Math.Pow(1024, 2))) + "MB");
        }
Beispiel #2
0
 public void Save()
 {
     if (!voxelArray.unsavedChanges)
     {
         Debug.unityLogger.Log("EditorFile", "No unsaved changes");
         return;
     }
     Debug.unityLogger.Log("EditorFile", "Saving...");
     MapFileWriter writer = new MapFileWriter(SelectedMap.Instance().mapName);
     writer.Write(cameraPivot, voxelArray);
     voxelArray.unsavedChanges = false;
 }
Beispiel #3
0
 private void saveToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (map == null)
     {
         MessageBox.Show("No map loaded.");
         return;
     }
     saveFileDialog1.Filter = "Map files|*.map";
     saveFileDialog1.Title  = "Write a map file";
     if (saveFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         MapFileWriter writer = new MapFileWriter();
         writer.writeMapFile(map, saveFileDialog1.FileName);
     }
 }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testWriteHeaderBuffer()
        public virtual void testWriteHeaderBuffer()
        {
            ByteBuffer headerBuffer = ByteBuffer.allocate(MapFileWriter.HEADER_BUFFER_SIZE);
            int        headerLength = MapFileWriter.writeHeaderBuffer(this.configuration, this.dataProcessor, headerBuffer);

            // expected header length
            // 20 + 4 + 4 + 8 + 8 + 16 + 2
            // + 9 ("Mercator")
            // + 1 + 8 + 1
            // + 6 ("en,de")
            // + 17 ("i love mapsforge")
            // + 5("test")
            // + 2 + 19 ("amenity=university")
            // + 2 + 14 + 18 ("natural=beach", natural=coastline")
            // + 1
            // + 3 * (3 + 8 + 8)
            // == 222
            Assert.assertEquals(222, headerLength);
        }
Beispiel #5
0
    IEnumerator output_async(string str, bool show_log = false)
    {
        LoadingScreen.SetActive(true);

        if (show_log)
        {
            //LogScreen.SetActive(true);
            //ClearLog();
        }

        yield return(null);

        yield return(new WaitUntil(() => LoadingScreen.activeInHierarchy));

        ElementManager mgr    = GetComponent <ElementManager>();
        NodeLayout     layout = WorldGenerator.GetLayout();

        int[] province_ids = GetProvinceIdVals(new Vector3(0, 60, 0));

        MapFileWriter.GenerateText(str, layout, mgr, m_nations, new Vector2(-mgr.X, -mgr.Y), new Vector2(mgr.X * (layout.X - 1), mgr.Y * (layout.Y - 1)), mgr.Provinces, m_teamplay, province_ids);

        yield return(null);

        MapFileWriter.GenerateImage(str, mgr.Texture); // summer

        mgr.ShowLabels(true);

        yield return(null);

        MapFileWriter.GenerateImage(str + "_with_labels", mgr.Texture, false); // labeled image

        mgr.ShowLabels(false);

        if (m_season == Season.SUMMER)
        {
            m_season = Season.WINTER;
        }
        else
        {
            m_season = Season.SUMMER;
        }

        do_season_change();

        yield return(new WaitUntil(() => ArtManager.s_art_manager.JustChangedSeason));

        yield return(new WaitForEndOfFrame());                     // possibly not needed

        ArtManager.s_art_manager.CaptureCam.Render();              // possibly not needed

        yield return(new WaitForEndOfFrame());                     // possibly not needed

        MapFileWriter.GenerateImage(str + "_winter", mgr.Texture); // winter

        if (m_season == Season.SUMMER)
        {
            m_season = Season.WINTER;
        }
        else
        {
            m_season = Season.SUMMER;
        }

        do_season_change();

        GetComponent <AudioSource>().PlayOneShot(AcceptAudio);

        LoadingScreen.SetActive(false);
        //LogScreen.SetActive(false);
    }