[Git][debian-gis-team/jmapviewer][master] 4 commits: New upstream version 2.12+dfsg

Bas Couwenberg gitlab at salsa.debian.org
Mon Oct 28 04:55:11 GMT 2019



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


Commits:
bf060fb8 by Bas Couwenberg at 2019-10-28T04:43:02Z
New upstream version 2.12+dfsg
- - - - -
85c9aaa4 by Bas Couwenberg at 2019-10-28T04:43:02Z
Update upstream source from tag 'upstream/2.12+dfsg'

Update to upstream version '2.12+dfsg'
with Debian dir a31b5d35604f33815647111c119d77ba4d28d64d
- - - - -
94dca888 by Bas Couwenberg at 2019-10-28T04:43:18Z
New upstream release.

- - - - -
c7c66ab6 by Bas Couwenberg at 2019-10-28T04:44:16Z
Set distribution to unstable.

- - - - -


4 changed files:

- debian/changelog
- src/org/openstreetmap/gui/jmapviewer/JMapViewer.java
- src/org/openstreetmap/gui/jmapviewer/OsmMercator.java
- src/org/openstreetmap/gui/jmapviewer/tilesources/AbstractTMSTileSource.java


Changes:

=====================================
debian/changelog
=====================================
@@ -1,8 +1,9 @@
-jmapviewer (2.11+dfsg-2) UNRELEASED; urgency=medium
+jmapviewer (2.12+dfsg-1) unstable; urgency=medium
 
+  * New upstream release.
   * Bump Standards-Version to 4.4.1, no changes.
 
- -- Bas Couwenberg <sebastic at debian.org>  Wed, 10 Jul 2019 18:18:05 +0200
+ -- Bas Couwenberg <sebastic at debian.org>  Mon, 28 Oct 2019 05:44:05 +0100
 
 jmapviewer (2.11+dfsg-1) unstable; urgency=medium
 


=====================================
src/org/openstreetmap/gui/jmapviewer/JMapViewer.java
=====================================
@@ -55,7 +55,7 @@ public class JMapViewer extends JPanel implements TileLoaderListener {
     private static final Point[] move = {new Point(1, 0), new Point(0, 1), new Point(-1, 0), new Point(0, -1)};
 
     /** Maximum zoom level */
-    public static final int MAX_ZOOM = 22;
+    public static final int MAX_ZOOM = 24;
     /** Minimum zoom level */
     public static final int MIN_ZOOM = 0;
 


=====================================
src/org/openstreetmap/gui/jmapviewer/OsmMercator.java
=====================================
@@ -28,8 +28,8 @@ public class OsmMercator {
      */
     public static final OsmMercator MERCATOR_256 = new OsmMercator();
 
-    /** tile size of the displayed tiles */
-    private int tileSize = DEFAUL_TILE_SIZE;
+    /** tile size of the displayed tiles. Use long so all calculations will be in 64bit to properly handle zooms above 22 for 256 tile size */
+    private long tileSize = DEFAUL_TILE_SIZE;
 
     /**
      * Creates instance with default tile size of 256
@@ -56,15 +56,15 @@ public class OsmMercator {
      * @param aZoomlevel zoom level to request pixel data
      * @return number of pixels
      */
-    public int getMaxPixels(int aZoomlevel) {
+    public long getMaxPixels(int aZoomlevel) {
         return tileSize * (1 << aZoomlevel);
     }
 
-    public int falseEasting(int aZoomlevel) {
+    public long falseEasting(int aZoomlevel) {
         return getMaxPixels(aZoomlevel) / 2;
     }
 
-    public int falseNorthing(int aZoomlevel) {
+    public long falseNorthing(int aZoomlevel) {
         return -1 * getMaxPixels(aZoomlevel) / 2;
     }
 
@@ -79,7 +79,7 @@ public class OsmMercator {
      * @param zoomLevel the zoom level
      * @return the distance
      */
-    public double getDistance(int x1, int y1, int x2, int y2, int zoomLevel) {
+    public double getDistance(long x1, long y1, long x2, long y2, int zoomLevel) {
         double la1 = yToLat(y1, zoomLevel);
         double lo1 = xToLon(x1, zoomLevel);
         double la2 = yToLat(y2, zoomLevel);
@@ -129,7 +129,7 @@ public class OsmMercator {
      * @return [0..2^Zoomlevel*TILE_SIZE[
      */
     public double lonToX(double aLongitude, int aZoomlevel) {
-        int mp = getMaxPixels(aZoomlevel);
+        long mp = getMaxPixels(aZoomlevel);
         double x = (mp * (aLongitude + 180L)) / 360L;
         return Math.min(x, mp);
     }
@@ -159,7 +159,7 @@ public class OsmMercator {
             aLat = MAX_LAT;
         double sinLat = Math.sin(Math.toRadians(aLat));
         double log = Math.log((1.0 + sinLat) / (1.0 - sinLat));
-        int mp = getMaxPixels(aZoomlevel);
+        long mp = getMaxPixels(aZoomlevel);
         double y = mp * (0.5 - (log / (4.0 * Math.PI)));
         return Math.min(y, mp - 1);
     }
@@ -182,7 +182,7 @@ public class OsmMercator {
      * @param aZoomlevel zoom level
      * @return ]-180..180[
      */
-    public double xToLon(int aX, int aZoomlevel) {
+    public double xToLon(long aX, int aZoomlevel) {
         return ((360d * aX) / getMaxPixels(aZoomlevel)) - 180.0;
     }
 
@@ -194,9 +194,8 @@ public class OsmMercator {
      * @param aZoomlevel zoom level
      * @return [MIN_LAT..MAX_LAT] is about [-85..85]
      */
-    public double yToLat(int aY, int aZoomlevel) {
-        aY += falseNorthing(aZoomlevel);
-        double latitude = (Math.PI / 2) - (2 * Math.atan(Math.exp(-1.0 * aY / radius(aZoomlevel))));
+    public double yToLat(long aY, int aZoomlevel) {
+        double latitude = (Math.PI / 2) - (2 * Math.atan(Math.exp(-1.0 * (aY + falseNorthing(aZoomlevel)) / radius(aZoomlevel))));
         return -1 * Math.toDegrees(latitude);
     }
 


=====================================
src/org/openstreetmap/gui/jmapviewer/tilesources/AbstractTMSTileSource.java
=====================================
@@ -11,6 +11,7 @@ import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
 
+import org.openstreetmap.gui.jmapviewer.JMapViewer;
 import org.openstreetmap.gui.jmapviewer.OsmMercator;
 import org.openstreetmap.gui.jmapviewer.Tile;
 import org.openstreetmap.gui.jmapviewer.TileXY;
@@ -72,12 +73,12 @@ public abstract class AbstractTMSTileSource extends AbstractTileSource {
 
     @Override
     public int getMaxZoom() {
-        return 21;
+        return JMapViewer.MAX_ZOOM;
     }
 
     @Override
     public int getMinZoom() {
-        return 0;
+        return JMapViewer.MIN_ZOOM;
     }
 
     /**



View it on GitLab: https://salsa.debian.org/debian-gis-team/jmapviewer/compare/4959bfa5d2d5c85743a927da01c008a1a4694bae...c7c66ab6ed424e9b013a4c7c39be121e3891a4e6

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/jmapviewer/compare/4959bfa5d2d5c85743a927da01c008a1a4694bae...c7c66ab6ed424e9b013a4c7c39be121e3891a4e6
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/20191028/4041aa19/attachment-0001.html>


More information about the Pkg-grass-devel mailing list