hypso.georeference.georef.gmaps module
- class hypso.georeference.georef.gmaps.GoogleMapDownloader(lat, lng, zoom=12, layer='s')
Bases:
object
A class which generates high resolution google maps images given a longitude, latitude and zoom level
- 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[Image, tuple]
- 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]
- class hypso.georeference.georef.gmaps.GoogleMapsLayers
Bases:
object
Google Maps Layers Class
- ALTERED_ROADMAP = 'r'
- HYBRID = 'y'
- ROADMAP = 'v'
- SATELLITE = 's'
- TERRAIN = 'p'
- TERRAIN_ONLY = 't'
- hypso.georeference.georef.gmaps.main()
Main entry point
- Returns:
- Return type:
None
- 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]