Dynamically produce source tags for Esri sources

Signed-off-by: Taylor Smock <taylor.smock@kaart.com>
pull/1/head
Taylor Smock 2020-06-26 09:08:31 -06:00
rodzic ab03e83100
commit 45d424e885
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 625F6A74A3E4311A
3 zmienionych plików z 10 dodań i 1 usunięć

Wyświetl plik

@ -61,7 +61,7 @@ public class MapWithAILayerInfo {
public static final String CONFIG_PREFIX = "mapwithai.sources.";
private static final String[] DEFAULT_LAYER_SITES = {
"https://gitlab.com/gokaart/JOSM_MapWithAI/-/raw/pages/public/json/sources.json" };
"https://gokaart.gitlab.io/JOSM_MapWithAI/json/sources.json" };
/** Unique instance -- MUST be after DEFAULT_LAYER_SITES */
private static MapWithAILayerInfo instance;

Wyświetl plik

@ -152,6 +152,14 @@ public class ESRISourceReader implements Closeable {
newInfo.setAttributionText(feature.getString("accessInformation"));
}
newInfo.setDescription(feature.getString("snippet"));
if (newInfo.getSource() != null) {
StringBuilder sourceTag = new StringBuilder(newInfo.getSource());
if (!sourceTag.toString().endsWith("/")) {
sourceTag.append('/');
}
sourceTag.append(feature.getString("name", newInfo.getId()));
newInfo.setSource(sourceTag.toString());
}
return (newInfo);
}

Wyświetl plik

@ -131,6 +131,7 @@ public class MapWithAISourceReader implements Closeable {
info.setConflationParameters(values.getJsonArray("conflationParameters"));
info.setConflation(conflation);
info.setConflationUrl(conflationUrl);
info.setSource(values.getString("source", null));
info.setAlreadyConflatedKey(alreadyConflatedKey);
info.setCategory(MapWithAICategory.fromString(category));
if (values.containsKey("conflation_ignore_categories")) {