Ignore:
Timestamp:
2009-07-03T12:33:32+02:00 (15 years ago)
Author:
stoecker
Message:

Large rework in projection handling - now allows only switching and more specific projections
TODO:

  • allow subprojections (i.e. settings for projections)
  • setup preferences for subprojections
  • better support of the new projection depending world bounds (how to handle valid data outside of world)
  • do not allow to zoom out of the world - zoom should stop when whole world is displayed
  • fix Lambert and SwissGrid to handle new OutOfWorld style and subprojections
  • fix new UTM projection
  • handle layers with fixed projection on projection change
  • allow easier projection switching (e.g. in menu)

NOTE:
This checkin very likely will cause problems. Please report or fix them. Older plugins may have trouble. The SVN plugins
have been fixed but may have problems nevertheless. This is a BIG change, but will make JOSMs internal structure much cleaner
and reduce lots of projection related problems.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/projection/LambertEST.java

    r1309 r1722  
    99import org.openstreetmap.josm.data.coor.EastNorth;
    1010import org.openstreetmap.josm.data.coor.LatLon;
     11import org.openstreetmap.josm.data.Bounds;
     12import org.openstreetmap.josm.data.ProjectionBounds;
    1113
    1214public class LambertEST implements Projection {
     
    105107    }
    106108
    107     public double scaleFactor() {
    108         return 1.0 / 360;
    109     }
    110 
    111109    @Override
    112110    public boolean equals(Object o) {
     
    114112    }
    115113
    116     @Override
    117     public int hashCode() {
    118         return LambertEST.class.hashCode();
     114    public ProjectionBounds getWorldBounds()
     115    {
     116        Bounds b = getWorldBoundsLatLon();
     117        return new ProjectionBounds(latlon2eastNorth(b.min), latlon2eastNorth(b.max));
     118    }
     119
     120    public Bounds getWorldBoundsLatLon()
     121    {
     122        return new Bounds(
     123        new LatLon(-90.0, -180.0),
     124        new LatLon(90.0, 180.0));
    119125    }
    120126}
Note: See TracChangeset for help on using the changeset viewer.