Changeset 11143 in josm for trunk


Ignore:
Timestamp:
2016-10-18T10:33:11+02:00 (3 years ago)
Author:
bastiK
Message:

remove unused code in QuadBuckets

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

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/coor/QuadTiling.java

    r10181 r11143  
    4949    }
    5050
    51     static long xy2tile(long x, long y) {
    52         long tile = 0;
    53         int i;
    54         for (i = NR_LEVELS-1; i >= 0; i--) {
    55             long xbit = (x >> i) & 1;
    56             long ybit = (y >> i) & 1;
    57             tile <<= 2;
    58             // Note that x is the MSB
    59             tile |= (xbit << 1) | ybit;
    60         }
    61         return tile;
    62     }
    63 
    6451    static long lon2x(double lon) {
    6552        long ret = (long) ((lon + 180.0) * WORLD_PARTS / 360.0);
     
    7663        }
    7764        return ret;
    78     }
    79 
    80     public static long quadTile(LatLon coor) {
    81         return xy2tile(lon2x(coor.lon()), lat2y(coor.lat()));
    82     }
    83 
    84     public static int index(int level, long quad) {
    85         long mask = 0x00000003;
    86         int totalShift = TILES_PER_LEVEL_SHIFT*(NR_LEVELS-level-1);
    87         return (int) (mask & (quad >> totalShift));
    88     }
    89 
    90     /**
    91      * Returns quad tiling index for given coordinates and level.
    92      *
    93      * @param coor coordinates
    94      * @param level level
    95      *
    96      * @return quad tiling index for given coordinates and level.
    97      * @since 2263
    98      */
    99     public static int index(LatLon coor, int level) {
    100         // The nodes that don't return coordinates will all get stuck in a single tile.
    101         // Hopefully there are not too many of them
    102         if (coor == null)
    103             return 0;
    104 
    105         return index(coor.lat(), coor.lon(), level);
    10665    }
    10766
  • trunk/src/org/openstreetmap/josm/data/osm/QuadBuckets.java

    r10901 r11143  
    501501        private QBLevel<T> currentNode;
    502502        private int contentIndex;
    503         private int iteratedOver;
    504503        QuadBuckets<T> qb;
    505504
     
    522521                currentNode = nextContentNode(qb.root);
    523522            }
    524             iteratedOver = 0;
    525523            this.qb = qb;
    526524        }
     
    554552                throw new NoSuchElementException();
    555553            contentIndex++;
    556             iteratedOver++;
    557554            return ret;
    558555        }
Note: See TracChangeset for help on using the changeset viewer.