Skip to content

Instantly share code, notes, and snippets.

@simo97
Created September 5, 2021 18:12
Show Gist options
  • Save simo97/c75dd787bd8fc16fc124ae610b7a4a25 to your computer and use it in GitHub Desktop.
Save simo97/c75dd787bd8fc16fc124ae610b7a4a25 to your computer and use it in GitHub Desktop.

Revisions

  1. simo97 created this gist Sep 5, 2021.
    15 changes: 15 additions & 0 deletions is_into_square.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    def is_into_square(latMin, latMax, longMin, longMax, lat , long) -> bool:
    """
    This function check if a point(lat, long) is contained into a square (BBOX) knowing his max and min coordinates
    :param latMin: min latitude of the BBOx
    :param latMax: max latitude of the BBOx
    :param longMin: max longitude of the BBOx
    :param longMax: max longitude of the BBOx
    :param lat: the latitude of the point to verified
    :param long: the longitude of the point to be verified
    :return: bool
    """
    if long >= longMin and long <=longMax:
    if lat >= latMin and lat <= latMax:
    return True
    return False