Changeset 12375 in josm for trunk/src/org


Ignore:
Timestamp:
2017-06-09T21:37:52+02:00 (7 years ago)
Author:
michael2402
Message:

Document the data.coor package

Location:
trunk/src/org/openstreetmap/josm/data/coor
Files:
3 edited

Legend:

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

    r12093 r12375  
    22package org.openstreetmap.josm.data.coor;
    33
     4import org.openstreetmap.gui.jmapviewer.JMapViewer;
    45import org.openstreetmap.gui.jmapviewer.Projected;
    56import org.openstreetmap.gui.jmapviewer.interfaces.IProjected;
     
    1617    private static final long serialVersionUID = 1L;
    1718
     19    /**
     20     * A zero constant
     21     */
    1822    public static final EastNorth ZERO = new EastNorth(0, 0);
    1923
     
    184188    }
    185189
     190    /**
     191     * Converts this to a {@link IProjected} instance to be used in the {@link JMapViewer}
     192     * @return The projected
     193     */
    186194    public IProjected toProjected() {
    187195        return new Projected(east(), north());
  • trunk/src/org/openstreetmap/josm/data/coor/LatLon.java

    r12163 r12375  
    5252     */
    5353    public static final double MAX_SERVER_PRECISION = 1e-7;
     54    /**
     55     * The inverse of the server precision
     56     * @see #MAX_SERVER_PRECISION
     57     */
    5458    public static final double MAX_SERVER_INV_PRECISION = 1e7;
    5559
     
    7074    private static DecimalFormat cDmMinuteFormatter = new DecimalFormat(
    7175            Main.pref == null ? "00.000" : Main.pref.get("latlon.dm.decimal-format", "00.000"));
     76    /**
     77     * The normal number format for server precision coordinates
     78     */
    7279    public static final DecimalFormat cDdFormatter;
     80    /**
     81     * The number format used for high precision coordinates
     82     */
    7383    public static final DecimalFormat cDdHighPecisionFormatter;
    7484    static {
  • trunk/src/org/openstreetmap/josm/data/coor/QuadTiling.java

    r11237 r12375  
    44import org.openstreetmap.josm.tools.Utils;
    55
     6/**
     7 * This class helps in tiling the world into multiple quad tiles.
     8 */
    69public final class QuadTiling {
    710
     
    1013    }
    1114
     15    /**
     16     * The maximum number of levels to split the quads
     17     */
    1218    public static final int NR_LEVELS = 24;
     19    /**
     20     * The number of parts the world is split into in each direction
     21     */
    1322    public static final double WORLD_PARTS = 1 << NR_LEVELS;
    1423
     24    /**
     25     * The log(2) of how many tiles there are per level
     26     */
    1527    public static final int TILES_PER_LEVEL_SHIFT = 2; // Has to be 2. Other parts of QuadBuckets code rely on it
     28    /**
     29     * How many tiles there are per level
     30     */
    1631    public static final int TILES_PER_LEVEL = 1 << TILES_PER_LEVEL_SHIFT;
     32    /**
     33     * The size of the world in X direction
     34     */
    1735    public static final int X_PARTS = 360;
     36    /**
     37     * The offset of the world in x direction
     38     */
    1839    public static final int X_BIAS = -180;
    1940
     41    /**
     42     * The size of the world in y direction
     43     */
    2044    public static final int Y_PARTS = 180;
     45    /**
     46     * The offset of the world in y direction
     47     */
    2148    public static final int Y_BIAS = -90;
    2249
     50    /**
     51     * Converts a tile index to a lat/lon position
     52     * @param quad The tile to convert
     53     * @return The lat/lon position of that tile
     54     */
    2355    public static LatLon tile2LatLon(long quad) {
    2456        // The world is divided up into X_PARTS,Y_PARTS.
Note: See TracChangeset for help on using the changeset viewer.