panel_segmentation.utils.locateLatLonGeotiff#

panel_segmentation.utils.locateLatLonGeotiff(geotiff_file, latitude, longitude, file_name_save, pixel_resolution=300)[source]#

Locate a lat-lon coordinate in a GEOTIFF image, and then box that area and capture a PNG image of it.

Parameters:
  • geotiff_file (str) – File name of the TIF file we want to scan for a particular latitude- longitude coordinate.

  • latitude (float) – Target latitude coordinate we want to find in the TIFF file.

  • longitude (float) – Target longitude coordinate we want to find in the TIFF file.

  • file_name_save (str) – Name of the file of the image taken of the target lat-lon coordinate and its surrounding area.

  • pixel_resolution (int, default 300) – Number of pixels in the x- and y-direction of the resulting image.

Returns:

The cropped image is returned as a PIL Image Object if designated lat-lon coordinates can be located in the GEOTIFF file with the image center set as designated lat-lon. Otherwise, returns None if the input coordinates are outside the image bounds or if all regions of the image are all black pixels.

Return type:

image or None