kopia lustrzana https://github.com/onthegomap/planetiler
serving script
rodzic
adf57ade00
commit
58f57cd637
|
@ -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
|
|
@ -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);
|
||||
|
|
|
@ -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());
|
||||
});
|
||||
}
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
Ładowanie…
Reference in New Issue