Ignore:
Timestamp:
2011-06-07T19:05:14+02:00 (13 years ago)
Author:
bastiK
Message:

memory optimizations for Node & WayPoint (Patch by Gubaer, modified)

The field 'proj' in CachedLatLon is a waste of memory. For the 2 classes where this has the greatest impact, the cache for the projected coordinates is replaced by 2 simple double fields (east & north). On projection change, they have to be invalidated explicitly. This is handled by the DataSet & the GpxLayer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/CreateCircleAction.java

    r3083 r4126  
    153153                    double x = xc + r*Math.cos(a);
    154154                    double y = yc + r*Math.sin(a);
    155                     Node n = new Node(Main.proj.eastNorth2latlon(new EastNorth(x,y)));
     155                    Node n = new Node(Main.getProjection().eastNorth2latlon(new EastNorth(x,y)));
    156156                    wayToAdd.add(n);
    157157                    cmds.add(new AddCommand(n));
     
    245245                double x = xc + r*Math.cos(a);
    246246                double y = yc + r*Math.sin(a);
    247                 Node n = new Node(Main.proj.eastNorth2latlon(new EastNorth(x,y)));
     247                Node n = new Node(Main.getProjection().eastNorth2latlon(new EastNorth(x,y)));
    248248                wayToAdd.add(n);
    249249                cmds.add(new AddCommand(n));
Note: See TracChangeset for help on using the changeset viewer.