org.epseelon.mobimap.util
Class GeoUtil

java.lang.Object
  extended by org.epseelon.mobimap.util.GeoUtil

public class GeoUtil
extends java.lang.Object

This class offers a few utility methods related to maps and coordinate calculations

Version:
8 juin 2008, 14:45:58
Author:
sarbogast

Constructor Summary
GeoUtil()
           
 
Method Summary
static Point2D getBitmapCoordinate(double latitude, double longitude, int referenceZoomLevel, TileFactoryInfo info)
          Given a position (latitude/longitude pair) and a zoom level, return the appropriate point in pixels.
static Point2D getBitmapCoordinate(GeoPosition c, int zoomLevel, TileFactoryInfo info)
          Given a position (latitude/longitude pair) and a zoom level, return the appropriate point in pixels.
static Dimension getMapSize(int referenceZoomLevel, TileFactoryInfo info)
           
static GeoPosition getPosition(Point2D pixelCoordinate, int referenceZoomLevel, TileFactoryInfo info)
          Convert an on screen pixel coordinate and a zoom level to a geo position
static boolean isValidTile(int x, int y, int referenceZoomLevel, TileFactoryInfo info)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeoUtil

public GeoUtil()
Method Detail

getMapSize

public static Dimension getMapSize(int referenceZoomLevel,
                                   TileFactoryInfo info)
Returns:
the size of the map at the given zoom, in tiles (num tiles tall by num tiles wide)

getPosition

public static GeoPosition getPosition(Point2D pixelCoordinate,
                                      int referenceZoomLevel,
                                      TileFactoryInfo info)
Convert an on screen pixel coordinate and a zoom level to a geo position


getBitmapCoordinate

public static Point2D getBitmapCoordinate(GeoPosition c,
                                          int zoomLevel,
                                          TileFactoryInfo info)
Given a position (latitude/longitude pair) and a zoom level, return the appropriate point in pixels. The zoom level is necessary because pixel coordinates are in terms of the zoom level

Parameters:
c - A lat/lon pair
zoomLevel - the zoom level to extract the pixel coordinate for

getBitmapCoordinate

public static Point2D getBitmapCoordinate(double latitude,
                                          double longitude,
                                          int referenceZoomLevel,
                                          TileFactoryInfo info)
Given a position (latitude/longitude pair) and a zoom level, return the appropriate point in pixels. The zoom level is necessary because pixel coordinates are in terms of the zoom level

Parameters:
latitude -
longitude -
referenceZoomLevel - the zoom level to extract the pixel coordinate for

isValidTile

public static boolean isValidTile(int x,
                                  int y,
                                  int referenceZoomLevel,
                                  TileFactoryInfo info)
Returns:
true if this point in tiles is valid at this zoom level. For example, if the zoom level is 0 (zoomed all the way out, where there is only one tile), then x,y must be 0,0


Copyright © 2008 Epseelon. All Rights Reserved.