Utilities#

class geoutils.measure_distance(ds, SCL_val, lon, lat, plot=True)[source]#

Function to calculate the distance from a specified longitude and latitude to the scene classification specified. The scene classification is taken from the first index on the Sentinel-2 SCL band in the fused result. The function returns the distance in meters, and plots the distance in a circle around the specified location.

To use this function, you must pass a Sentinel-2 dataset with the SCL band already fused. Please ensure that clouds are minimal or nonexistant, as that can impact the location of the scene classificaitons in the SCL band.

Parameters
  • ds (xr.Dataset) – Dataset to measure

  • SCL_val (int) – Sentinel SCL band number representing classification to measure distance to

  • lon (float) – Longitude of point of interest to measure from

  • lat (float) – Latitude of point of interest to measure from

  • plot (bool, optional) – Plot figure of distance measure

    Default: True

Return type

float

Returns

Minimum distance from point of interest to the specified classification