private HDTileBasedDataProcessor(MapWriterConfiguration configuration) { super(configuration); this.indexedNodeStore = new IndexedObjectStore<>(new SingleClassObjectSerializationFactory(Node.class), "idxNodes"); this.indexedWayStore = new IndexedObjectStore<>(new SingleClassObjectSerializationFactory(Way.class), "idxWays"); // indexedRelationStore = new IndexedObjectStore<Relation>( // new SingleClassObjectSerializationFactory( // Relation.class), "idxWays"); this.wayStore = new SimpleObjectStore<>(new SingleClassObjectSerializationFactory(Way.class), "heapWays", true); this.relationStore = new SimpleObjectStore<>(new SingleClassObjectSerializationFactory(Relation.class), "heapRelations", true); this.tileData = new HDTileData[this.zoomIntervalConfiguration.getNumberOfZoomIntervals()][][]; for (int i = 0; i < this.zoomIntervalConfiguration.getNumberOfZoomIntervals(); i++) { this.tileData[i] = new HDTileData[this.tileGridLayouts[i].getAmountTilesHorizontal()][this.tileGridLayouts[i] .getAmountTilesVertical()]; } this.virtualWays = new TLongObjectHashMap<>(); this.additionalRelationTags = new TLongObjectHashMap<>(); }
@Override public void addRelation(Relation relation) { super.addRelation(relation); this.relationStore.add(relation); }
ReleasableIterator<Way> wayReader = this.wayStore.iterate(); while (wayReader.hasNext()) { if (this.progressLogs) { ReleasableIterator<Relation> relationReader = this.relationStore.iterate(); RelationHandler relationHandler = new RelationHandler(); while (relationReader.hasNext()) { wayReader = this.wayStore.iterate(); WayHandler wayHandler = new WayHandler(); while (wayReader.hasNext()) {
DataInputStream dataInStream; if (!initializeIteratingStage()) { return new EmptyIterator<T>();
private void pumpWaysToSink() { try (ReleasableIterator<WayContainer> i = allWays.iterate()) { while (i.hasNext()) { WayContainer wayContainer = i.next(); if (availableWays.get(wayContainer.getEntity().getId())) { emitWay(wayContainer); } } } }
DataInputStream dataInStream; if (!initializeIteratingStage()) { return new EmptyIterator<T>();
@Override public void addWay(Way way) { super.addWay(way); this.wayStore.add(way); this.indexedWayStore.add(way.getId(), way); this.maxWayID = Math.max(way.getId(), this.maxWayID); }
private void pumpNodesToSink() { try (ReleasableIterator<NodeContainer> i = allNodes.iterate()) { while (i.hasNext()) { NodeContainer nodeContainer = i.next(); if (availableNodes.get(nodeContainer.getEntity().getId())) { emitNode(nodeContainer); } } } }
/** * Creates a new instance. * * @param serializationFactory * The factory defining the object serialisation implementation. * @param sourceIterator * The source of data. * @param storageFilePrefix * The prefix of the storage file. * @param useCompression * If true, the storage file will be compressed. */ public PersistentIterator( ObjectSerializationFactory serializationFactory, ReleasableIterator<T> sourceIterator, String storageFilePrefix, boolean useCompression) { this.sourceIterator = sourceIterator; store = new SimpleObjectStore<T>(serializationFactory, storageFilePrefix, useCompression); initialized = false; }
/** * {@inheritDoc} */ public void process(NodeContainer container) { allNodes.add(container); }
private void pumpNodesToSink() { try (ReleasableIterator<NodeContainer> i = allNodes.iterate()) { while (i.hasNext()) { NodeContainer nodeContainer = i.next(); if (availableNodes.get(nodeContainer.getEntity().getId())) { emitNode(nodeContainer); } } } }
/** * Creates a new instance. * * @param serializationFactory * The factory defining the object serialisation implementation. * @param sourceIterator * The source of data. * @param storageFilePrefix * The prefix of the storage file. * @param useCompression * If true, the storage file will be compressed. */ public PersistentIterator( ObjectSerializationFactory serializationFactory, ReleasableIterator<T> sourceIterator, String storageFilePrefix, boolean useCompression) { this.sourceIterator = sourceIterator; store = new SimpleObjectStore<T>(serializationFactory, storageFilePrefix, useCompression); initialized = false; }
@Override public void process(RelationContainer relation) { objects.add(relation); } }