@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); }
@Override public void complete() { this.indexedNodeStore.complete(); this.nodeIndexReader = this.indexedNodeStore.createReader(); this.indexedWayStore.complete(); this.wayIndexReader = this.indexedWayStore.createReader();
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<>(); }
/** * {@inheritDoc} */ @Override public NodeLocation getNodeLocation(long nodeId) { if (nodeLocationsReader == null) { nodeLocations.complete(); nodeLocationsReader = nodeLocations.createReader(); } try { return nodeLocationsReader.get(nodeId).getNodeLocation(); } catch (NoSuchIndexElementException e) { return new NodeLocation(); } }
/** * Creates a new instance. */ public CompactPersistentNodeLocationStore() { nodeLocations = new IndexedObjectStore<CompactPersistentNodeLocation>( new SingleClassObjectSerializationFactory(CompactPersistentNodeLocation.class), "nodeLocation"); }
/** * {@inheritDoc} */ @Override public NodeLocation getNodeLocation(long nodeId) { if (nodeLocationsReader == null) { nodeLocations.complete(); nodeLocationsReader = nodeLocations.createReader(); } try { return nodeLocationsReader.get(nodeId).getNodeLocation(); } catch (NoSuchIndexElementException e) { return new NodeLocation(); } }
@Override public void addNode(Node node) { super.addNode(node); this.indexedNodeStore.add(node.getId(), node); TDNode tdNode = TDNode.fromNode(node, this.preferredLanguages); addPOI(tdNode); }
/** * {@inheritDoc} */ @Override public void close() { if (nodeLocationsReader != null) { nodeLocationsReader.close(); } nodeLocations.close(); } }
/** * Creates a new instance. */ public CompactPersistentNodeLocationStore() { nodeLocations = new IndexedObjectStore<CompactPersistentNodeLocation>( new SingleClassObjectSerializationFactory(CompactPersistentNodeLocation.class), "nodeLocation"); }
/** * {@inheritDoc} */ @Override public void addLocation(long nodeId, NodeLocation nodeLocation) { nodeLocations.add(nodeId, new CompactPersistentNodeLocation(nodeLocation)); }
/** * {@inheritDoc} */ @Override public void close() { if (nodeLocationsReader != null) { nodeLocationsReader.close(); } nodeLocations.close(); } }
/** * {@inheritDoc} */ @Override public void addLocation(long nodeId, NodeLocation nodeLocation) { nodeLocations.add(nodeId, new CompactPersistentNodeLocation(nodeLocation)); }