Changeset 9124 in josm for trunk/src/org/openstreetmap/josm/data
- Timestamp:
- 2015-12-14T23:18:24+01:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data/projection
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/projection/CustomProjection.java
r9106 r9124 588 588 public Bounds getWorldBoundsLatLon() { 589 589 if (bounds != null) return bounds; 590 return new Bounds( 591 new LatLon(-90.0, -180.0), 592 new LatLon(90.0, 180.0)); 590 Bounds ab = proj.getAlgorithmBounds(); 591 if (ab != null) { 592 double minlon = Math.max(ab.getMinLon() + lon0 + pm, -180); 593 double maxlon = Math.min(ab.getMaxLon() + lon0 + pm, 180); 594 return new Bounds(ab.getMinLat(), minlon, ab.getMaxLat(), maxlon, false); 595 } else { 596 return new Bounds( 597 new LatLon(-90.0, -180.0), 598 new LatLon(90.0, 180.0)); 599 } 593 600 } 594 601 -
trunk/src/org/openstreetmap/josm/data/projection/proj/DoubleStereographic.java
r9108 r9124 16 16 import static org.openstreetmap.josm.tools.I18n.tr; 17 17 18 import org.openstreetmap.josm.data.Bounds; 18 19 import org.openstreetmap.josm.data.projection.Ellipsoid; 19 20 import org.openstreetmap.josm.data.projection.ProjectionConfigurationException; … … 28 29 * Sec. 1.3.7.1 Oblique and Equatorial Stereographic, http://www.epsg.org/GuidanceNotes 29 30 */ 30 31 31 public class DoubleStereographic implements Proj { 32 32 … … 109 109 return new double[] {phi, lambda}; 110 110 } 111 112 @Override 113 public Bounds getAlgorithmBounds() { 114 return new Bounds(-89, -87, 89, 87, false); 115 } 111 116 } -
trunk/src/org/openstreetmap/josm/data/projection/proj/LambertConformalConic.java
r9116 r9124 15 15 import static org.openstreetmap.josm.tools.I18n.tr; 16 16 17 import org.openstreetmap.josm.data.Bounds; 17 18 import org.openstreetmap.josm.data.projection.CustomProjection.Param; 18 19 import org.openstreetmap.josm.data.projection.Ellipsoid; … … 177 178 return params; 178 179 } 180 181 @Override 182 public Bounds getAlgorithmBounds() { 183 double lat; 184 if (params instanceof Parameters2SP) { 185 Parameters2SP p2p = (Parameters2SP) params; 186 lat = (p2p.standardParallel1 + p2p.standardParallel2) / 2; 187 } else { 188 lat = params.latitudeOrigin; 189 } 190 double minlat = Math.max(lat - 60, -89); 191 double maxlat = Math.min(lat + 60, 89); 192 return new Bounds(minlat, -85, maxlat, 85, false); 193 } 179 194 } -
trunk/src/org/openstreetmap/josm/data/projection/proj/LonLat.java
r8444 r9124 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import org.openstreetmap.josm.data.Bounds; 6 7 import org.openstreetmap.josm.data.projection.ProjectionConfigurationException; 7 8 … … 37 38 return new double[] {Math.toRadians(north * a), Math.toRadians(east * a)}; 38 39 } 40 41 @Override 42 public Bounds getAlgorithmBounds() { 43 return new Bounds(-90, -180, 90, 180, false); 44 } 39 45 } -
trunk/src/org/openstreetmap/josm/data/projection/proj/Mercator.java
r8444 r9124 9 9 import static org.openstreetmap.josm.tools.I18n.tr; 10 10 11 import org.openstreetmap.josm.data.Bounds; 11 12 import org.openstreetmap.josm.data.projection.ProjectionConfigurationException; 12 13 … … 39 40 return new double[] {atan(sinh(north)), east}; 40 41 } 42 43 @Override 44 public Bounds getAlgorithmBounds() { 45 return new Bounds(-89, -180, 89, 180, false); 46 } 41 47 } -
trunk/src/org/openstreetmap/josm/data/projection/proj/Proj.java
r8568 r9124 2 2 package org.openstreetmap.josm.data.projection.proj; 3 3 4 import org.openstreetmap.josm.data.Bounds; 4 5 import org.openstreetmap.josm.data.projection.ProjectionConfigurationException; 5 6 … … 64 65 */ 65 66 double[] invproject(double east, double north); 67 68 /** 69 * Return the bounds where this projection is applicable. 70 * 71 * This is a fallback for when the projection bounds are not specified 72 * explicitly. 73 * 74 * In this area, the round trip lat/lon -> east/north -> lat/lon should 75 * return the starting value with small error. In addition, regions with 76 * extreme distortions should be excluded, if possible. 77 * 78 * It need not be the absolute maximum, but rather an area that is safe to 79 * display in JOSM and contain everything that one would expect to use. 80 * 81 * @return the bounds where this projection is applicable, null if unknown 82 */ 83 Bounds getAlgorithmBounds(); 66 84 } -
trunk/src/org/openstreetmap/josm/data/projection/proj/SwissObliqueMercator.java
r8540 r9124 17 17 import static org.openstreetmap.josm.tools.I18n.tr; 18 18 19 import org.openstreetmap.josm.data.Bounds; 19 20 import org.openstreetmap.josm.data.projection.Ellipsoid; 20 21 import org.openstreetmap.josm.data.projection.ProjectionConfigurationException; … … 75 76 @Override 76 77 public double[] project(double phi, double lambda) { 77 78 78 double S = alpha * log(tan(PI / 4 + phi / 2)) - alpha * ellps.e / 2 79 79 * log((1 + ellps.e * sin(phi)) / (1 - ellps.e * sin(phi))) + k; … … 115 115 return new double[] {phi, lambda}; 116 116 } 117 118 @Override 119 public Bounds getAlgorithmBounds() { 120 return new Bounds(-85, -179, 85, 179, false); 121 } 117 122 } -
trunk/src/org/openstreetmap/josm/data/projection/proj/TransverseMercator.java
r9117 r9124 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import org.openstreetmap.josm.data.Bounds; 6 7 import org.openstreetmap.josm.data.projection.ProjectionConfigurationException; 7 8 … … 181 182 return new double[] {y, x}; 182 183 } 184 185 @Override 186 public Bounds getAlgorithmBounds() { 187 return new Bounds(-90, -10, 90, 10, false); 188 } 183 189 }
Note:
See TracChangeset
for help on using the changeset viewer.