panel_segmentation.utils.generateSatelliteImageryGrid#
- panel_segmentation.utils.generateSatelliteImageryGrid(northwest_latitude, northwest_longitude, southeast_latitude, southeast_longitude, google_maps_api_key, file_save_folder, zoom_level=18, lat_lon_distance=0.00145, number_allowed_images_taken=6000)[source]#
Take satellite images via the Google Maps API in a grid fashion for a large area, and save the associated images to a folder. The associated images can then be used to feed into different models to assess a larger area.
- Please note rates for running the Google Maps API here:
https://developers.google.com/maps/billing-and-pricing/pricing
- Parameters:
northwest_latitude (float) – Latitude coordinate on the northwest corner of the area we wish to scan.
northwest_longitude (float) – Longitude coordinate on the northwest corner of the area we wish to scan.
southeast_latitude (float) – Latitude coordinate on the southeast corner of the area we wish to scan.
southeast_longitude (float) – Longitude coordinate on the southeast corner of the area we wish to scan.
google_maps_api_key (str) – API key for Google Maps API
file_save_folder (str) – Folder path for which to save all of the images
zoom_level (int, default 18) – Zoom level of the image.
lat_lon_distance (float, default 0.00145) – Distance to traverse between images, in terms of lat-long degree distance. For example, default distance of 0.00145 degrees equates to approx. 161 meters.
number_allowed_images_taken (int, default 6000) – Number of allowed images for the Google Maps API to take before stopping. If we pull too many images in one go, google may flag this as webscraping so it’s advised to not pull too many images at once.
- Returns:
grid_location_list – A list of dictionaries with metadata information about each grid location in the image with the keys “file_name”, “latitude”, “longitude”, “grid_x”, and “grid_y”.
- Return type:
list of dictionaries