Ignore:
Timestamp:
2016-01-12T17:39:45+01:00 (10 years ago)
Author:
bastiK
Message:

add Albers Equal Area Projection and Polar Stereographic Projection (see #12186)
(imports pieces of code from the Geotools project)

Location:
trunk/src/org/openstreetmap/josm/gui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java

    r9408 r9419  
    311311    }
    312312
     313    public ProjectionBounds getProjectionBounds(Rectangle r) {
     314        EastNorth p1 = getEastNorth(r.x, r.y);
     315        EastNorth p2 = getEastNorth(r.x + r.width, r.y + r.height);
     316        ProjectionBounds pb = new ProjectionBounds(p1);
     317        pb.extend(p2);
     318        return pb;
     319    }
     320   
    313321    /**
    314322     * @param r rectangle
     
    316324     */
    317325    public Bounds getLatLonBounds(Rectangle r) {
    318         // TODO Maybe this should be (optional) method of Projection implementation
    319         EastNorth p1 = getEastNorth(r.x, r.y);
    320         EastNorth p2 = getEastNorth(r.x + r.width, r.y + r.height);
    321 
    322         Bounds result = new Bounds(Main.getProjection().eastNorth2latlon(p1));
    323 
    324         double eastMin = Math.min(p1.east(), p2.east());
    325         double eastMax = Math.max(p1.east(), p2.east());
    326         double northMin = Math.min(p1.north(), p2.north());
    327         double northMax = Math.max(p1.north(), p2.north());
    328         double deltaEast = (eastMax - eastMin) / 10;
    329         double deltaNorth = (northMax - northMin) / 10;
    330 
    331         for (int i = 0; i < 10; i++) {
    332             result.extend(Main.getProjection().eastNorth2latlon(new EastNorth(eastMin + i * deltaEast, northMin)));
    333             result.extend(Main.getProjection().eastNorth2latlon(new EastNorth(eastMin + i * deltaEast, northMax)));
    334             result.extend(Main.getProjection().eastNorth2latlon(new EastNorth(eastMin, northMin  + i * deltaNorth)));
    335             result.extend(Main.getProjection().eastNorth2latlon(new EastNorth(eastMax, northMin  + i * deltaNorth)));
    336         }
    337 
    338         return result;
     326        return Main.getProjection().getLatLonBoundsBox(getProjectionBounds(r));
    339327    }
    340328
  • trunk/src/org/openstreetmap/josm/gui/util/HighlightHelper.java

    r8929 r9419  
    1414
    1515/**
    16  * This class stores the set of highlited primitives and
    17  * allows easy and fast change of highlighting
     16 * This class stores the set of highlighted primitives and
     17 * allows easy and fast change of highlighting.
    1818 */
    1919public class HighlightHelper {
Note: See TracChangeset for help on using the changeset viewer.