hypso.georeference.georef.gmaps

Module Contents

Classes

GoogleMapsLayers

Google Maps Layers Class

GoogleMapDownloader

A class which generates high resolution google maps images given a longitude, latitude and zoom level

Functions

pixel_to_latlon(px_x, px_y, tl_x, tl_y, zoom_level)

Pixel to Lat Lon

main()

Main entry point

hypso.georeference.georef.gmaps.pixel_to_latlon(px_x, px_y, tl_x, tl_y, zoom_level)

Pixel to Lat Lon

Parameters:
  • px_x – Pixel coordinates of google maps image (can be float)

  • px_y – Pixel coordinates of google maps image (can be float)

  • tl_x – tile indices of top left (noth-western) corner (must be int)

  • tl_y – tile indices of top left (noth-western) corner (must be int)

  • zoom_level – zoom level of the image (also must be int)

Returns:

lat,lon

Return type:

Tuple[float, float]

class hypso.georeference.georef.gmaps.GoogleMapsLayers

Google Maps Layers Class

ROADMAP = 'v'
TERRAIN = 'p'
ALTERED_ROADMAP = 'r'
SATELLITE = 's'
TERRAIN_ONLY = 't'
HYBRID = 'y'
class hypso.georeference.georef.gmaps.GoogleMapDownloader(lat, lng, zoom=12, layer=GoogleMapsLayers.SATELLITE)

A class which generates high resolution google maps images given a longitude, latitude and zoom level

latlon_to_tileXY()

Generates an X,Y tile coordinate based on the latitude, longitude and zoom level

Returns:

An X,Y tile coordinate

Return type:

Tuple[float, float]

generateImage(**kwargs)

Generates an image by stitching a number of google map tiles together.

Parameters:

kwargs – center_tile_x: The center tile x coordinate center_tile_y: The center tile y coordinate tile_count_x: The number of tiles wide the image should be tile_count_y: The number of tiles high the image should be

Returns:

A high-resolution Goole Map image, and the tile coordinates of the top left tile in the image.

Return type:

Tuple[PIL.Image.Image, tuple]

hypso.georeference.georef.gmaps.main()

Main entry point

Returns:

Return type:

None