[Git][debian-gis-team/josm][master] 3 commits: Bump minimum required jmapviewer version to 2.13.

Bas Couwenberg gitlab at salsa.debian.org
Mon Feb 17 08:51:28 GMT 2020



Bas Couwenberg pushed to branch master at Debian GIS Project / josm


Commits:
40aae855 by Bas Couwenberg at 2020-02-17T09:24:25+01:00
Bump minimum required jmapviewer version to 2.13.

- - - - -
49548ae0 by Bas Couwenberg at 2020-02-17T09:24:32+01:00
Add upstream patches for jmapviewer 2.13 support.

- - - - -
48ea879c by Bas Couwenberg at 2020-02-17T09:37:38+01:00
Set distribution to unstable.

- - - - -


7 changed files:

- debian/changelog
- debian/control
- debian/patches/series
- + debian/patches/svn-r15853.patch
- + debian/patches/svn-r15855.patch
- + debian/patches/svn-r15868.patch
- + debian/patches/svn-r15871.patch


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,10 @@
+josm (0.0.svn15806+dfsg-2) unstable; urgency=medium
+
+  * Bump minimum required jmapviewer version to 2.13.
+  * Add upstream patches for jmapviewer 2.13 support.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Mon, 17 Feb 2020 09:37:23 +0100
+
 josm (0.0.svn15806+dfsg-1) unstable; urgency=medium
 
   * New tested snapshot.


=====================================
debian/control
=====================================
@@ -11,7 +11,7 @@ Build-Depends: debhelper (>= 9~),
                ant-contrib,
                gettext,
                javacc,
-               jmapviewer (>= 2.12),
+               jmapviewer (>= 2.13),
                libcommons-compress-java,
                libcommons-logging-java,
                libgettext-ant-tasks-java,
@@ -28,7 +28,7 @@ Package: josm
 Architecture: all
 Depends: default-jre (>= 2:1.9) | java9-runtime,
          fonts-noto,
-         jmapviewer (>= 2.12),
+         jmapviewer (>= 2.13),
          libcommons-compress-java,
          libcommons-logging-java,
          libgettext-commons-java (>= 0.9.6),


=====================================
debian/patches/series
=====================================
@@ -7,3 +7,7 @@
 07-use_system_fonts.patch
 08-use_noto_font.patch
 09-no-java-8.patch
+svn-r15853.patch
+svn-r15855.patch
+svn-r15868.patch
+svn-r15871.patch


=====================================
debian/patches/svn-r15853.patch
=====================================
@@ -0,0 +1,38 @@
+Description: non-blocking warning in case of invalid TMS entries
+Bug: https://josm.openstreetmap.de/ticket/18440
+Origin: https://josm.openstreetmap.de/changeset/15853/josm
+
+--- a/src/org/openstreetmap/josm/gui/bbox/JosmMapViewer.java
++++ b/src/org/openstreetmap/josm/gui/bbox/JosmMapViewer.java
+@@ -1,8 +1,6 @@
+ // License: GPL. For details, see LICENSE file.
+ package org.openstreetmap.josm.gui.bbox;
+ 
+-import static org.openstreetmap.josm.tools.I18n.tr;
+-
+ import java.util.ArrayList;
+ import java.util.Collections;
+ import java.util.HashMap;
+@@ -26,6 +24,7 @@ import org.openstreetmap.josm.data.image
+ import org.openstreetmap.josm.data.imagery.TileLoaderFactory;
+ import org.openstreetmap.josm.data.preferences.StringProperty;
+ import org.openstreetmap.josm.gui.MainApplication;
++import org.openstreetmap.josm.gui.Notification;
+ import org.openstreetmap.josm.gui.layer.AbstractCachedTileSourceLayer;
+ import org.openstreetmap.josm.gui.layer.ImageryLayer;
+ import org.openstreetmap.josm.gui.layer.TMSLayer;
+@@ -75,11 +74,10 @@ public class JosmMapViewer extends JMapV
+                     sources.add(source);
+                 }
+             } catch (IllegalArgumentException ex) {
+-                Logging.warn(ex);
++                Logging.trace(ex);
++                Logging.warn(ex.getMessage());
+                 if (ex.getMessage() != null && !ex.getMessage().isEmpty()) {
+-                    JOptionPane.showMessageDialog(MainApplication.getMainFrame(),
+-                            ex.getMessage(), tr("Warning"),
+-                            JOptionPane.WARNING_MESSAGE);
++                    new Notification(ex.getMessage()).setIcon(JOptionPane.WARNING_MESSAGE).show();
+                 }
+             }
+         }


=====================================
debian/patches/svn-r15855.patch
=====================================
@@ -0,0 +1,75 @@
+Description: Fetch imagery API keys from JOSM website. Restore access to Maxar imagery. Requires JMapViewer 2.13
+Bug: https://josm.openstreetmap.de/ticket/18440
+Origin: https://josm.openstreetmap.de/changeset/15855/josm
+
+--- a/src/org/openstreetmap/josm/gui/MainInitialization.java
++++ b/src/org/openstreetmap/josm/gui/MainInitialization.java
+@@ -29,6 +29,7 @@ import org.openstreetmap.josm.io.FileWat
+ import org.openstreetmap.josm.io.OsmApi;
+ import org.openstreetmap.josm.io.OsmApiInitializationException;
+ import org.openstreetmap.josm.io.OsmTransferCanceledException;
++import org.openstreetmap.josm.io.imagery.ApiKeyProvider;
+ import org.openstreetmap.josm.spi.lifecycle.InitializationSequence;
+ import org.openstreetmap.josm.spi.lifecycle.InitializationTask;
+ import org.openstreetmap.josm.spi.preferences.Config;
+@@ -142,6 +143,7 @@ public class MainInitialization implemen
+         return Arrays.asList(
+             new InitializationTask(tr("Updating user interface"), () -> GuiHelper.runInEDTAndWait(() -> {
+                 // hooks for the jmapviewer component
++                FeatureAdapter.registerApiKeyAdapter(ApiKeyProvider::retrieveApiKey);
+                 FeatureAdapter.registerBrowserAdapter(OpenBrowser::displayUrl);
+                 FeatureAdapter.registerImageAdapter(ImageProvider::read);
+                 FeatureAdapter.registerTranslationAdapter(I18n::tr);
+--- /dev/null
++++ b/src/org/openstreetmap/josm/io/imagery/ApiKeyProvider.java
+@@ -0,0 +1,50 @@
++// License: GPL. For details, see LICENSE file.
++package org.openstreetmap.josm.io.imagery;
++
++import java.io.IOException;
++import java.net.HttpURLConnection;
++import java.net.URL;
++import java.util.Collections;
++import java.util.List;
++
++import org.openstreetmap.josm.data.Preferences;
++import org.openstreetmap.josm.spi.preferences.Config;
++import org.openstreetmap.josm.tools.HttpClient;
++import org.openstreetmap.josm.tools.HttpClient.Response;
++import org.openstreetmap.josm.tools.Utils;
++
++/**
++ * Provider of confidential imagery API keys.
++ * @since 15855
++ */
++public final class ApiKeyProvider {
++
++    private ApiKeyProvider() {
++        // Hide public constructor
++    }
++
++    private static List<String> getApiKeySites() {
++        return Preferences.main().getList("apikey.sites",
++                Collections.singletonList(Config.getUrls().getJOSMWebsite()+"/mapkey/"));
++    }
++
++    /**
++     * Retrieves the API key for the given imagery id.
++     * @param imageryId imagery id
++     * @return the API key for the given imagery id
++     * @throws IOException in case of I/O error
++     */
++    public static String retrieveApiKey(String imageryId) throws IOException {
++        for (String siteUrl : getApiKeySites()) {
++            Response response = HttpClient.create(new URL(siteUrl + imageryId)).connect();
++            try {
++                if (response.getResponseCode() == HttpURLConnection.HTTP_OK) {
++                    return Utils.strip(response.fetchContent());
++                }
++            } finally {
++                response.disconnect();
++            }
++        }
++        return null;
++    }
++}


=====================================
debian/patches/svn-r15868.patch
=====================================
@@ -0,0 +1,43 @@
+Description: cache API keys in memory
+Bug: https://josm.openstreetmap.de/ticket/18440
+Origin: https://josm.openstreetmap.de/changeset/15868/josm
+
+--- a/src/org/openstreetmap/josm/io/imagery/ApiKeyProvider.java
++++ b/src/org/openstreetmap/josm/io/imagery/ApiKeyProvider.java
+@@ -5,7 +5,9 @@ import java.io.IOException;
+ import java.net.HttpURLConnection;
+ import java.net.URL;
+ import java.util.Collections;
++import java.util.HashMap;
+ import java.util.List;
++import java.util.Map;
+ 
+ import org.openstreetmap.josm.data.Preferences;
+ import org.openstreetmap.josm.spi.preferences.Config;
+@@ -19,6 +21,8 @@ import org.openstreetmap.josm.tools.Util
+  */
+ public final class ApiKeyProvider {
+ 
++    private static final Map<String, String> CACHE = new HashMap<>();
++
+     private ApiKeyProvider() {
+         // Hide public constructor
+     }
+@@ -35,11 +39,16 @@ public final class ApiKeyProvider {
+      * @throws IOException in case of I/O error
+      */
+     public static String retrieveApiKey(String imageryId) throws IOException {
++        if (CACHE.containsKey(imageryId)) {
++            return CACHE.get(imageryId);
++        }
+         for (String siteUrl : getApiKeySites()) {
+             Response response = HttpClient.create(new URL(siteUrl + imageryId)).connect();
+             try {
+                 if (response.getResponseCode() == HttpURLConnection.HTTP_OK) {
+-                    return Utils.strip(response.fetchContent());
++                    String key = Utils.strip(response.fetchContent());
++                    CACHE.put(imageryId, key);
++                    return key;
+                 }
+             } finally {
+                 response.disconnect();


=====================================
debian/patches/svn-r15871.patch
=====================================
@@ -0,0 +1,30 @@
+Description: register API key provider in integration test
+Bug: https://josm.openstreetmap.de/ticket/18440
+Origin: https://josm.openstreetmap.de/changeset/15871/josm
+
+--- a/test/unit/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreferenceTestIT.java
++++ b/test/unit/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreferenceTestIT.java
+@@ -30,6 +30,7 @@ import org.junit.Test;
+ import org.junit.runner.RunWith;
+ import org.junit.runners.Parameterized.Parameters;
+ import org.openstreetmap.gui.jmapviewer.Coordinate;
++import org.openstreetmap.gui.jmapviewer.FeatureAdapter;
+ import org.openstreetmap.gui.jmapviewer.TileXY;
+ import org.openstreetmap.gui.jmapviewer.interfaces.ICoordinate;
+ import org.openstreetmap.gui.jmapviewer.tilesources.AbstractTileSource;
+@@ -56,6 +57,7 @@ import org.openstreetmap.josm.data.image
+ import org.openstreetmap.josm.data.projection.Projection;
+ import org.openstreetmap.josm.data.projection.ProjectionRegistry;
+ import org.openstreetmap.josm.data.projection.Projections;
++import org.openstreetmap.josm.io.imagery.ApiKeyProvider;
+ import org.openstreetmap.josm.io.imagery.WMSImagery.WMSGetCapabilitiesException;
+ import org.openstreetmap.josm.testutils.JOSMTestRules;
+ import org.openstreetmap.josm.testutils.ParallelParameterized;
+@@ -100,6 +102,7 @@ public class ImageryPreferenceTestIT {
+      */
+     @BeforeClass
+     public static void beforeClass() throws IOException {
++        FeatureAdapter.registerApiKeyAdapter(ApiKeyProvider::retrieveApiKey);
+         helper = new TMSCachedTileLoaderJob(null, null, new CacheAccess<>(null), new TileJobOptions(0, 0, null, 0), null);
+         errorsToIgnore.addAll(TestUtils.getIgnoredErrorMessages(ImageryPreferenceTestIT.class));
+         notIgnoredErrors.addAll(errorsToIgnore);



View it on GitLab: https://salsa.debian.org/debian-gis-team/josm/compare/27e4c26b6260b72f6addcca515aca20b0fc6a547...48ea879cd583ff34c7b22c100c3c88d50cc5d90c

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/josm/compare/27e4c26b6260b72f6addcca515aca20b0fc6a547...48ea879cd583ff34c7b22c100c3c88d50cc5d90c
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20200217/084fac88/attachment-0001.html>


More information about the Pkg-grass-devel mailing list