public class GoogleTileUtils extends Object
For reasons of my own longitude is treated as being between -180 and +180 and internally latitude is treated as being from -1 to +1 and then converted to a mercator projection before return.
All rectangles are sorted so the width and height are +ve
| Modifier and Type | Method and Description |
|---|---|
static BufferedImage |
getDebugTileFor(int x,
int y,
int zoom)
Returns a buffered image with the corner lat/lon,x,y and zoom level written on it.
|
static BufferedImage |
getDebugTileFor(String keyholeString)
Returns a buffered image with the corner lat/lon,keyhole id and zoom level written on it.
|
static Rectangle2D.Double |
getLatLong(int x,
int y,
int zoom)
returns a Rectangle2D with x = lon, y = lat, width=lonSpan, height=latSpan for an x,y,zoom as used by google.
|
static Rectangle2D.Double |
getLatLong(String keyholeStr)
returns a Rectangle2D with x = lon, y = lat, width=lonSpan, height=latSpan for a keyhole string.
|
static String |
getTileRef(double lon,
double lat,
int zoom)
returns a keyhole string for a longitude (x), latitude (y), and zoom.
|
static int |
getTileZoom(String keyHoleString)
returns the Google zoom level for the keyhole string.
|
static void |
main(String[] args)
Tests.
|
public static BufferedImage getDebugTileFor(String keyholeString)
keyholeString - the keyhole string to return the image for.public static BufferedImage getDebugTileFor(int x, int y, int zoom)
x - DOCUMENT ME!y - DOCUMENT ME!zoom - DOCUMENT ME!public static Rectangle2D.Double getLatLong(String keyholeStr)
keyholeStr - DOCUMENT ME!RuntimeException - DOCUMENT ME!public static Rectangle2D.Double getLatLong(int x, int y, int zoom)
x - DOCUMENT ME!y - DOCUMENT ME!zoom - DOCUMENT ME!public static String getTileRef(double lon, double lat, int zoom)
lon - DOCUMENT ME!lat - DOCUMENT ME!zoom - DOCUMENT ME!public static int getTileZoom(String keyHoleString)
keyHoleString - DOCUMENT ME!public static void main(String[] args)
args - DOCUMENT ME!Copyright © 2012–2026 cismet GmbH. All rights reserved.