com.bbn.openmap.dataAccess.mapTile
Class OSMMapTileCoordinateTransform

java.lang.Object
  extended by com.bbn.openmap.dataAccess.mapTile.AbstractMapTileCoordinateTransform
      extended by com.bbn.openmap.dataAccess.mapTile.OSMMapTileCoordinateTransform
All Implemented Interfaces:
MapTileCoordinateTransform

public class OSMMapTileCoordinateTransform
extends AbstractMapTileCoordinateTransform

The implementation of TileCoordinateTransformation for OpenStreetMap tile coordinate layout.

Author:
dietrick

Field Summary
 
Fields inherited from interface com.bbn.openmap.dataAccess.mapTile.MapTileCoordinateTransform
TILE_SIZE, UVLR, UVUL
 
Constructor Summary
OSMMapTileCoordinateTransform()
           
 
Method Summary
 int[] getTileBoundsForProjection(java.awt.geom.Point2D upperLeft, java.awt.geom.Point2D lowerRight, int zoomLevel)
          Given a projection, provide the upper, lower, left and right tile coordinates that cover the projection area.
 GeoCoordTransformation getTransform(int zoomLevel)
          The coordinate transformation object used for lat/lon uv conversions.
 boolean isYDirectionUp()
           
 java.awt.geom.Point2D latLonToTileUV(java.awt.geom.Point2D latlon, int zoom, java.awt.geom.Point2D ret)
           
 LatLonPoint tileUVToLatLon(java.awt.geom.Point2D tileUV, int zoom, LatLonPoint ret)
           
 
Methods inherited from class com.bbn.openmap.dataAccess.mapTile.AbstractMapTileCoordinateTransform
getMaxZoomLevelForProj, getMinZoomLevelForProj, getScaleForZoom, getScaleForZoomAndProjection, getScalesForZoomLevels, getTileSize, getZoomLevelForProj, getZoomLevelForProj, latLonToTileUV, tileUVToLatLon
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OSMMapTileCoordinateTransform

public OSMMapTileCoordinateTransform()
Method Detail

latLonToTileUV

public java.awt.geom.Point2D latLonToTileUV(java.awt.geom.Point2D latlon,
                                            int zoom,
                                            java.awt.geom.Point2D ret)
Parameters:
latlon - a Point2D whose x component is the longitude and y component is the latitude
zoom - Tile Map Service (TMS) style zoom level (0-19 usually)
ret - LatLonPoint to fill and return, to avoid allocating return object.
Returns:
The "tile number" whose x and y components each are floating point numbers that represent the distance in number of tiles from the origin of the whole map at this zoom level. At zoom=0, the lat,lon point of 0,0 maps to 0.5,0.5 since there is only one tile at zoom level 0.

tileUVToLatLon

public LatLonPoint tileUVToLatLon(java.awt.geom.Point2D tileUV,
                                  int zoom,
                                  LatLonPoint ret)
Parameters:
tileUV - a Point2D whose x,y coordinates represent the distance in number of tiles (each 256x256) from the origin (where the origin is 90lat,-180lon)
zoom - Tile Map Service (TMS) style zoom level (0-19 usually)
ret - LatLonPoint to fill and return, to avoid allocating return object.
Returns:
a Point2D whose x coordinate is the longitude and y coordinate is the latitude

getTileBoundsForProjection

public int[] getTileBoundsForProjection(java.awt.geom.Point2D upperLeft,
                                        java.awt.geom.Point2D lowerRight,
                                        int zoomLevel)
Given a projection, provide the upper, lower, left and right tile coordinates that cover the projection area.

Parameters:
upperLeft - lat/lon coordinate of upper left corner of bounding box.
lowerRight - lat/lon coordinate of lower right corner of bounding box.
zoomLevel - zoom level of desired tiles.
Returns:
int[], in top, left, bottom and right order.

isYDirectionUp

public boolean isYDirectionUp()
Returns:
if y coordinates for tiles increase as pixel values increase.

getTransform

public GeoCoordTransformation getTransform(int zoomLevel)
Description copied from interface: MapTileCoordinateTransform
The coordinate transformation object used for lat/lon uv conversions.

Returns:
transform appropriate for a particular zoom level.


Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details