use of com.baremaps.store.type.LongDataType in project baremaps by baremaps.
the class Import method call.
@Override
public Integer call() throws Exception {
BlobStore blobStore = options.blobStore();
DataSource datasource = PostgresUtils.datasource(database);
HeaderRepository headerRepository = new PostgresHeaderRepository(datasource);
Repository<Long, Node> nodeRepository = new PostgresNodeRepository(datasource);
Repository<Long, Way> wayRepository = new PostgresWayRepository(datasource);
Repository<Long, Relation> relationRepository = new PostgresRelationRepository(datasource);
Path directory = Files.createTempDirectory(Paths.get("."), "baremaps_");
Path nodes = Files.createDirectories(directory.resolve("nodes"));
Path referencesKeys = Files.createDirectories(directory.resolve("references_keys"));
Path referencesValues = Files.createDirectories(directory.resolve("references_values"));
LongDataMap<Coordinate> coordinates = new LongAlignedDataDenseMap<>(new LonLatDataType(), new OnDiskMemory(nodes));
LongDataMap<List<Long>> references = new LongDataSortedMap<>(new AlignedDataList<>(new PairDataType<>(new LongDataType(), new LongDataType()), new OnDiskMemory(referencesKeys)), new DataStore<>(new LongListDataType(), new OnDiskMemory(referencesValues)));
logger.info("Importing data");
new ImportService(file, blobStore, coordinates, references, headerRepository, nodeRepository, wayRepository, relationRepository, srid).call();
logger.info("Done");
return 0;
}
use of com.baremaps.store.type.LongDataType in project baremaps by baremaps.
the class LongDataMapBenchmark method onDisk.
@Benchmark
@BenchmarkMode(Mode.SingleShotTime)
@Warmup(iterations = 2)
@Measurement(iterations = 5)
public void onDisk() throws IOException {
Path directory = Files.createTempDirectory(Paths.get("."), "benchmark_");
benchmark(new AlignedDataList<>(new LongDataType(), new OnDiskMemory(directory)), N);
}
Aggregations