예제 #1
0
        public override void complete()
        {
            // Polygonize multipolygon
            RelationHandler relationHandler = new RelationHandler();

            this.multipolygons.forEachValue(relationHandler);

            WayHandler wayHandler = new WayHandler();

            this.ways.forEachValue(wayHandler);

            OSMTagMapping.Instance.optimizePoiOrdering(this.histogramPoiTags);
            OSMTagMapping.Instance.optimizeWayOrdering(this.histogramWayTags);
        }
예제 #2
0
        // TODO add accounting of average number of tiles per way
        public override void complete()
        {
            this.indexedNodeStore.complete();
            this.nodeIndexReader = this.indexedNodeStore.createReader();

            this.indexedWayStore.complete();
            this.wayIndexReader = this.indexedWayStore.createReader();

            // handle relations
            ReleasableIterator <Relation> relationReader = this.relationStore.iterate();
            RelationHandler relationHandler = new RelationHandler();

            while (relationReader.hasNext())
            {
                Relation   entry      = relationReader.next();
                TDRelation tdRelation = TDRelation.fromRelation(entry, this, this.preferredLanguages);
                relationHandler.execute(tdRelation);
            }

            // handle ways
            ReleasableIterator <Way> wayReader = this.wayStore.iterate();
            WayHandler wayHandler = new WayHandler();

            while (wayReader.hasNext())
            {
                Way   way   = wayReader.next();
                TDWay tdWay = TDWay.fromWay(way, this, this.preferredLanguages);
                if (tdWay == null)
                {
                    continue;
                }
                IList <TDRelation> associatedRelations = this.additionalRelationTags.get(tdWay.Id);
                if (associatedRelations != null)
                {
                    foreach (TDRelation tileDataRelation in associatedRelations)
                    {
                        tdWay.mergeRelationInformation(tileDataRelation);
                    }
                }

                wayHandler.execute(tdWay);
            }

            OSMTagMapping.Instance.optimizePoiOrdering(this.histogramPoiTags);
            OSMTagMapping.Instance.optimizeWayOrdering(this.histogramWayTags);
        }