public BaseTileBasedDataProcessor(MapWriterConfiguration configuration) : base()
        {
            this.boundingbox = configuration.BboxConfiguration;
            this.zoomIntervalConfiguration = configuration.ZoomIntervalConfiguration;
            this.tileGridLayouts           = new TileGridLayout[this.zoomIntervalConfiguration.NumberOfZoomIntervals];
            this.bboxEnlargement           = configuration.BboxEnlargement;
            this.preferredLanguages        = configuration.PreferredLanguages;
            this.skipInvalidRelations      = configuration.SkipInvalidRelations;

            this.outerToInnerMapping            = new TLongObjectHashMap <>();
            this.innerWaysWithoutAdditionalTags = new TLongHashSet();
            this.tilesToCoastlines = new Dictionary <>();

            this.countWays          = new float[this.zoomIntervalConfiguration.NumberOfZoomIntervals];
            this.countWayTileFactor = new float[this.zoomIntervalConfiguration.NumberOfZoomIntervals];

            this.histogramPoiTags = new TShortIntHashMap();
            this.histogramWayTags = new TShortIntHashMap();

            // compute horizontal and vertical tile coordinate offsets for all
            // base zoom levels
            for (int i = 0; i < this.zoomIntervalConfiguration.NumberOfZoomIntervals; i++)
            {
                TileCoordinate upperLeft = new TileCoordinate((int)MercatorProjection.longitudeToTileX(this.boundingbox.minLongitude, this.zoomIntervalConfiguration.getBaseZoom(i)), (int)MercatorProjection.latitudeToTileY(this.boundingbox.maxLatitude, this.zoomIntervalConfiguration.getBaseZoom(i)), this.zoomIntervalConfiguration.getBaseZoom(i));
                this.tileGridLayouts[i] = new TileGridLayout(upperLeft, computeNumberOfHorizontalTiles(i), computeNumberOfVerticalTiles(i));
            }
        }
Пример #2
0
        private RAMTileBasedDataProcessor(MapWriterConfiguration configuration) : base(configuration)
        {
            this.nodes         = new TLongObjectHashMap <>();
            this.ways          = new TLongObjectHashMap <>();
            this.multipolygons = new TLongObjectHashMap <>();
            this.tileData      = new RAMTileData[this.zoomIntervalConfiguration.NumberOfZoomIntervals][][];
            // compute number of tiles needed on each base zoom level
            for (int i = 0; i < this.zoomIntervalConfiguration.NumberOfZoomIntervals; i++)
            {
//JAVA TO C# CONVERTER NOTE: The following call to the 'RectangularArrays' helper class reproduces the rectangular array initialization that is automatic in Java:
//ORIGINAL LINE: this.tileData[i] = new RAMTileData[this.tileGridLayouts[i].AmountTilesHorizontal][this.tileGridLayouts[i].AmountTilesVertical];
                this.tileData[i] = RectangularArrays.ReturnRectangularRAMTileDataArray(this.tileGridLayouts[i].AmountTilesHorizontal, this.tileGridLayouts[i].AmountTilesVertical);
            }
        }
Пример #3
0
        private HDTileBasedDataProcessor(MapWriterConfiguration configuration) : base(configuration)
        {
            this.indexedNodeStore = new IndexedObjectStore <>(new SingleClassObjectSerializationFactory(typeof(Node)), "idxNodes");
            this.indexedWayStore  = new IndexedObjectStore <>(new SingleClassObjectSerializationFactory(typeof(Way)), "idxWays");
            // indexedRelationStore = new IndexedObjectStore<Relation>(
            // new SingleClassObjectSerializationFactory(
            // Relation.class), "idxWays");
            this.wayStore      = new SimpleObjectStore <>(new SingleClassObjectSerializationFactory(typeof(Way)), "heapWays", true);
            this.relationStore = new SimpleObjectStore <>(new SingleClassObjectSerializationFactory(typeof(Relation)), "heapRelations", true);

            this.tileData = new HDTileData[this.zoomIntervalConfiguration.NumberOfZoomIntervals][][];
            for (int i = 0; i < this.zoomIntervalConfiguration.NumberOfZoomIntervals; i++)
            {
//JAVA TO C# CONVERTER NOTE: The following call to the 'RectangularArrays' helper class reproduces the rectangular array initialization that is automatic in Java:
//ORIGINAL LINE: this.tileData[i] = new HDTileData[this.tileGridLayouts[i].AmountTilesHorizontal][this.tileGridLayouts[i].AmountTilesVertical];
                this.tileData[i] = RectangularArrays.ReturnRectangularHDTileDataArray(this.tileGridLayouts[i].AmountTilesHorizontal, this.tileGridLayouts[i].AmountTilesVertical);
            }
            this.virtualWays            = new TLongObjectHashMap <>();
            this.additionalRelationTags = new TLongObjectHashMap <>();
        }
Пример #4
0
        internal MapFileWriterTask(MapWriterConfiguration configuration)
        {
            this.configuration = configuration;

            Properties properties = new Properties();

            try
            {
                properties.load(typeof(MapFileWriterTask).ClassLoader.getResourceAsStream("default.properties"));
                configuration.WriterVersion = Constants.CREATOR_NAME + "-" + properties.getProperty(Constants.PROPERTY_NAME_WRITER_VERSION);
                // If multilingual map then set newer map file version
                bool multilingual = configuration.PreferredLanguages != null && configuration.PreferredLanguages.size() > 1;
                configuration.FileSpecificationVersion = int.Parse(properties.getProperty(multilingual ? Constants.PROPERTY_NAME_FILE_SPECIFICATION_VERSION_MAX : Constants.PROPERTY_NAME_FILE_SPECIFICATION_VERSION_MIN));

                LOGGER.info("mapfile-writer version: " + configuration.WriterVersion);
                LOGGER.info("mapfile format specification version: " + configuration.FileSpecificationVersion);
            }
            catch (IOException e)
            {
                throw new Exception("could not find default properties", e);
            }
            catch (System.FormatException e)
            {
                throw new Exception("map file specification version is not an integer", e);
            }

            // CREATE DATASTORE IF BBOX IS DEFINED
            if (this.configuration.BboxConfiguration != null)
            {
                if ("ram".Equals(configuration.DataProcessorType, StringComparison.CurrentCultureIgnoreCase))
                {
                    this.tileBasedGeoObjectStore = RAMTileBasedDataProcessor.newInstance(configuration);
                }
                else
                {
                    this.tileBasedGeoObjectStore = HDTileBasedDataProcessor.newInstance(configuration);
                }
            }
        }
Пример #5
0
 /// <summary>
 /// Creates a new <seealso cref="HDTileBasedDataProcessor"/>.
 /// </summary>
 /// <param name="configuration">
 ///            the configuration </param>
 /// <returns> a new instance of a <seealso cref="HDTileBasedDataProcessor"/> </returns>
 public static HDTileBasedDataProcessor newInstance(MapWriterConfiguration configuration)
 {
     return(new HDTileBasedDataProcessor(configuration));
 }