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));
            }
        }
Exemple #2
0
        /// <param name="histogram">
        ///            a histogram that represents the frequencies of tags </param>
        public void optimizeWayOrdering(TShortIntHashMap histogram)
        {
            this.optimizedWayIds.Clear();
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final java.util.TreeSet<HistogramEntry> wayOrdering = new java.util.TreeSet<>();
            SortedSet <HistogramEntry> wayOrdering = new SortedSet <HistogramEntry>();

            histogram.forEachEntry(new TShortIntProcedureAnonymousInnerClassHelper2(this, wayOrdering));
            short tmpWayID = 0;

            OSMTag currentTag = null;

            foreach (HistogramEntry histogramEntry in wayOrdering.descendingSet())
            {
                currentTag = this.idToWayTag[Convert.ToInt16(histogramEntry.id)];
                this.optimizedWayIds[Convert.ToInt16(histogramEntry.id)] = Convert.ToInt16(tmpWayID);
                LOGGER.finer("adding way tag: " + currentTag.tagKey() + " id:" + tmpWayID + " amount: " + histogramEntry.amount);
                tmpWayID++;
            }
        }