Created
September 5, 2021 18:12
-
-
Save simo97/c75dd787bd8fc16fc124ae610b7a4a25 to your computer and use it in GitHub Desktop.
Check if a point(lat, long) is contained into a square (BBOX) knowing his max and min coordinates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment