kopia lustrzana https://github.com/JOSM/MapWithAI
rodzic
3bca38d512
commit
cdb1889864
|
@ -68,7 +68,7 @@ public class DataConflationSender implements RunnableFuture<DataSet> {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
String url = MapWithAIConflationCategory.conflationUrlFor(category);
|
String url = MapWithAIConflationCategory.conflationUrlFor(category);
|
||||||
if (!Utils.isBlank(url) && !NetworkManager.isOffline(url)) {
|
if (!Utils.isStripEmpty(url) && !NetworkManager.isOffline(url)) {
|
||||||
this.client = HttpClient.newBuilder().connectTimeout(Duration.ofSeconds(10)).build();
|
this.client = HttpClient.newBuilder().connectTimeout(Duration.ofSeconds(10)).build();
|
||||||
try {
|
try {
|
||||||
final var form = new TreeMap<String, String>();
|
final var form = new TreeMap<String, String>();
|
||||||
|
|
|
@ -403,7 +403,7 @@ public class GetDataRunnable extends RecursiveTask<DataSet> {
|
||||||
.map(entry -> new Pair<>(Tag.ofString(entry.getKey()), Tag.ofString(entry.getValue())))
|
.map(entry -> new Pair<>(Tag.ofString(entry.getKey()), Tag.ofString(entry.getValue())))
|
||||||
.collect(Collectors.toMap(pair -> pair.a, pair -> pair.b));
|
.collect(Collectors.toMap(pair -> pair.a, pair -> pair.b));
|
||||||
MapWithAIPreferenceHelper.getReplacementTags().entrySet().stream()
|
MapWithAIPreferenceHelper.getReplacementTags().entrySet().stream()
|
||||||
.filter(entry -> !entry.getKey().equals(EQUALS) && Utils.isBlank(entry.getValue()))
|
.filter(entry -> !entry.getKey().equals(EQUALS) && Utils.isStripEmpty(entry.getValue()))
|
||||||
.map(entry -> new Tag(entry.getKey(), null)).forEach(tag -> replaceTags.put(tag, tag));
|
.map(entry -> new Tag(entry.getKey(), null)).forEach(tag -> replaceTags.put(tag, tag));
|
||||||
replaceTags(dataSet, replaceTags);
|
replaceTags(dataSet, replaceTags);
|
||||||
}
|
}
|
||||||
|
@ -417,7 +417,7 @@ public class GetDataRunnable extends RecursiveTask<DataSet> {
|
||||||
public static void replaceTags(DataSet dataSet, Map<Tag, Tag> replaceTags) {
|
public static void replaceTags(DataSet dataSet, Map<Tag, Tag> replaceTags) {
|
||||||
replaceTags.forEach((orig, replace) -> dataSet.allNonDeletedPrimitives().stream()
|
replaceTags.forEach((orig, replace) -> dataSet.allNonDeletedPrimitives().stream()
|
||||||
.filter(prim -> prim.hasTag(orig.getKey(), orig.getValue())
|
.filter(prim -> prim.hasTag(orig.getKey(), orig.getValue())
|
||||||
|| (prim.hasKey(orig.getKey()) && Utils.isBlank(orig.getValue())))
|
|| (prim.hasKey(orig.getKey()) && Utils.isStripEmpty(orig.getValue())))
|
||||||
.forEach(prim -> prim.put(replace)));
|
.forEach(prim -> prim.put(replace)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -128,7 +128,7 @@ public final class MapWithAIDataUtils {
|
||||||
realBounds.size() * urls.size());
|
realBounds.size() * urls.size());
|
||||||
for (var bound : realBounds) {
|
for (var bound : realBounds) {
|
||||||
for (var url : urls) {
|
for (var url : urls) {
|
||||||
if (url.getUrl() != null && !Utils.isBlank(url.getUrl())) {
|
if (url.getUrl() != null && !Utils.isStripEmpty(url.getUrl())) {
|
||||||
final var ds = download(monitor, bound, url, maximumDimensions);
|
final var ds = download(monitor, bound, url, maximumDimensions);
|
||||||
downloadedDataSets.add(ds);
|
downloadedDataSets.add(ds);
|
||||||
MapWithAIDataUtils.getForkJoinPool().execute(ds);
|
MapWithAIDataUtils.getForkJoinPool().execute(ds);
|
||||||
|
|
Ładowanie…
Reference in New Issue