Ignore:
Timestamp:
2017-04-03T15:00:12+02:00 (8 years ago)
Author:
bastik
Message:

see #josm7427 - add interface and class for projected coordinates; add several helper functions to TileSource interface

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/interfaces/TileSource.java

    r31573 r33207  
    99import org.openstreetmap.gui.jmapviewer.JMapViewer;
    1010import org.openstreetmap.gui.jmapviewer.Tile;
     11import org.openstreetmap.gui.jmapviewer.TileRange;
    1112import org.openstreetmap.gui.jmapviewer.TileXY;
    1213
     
    210211     */
    211212    Map<String, String> getMetadata(Map<String, List<String>> headers);
     213
     214    /**
     215     * Convert tile indeces (x/y/zoom) into projected coordinates of the tile origin.
     216     * @param x x tile index
     217     * @param y z tile index
     218     * @param zoom zoom level
     219     * @return projected coordinates of the tile origin
     220     */
     221    IProjected tileXYtoProjected(int x, int y, int zoom);
     222
     223    /**
     224     * Convert projected coordinates to tile indices.
     225     * @param p projected coordinates
     226     * @param zoom zoom level
     227     * @return corresponding tile index x/y (floating point, truncate to integer
     228     * for tile index)
     229     */
     230    TileXY projectedToTileXY(IProjected p, int zoom);
     231
     232    /**
     233     * Check if one tile is inside another tile.
     234     * @param inner the tile that is suspected to be inside the other tile
     235     * @param outer the tile that might contain the first tile
     236     * @return true if first tile is inside second tile (or both are identical),
     237     * false otherwise
     238     */
     239    boolean isInside(Tile inner, Tile outer);
     240
     241    /**
     242     * Returns a range of tiles, that cover a given tile, which is
     243     * usually at a different zoom level.
     244     *
     245     * In standard tile layout, 4 tiles cover a tile one zoom lower, 16 tiles
     246     * cover a tile 2 zoom levels below etc.
     247     * If the zoom level of the covering tiles is greater or equal, a single
     248     * tile suffices.
     249     *
     250     * @param tile the tile to cover
     251     * @param newZoom zoom level of the covering tiles
     252     * @return TileRange of all covering tiles at zoom <code>newZoom</code>
     253     */
     254    TileRange getCoveringTileRange(Tile tile, int newZoom);
     255
     256    /**
     257     * Get content reference system for this tile source.
     258     *
     259     * E.g. "EPSG:3857" for Google-Mercator.
     260     * @return code for the content reference system in use
     261     */
     262    String getServerCRS();
     263
    212264}
Note: See TracChangeset for help on using the changeset viewer.