示例#1
0
        public override void addRelation(Relation relation)
        {
            TDRelation tdRelation = TDRelation.fromRelation(relation, this, this.preferredLanguages);

            if (tdRelation != null)
            {
                this.multipolygons.put(relation.Id, tdRelation);
            }
        }
示例#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);
        }