@Override
    public void complete() {
        this.indexedNodeStore.complete();
        this.nodeIndexReader = this.indexedNodeStore.createReader();

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

        LOGGER.info("handle coastlines" +
                (this.tagValues ? " and implicit way relations..." : "..."));
        // Prepare implicit way relations
        // (should be done here, before handling ways, although
        // the WayHandler does only process ids in HD Processor)
        int nWays = 0;
        ReleasableIterator<Way> wayReader = this.wayStore.iterate();
        while (wayReader.hasNext()) {
            if (this.progressLogs) {
                if (++nWays % 10000 == 0) {
                    System.out.print("Ways: " + this.nfCounts.format(nWays)
                            + " / " + this.nfCounts.format(getWaysNumber()) + "\r");
                }
            }

            Way way = wayReader.next();
            TDWay tdWay = TDWay.fromWay(way, this, this.preferredLanguages);
            if (tdWay == null) {
                continue;
            }
            prepareImplicitWayRelations(tdWay);
        }

        // handle implicit relations
        handleImplicitWayRelations();

        LOGGER.info("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);
        }

        LOGGER.info("handle ways...");
        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;
            }

            // #HDstoreData: handled here only for tag count - handled for writing in method: fromHDTileData()
            List<TDRelation> associatedRelations = this.additionalRelationTags.get(tdWay.getId());
            if (associatedRelations != null) {
                for (TDRelation tileDataRelation : associatedRelations) {
                    tdWay.mergeRelationInformation(tileDataRelation);
                }
            }

            wayHandler.execute(tdWay);
        }

        OSMTagMapping.getInstance().optimizePoiOrdering(this.histogramPoiTags);
        OSMTagMapping.getInstance().optimizeWayOrdering(this.histogramWayTags);
    }
@ Override public void complete ( ) { this . indexedNodeStore . complete ( ) ; this . nodeIndexReader = this . indexedNodeStore . createReader ( ) ; this . indexedWayStore . complete ( ) ; this . wayIndexReader = this . indexedWayStore . createReader ( ) ; LOGGER . info ( "handle coastlines" + ( this . tagValues ? " and implicit way relations..." : "..." ) ) ; int nWays = 0 ; ReleasableIterator < Way > wayReader = this . wayStore . iterate ( ) ; while ( wayReader . hasNext ( ) ) { if ( this . progressLogs ) { if ( ++ nWays % 10000 == 0 ) { System . out . print ( "Ways: " + this . nfCounts . format ( nWays ) + " / " + this . nfCounts . format ( getWaysNumber ( ) ) + "\r" ) ; } } Way way = wayReader . next ( ) ; TDWay tdWay = TDWay . fromWay ( way , this , this . preferredLanguages ) ; if ( tdWay == null ) { continue ; } prepareImplicitWayRelations ( tdWay ) ; } handleImplicitWayRelations ( ) ; LOGGER . info ( "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 ) ; } LOGGER . info ( "handle ways..." ) ; 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 ; } List < TDRelation > associatedRelations = this . additionalRelationTags . get ( tdWay . getId ( ) ) ; if ( associatedRelations != null ) { for ( TDRelation tileDataRelation : associatedRelations ) { tdWay . mergeRelationInformation ( tileDataRelation ) ; } } wayHandler . execute ( tdWay ) ; } OSMTagMapping . getInstance ( ) . optimizePoiOrdering ( this . histogramPoiTags ) ; OSMTagMapping . getInstance ( ) . optimizeWayOrdering ( this . histogramWayTags ) ; }
TODO add accounting of average number of tiles per way