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<>(); }
/** * Creates a new instance. * * @param comparator * The comparator to use for sorting. */ public ChangeSorter(Comparator<ChangeContainer> comparator) { fileBasedSort = new FileBasedSort<ChangeContainer>( new SingleClassObjectSerializationFactory(ChangeContainer.class), comparator, true); }
/** * Creates a new instance. */ public CompactPersistentNodeLocationStore() { nodeLocations = new IndexedObjectStore<CompactPersistentNodeLocation>( new SingleClassObjectSerializationFactory(CompactPersistentNodeLocation.class), "nodeLocation"); }
/** * Creates a new instance. */ public CompactPersistentNodeLocationStore() { nodeLocations = new IndexedObjectStore<CompactPersistentNodeLocation>( new SingleClassObjectSerializationFactory(CompactPersistentNodeLocation.class), "nodeLocation"); }
/** * Creates a new instance. * * @param comparator * The comparator to use for sorting. */ public ChangeSorter(Comparator<ChangeContainer> comparator) { fileBasedSort = new FileBasedSort<ChangeContainer>( new SingleClassObjectSerializationFactory(ChangeContainer.class), comparator, true); }
/** * Creates a new instance. * * @param idTrackerType * Defines the id tracker implementation to use. */ public UsedNodeFilter(IdTrackerType idTrackerType) { allNodes = new SimpleObjectStore<NodeContainer>( new SingleClassObjectSerializationFactory(NodeContainer.class), "afnd", true); allWays = new SimpleObjectStore<WayContainer>( new SingleClassObjectSerializationFactory(WayContainer.class), "afwy", true); allRelations = new SimpleObjectStore<RelationContainer>( new SingleClassObjectSerializationFactory(RelationContainer.class), "afrl", true); requiredNodes = IdTrackerFactory.createInstance(idTrackerType); }
/** * Creates a new instance. * * @param idTrackerType * Defines the id tracker implementation to use. */ public UsedWayFilter(IdTrackerType idTrackerType) { allNodes = new SimpleObjectStore<NodeContainer>( new SingleClassObjectSerializationFactory(NodeContainer.class), "afnd", true); allWays = new SimpleObjectStore<WayContainer>( new SingleClassObjectSerializationFactory(WayContainer.class), "afwy", true); allRelations = new SimpleObjectStore<RelationContainer>( new SingleClassObjectSerializationFactory(RelationContainer.class), "afrl", true); requiredWays = IdTrackerFactory.createInstance(idTrackerType); }
/** * Creates a new instance. * * @param elementType * The type of index element to be stored in the index. * @param ordering * A comparator that sorts index elements desired index key * ordering. * @param indexFile * The file to use for storing the index. */ public IndexStore(Class<T> elementType, Comparator<K> ordering, File indexFile) { this.ordering = ordering; this.indexFile = indexFile; serializationFactory = new SingleClassObjectSerializationFactory(elementType); indexStore = new RandomAccessObjectStore<T>(serializationFactory, indexFile); sorted = true; elementCount = 0; elementSize = -1; complete = false; }
/** * Creates a new instance. * * @param elementType * The type of index element to be stored in the index. * @param ordering * A comparator that sorts index elements desired index key * ordering. * @param indexFile * The file to use for storing the index. */ public IndexStore(Class<T> elementType, Comparator<K> ordering, File indexFile) { this.ordering = ordering; this.indexFile = indexFile; serializationFactory = new SingleClassObjectSerializationFactory(elementType); indexStore = new RandomAccessObjectStore<T>(serializationFactory, indexFile); sorted = true; elementCount = 0; elementSize = -1; complete = false; }
/** * Creates a new instance. * * * @param elementType * The type of index element to be stored in the index. * @param ordering * A comparator that sorts index elements desired index key * ordering. * @param tempFilePrefix * The prefix of the temporary file. */ public IndexStore(Class<T> elementType, Comparator<K> ordering, String tempFilePrefix) { this.ordering = ordering; this.tempFilePrefix = tempFilePrefix; serializationFactory = new SingleClassObjectSerializationFactory(elementType); indexStore = new RandomAccessObjectStore<T>(serializationFactory, tempFilePrefix); sorted = true; elementCount = 0; elementSize = -1; complete = false; }
/** * Creates a new instance. * * * @param elementType * The type of index element to be stored in the index. * @param ordering * A comparator that sorts index elements desired index key * ordering. * @param tempFilePrefix * The prefix of the temporary file. */ public IndexStore(Class<T> elementType, Comparator<K> ordering, String tempFilePrefix) { this.ordering = ordering; this.tempFilePrefix = tempFilePrefix; serializationFactory = new SingleClassObjectSerializationFactory(elementType); indexStore = new RandomAccessObjectStore<T>(serializationFactory, tempFilePrefix); sorted = true; elementCount = 0; elementSize = -1; complete = false; }
if (storeEntities) { allNodes = new SimpleObjectStore<NodeContainer>( new SingleClassObjectSerializationFactory(NodeContainer.class), "afn", true); allWays = new SimpleObjectStore<WayContainer>( new SingleClassObjectSerializationFactory(WayContainer.class), "afw", true); allRelations = new SimpleObjectStore<RelationContainer>( new SingleClassObjectSerializationFactory(RelationContainer.class), "afr", true); } else if (cascadingRelations) { allRelations = new SimpleObjectStore<RelationContainer>( new SingleClassObjectSerializationFactory(RelationContainer.class), "afr", true);
if (storeEntities) { allNodes = new SimpleObjectStore<NodeContainer>( new SingleClassObjectSerializationFactory(NodeContainer.class), "afn", true); allWays = new SimpleObjectStore<WayContainer>( new SingleClassObjectSerializationFactory(WayContainer.class), "afw", true); allRelations = new SimpleObjectStore<RelationContainer>( new SingleClassObjectSerializationFactory(RelationContainer.class), "afr", true); } else if (cascadingRelations) { allRelations = new SimpleObjectStore<RelationContainer>( new SingleClassObjectSerializationFactory(RelationContainer.class), "afr", true);
/** * Creates a new instance. * * @param dbCtx * The database context to use for accessing the database. * @param entityMapper * The database mapper for the entity type. */ public EntityReader(DatabaseContext dbCtx, EntityMapper<T> entityMapper) { // The postgres jdbc driver doesn't appear to allow concurrent result // sets on the same connection so only the last opened result set may be // streamed. The rest of the result sets must be persisted first. entityReader = new PersistentIterator<T>( new SingleClassObjectSerializationFactory(entityMapper.getEntityClass()), new EntityTableReader<T>(dbCtx, entityMapper), "ent", true ); entityTagReader = new PeekableIterator<DbFeature<Tag>>( new PersistentIterator<DbFeature<Tag>>( new SingleClassObjectSerializationFactory(DbFeature.class), new EntityFeatureTableReader<Tag, DbFeature<Tag>>(dbCtx, new TagMapper(entityMapper.getEntityName())), "enttag", true ) ); }
new SingleClassObjectSerializationFactory(entityMapper.getEntityClass()), new EntityTableReader<T>(dbCtx, entityMapper, constraintTable), "nod", entityTagReader = new PeekableIterator<DbFeature<Tag>>( new PersistentIterator<DbFeature<Tag>>( new SingleClassObjectSerializationFactory(DbFeature.class), new EntityFeatureTableReader<Tag, DbFeature<Tag>>( dbCtx, new TagMapper(entityMapper.getEntityName()), constraintTable),
new SingleClassObjectSerializationFactory(DbOrderedFeature.class), new DbOrderedFeatureComparator<RelationMember>(), true);
new SingleClassObjectSerializationFactory(DbFeatureHistory.class), new DbFeatureHistoryComparator<Tag>(), true);
new SingleClassObjectSerializationFactory(entityMapper.getEntityClass()), new EntitySubClassComparator<T>(new EntityByTypeThenIdComparator()), true);
new SingleClassObjectSerializationFactory(DbFeatureHistory.class), new DbFeatureHistoryComparator<Tag>(), true);
new SingleClassObjectSerializationFactory(DbFeatureHistory.class), new DbOrderedFeatureHistoryComparator<RelationMember>(), true);