pull/1/head
Mike Barry 2021-05-05 06:29:12 -04:00
rodzic adf57ade00
commit 58f57cd637
5 zmienionych plików z 26 dodań i 39 usunięć

Wyświetl plik

@ -0,0 +1,9 @@
#!/usr/bin/env bash
set -o errexit
set -o pipefail
set -o nounset
set -x
docker run --rm -it -v "$(git rev-parse --show-toplevel)/data":/data -p 8080:8080 \
maptiler/tileserver-gl -p 8080

Wyświetl plik

@ -39,7 +39,7 @@ public class OpenMapTilesMain {
boolean useWikidata = arguments.get("use_wikidata", "use wikidata translations", true);
Path wikidataNamesFile = arguments.file("wikidata_cache", "wikidata cache file",
Path.of("data", "sources", "wikidata_names.json"));
Path output = arguments.file("output", "mbtiles output file", Path.of("massachusetts.mbtiles"));
Path output = arguments.file("output", "mbtiles output file", Path.of("data", "massachusetts.mbtiles"));
List<String> languages = arguments.get("name_languages", "languages to use",
"en,ru,ar,zh,ja,ko,fr,de,fi,pl,es,be,br,he".split(","));
CommonParams config = CommonParams.from(arguments, osmInputFile);

Wyświetl plik

@ -1,38 +0,0 @@
package com.onthegomap.flatmap.read;
import com.graphhopper.util.StopWatch;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.LongAdder;
public class LongAddTest {
private static void time(Runnable r) {
StopWatch w = new StopWatch().start();
r.run();
System.err.println(w.stop());
}
public static void main(String[] args) {
time(() -> {
long count = 0;
for (long i = 0; i < 1_000_000_000L; i++) {
count++;
}
System.err.println(count);
});
time(() -> {
LongAdder adder = new LongAdder();
for (long i = 0; i < 1_000_000_000L; i++) {
adder.increment();
}
System.err.println(adder.longValue());
});
time(() -> {
AtomicLong adder = new AtomicLong();
for (long i = 0; i < 1_000_000_000L; i++) {
adder.incrementAndGet();
}
System.err.println(adder.longValue());
});
}
}

Wyświetl plik

@ -29,6 +29,14 @@ public class NaturalEarthReader extends Reader {
private final Connection conn;
private Path extracted;
static {
try {
Class.forName("org.sqlite.JDBC");
} catch (ClassNotFoundException e) {
throw new IllegalStateException("JDBC driver not found");
}
}
public NaturalEarthReader(Path input, Profile profile, Stats stats) {
this(input, null, profile, stats);
}

Wyświetl plik

@ -50,6 +50,14 @@ public record Mbtiles(Connection connection) implements Closeable {
.registerModules(new Jdk8Module())
.setSerializationInclusion(NON_ABSENT);
static {
try {
Class.forName("org.sqlite.JDBC");
} catch (ClassNotFoundException e) {
throw new IllegalStateException("JDBC driver not found");
}
}
public static Mbtiles newInMemoryDatabase() {
try {
return new Mbtiles(DriverManager.getConnection("jdbc:sqlite::memory:")).init();