lat_long_binning
lat_long_binning(
latitude,
longitude,
grid_size_latitude=0.01,
grid_size_longitude=0.01,
)
A function that is used to bin latitude and longitude into different groups
Parameters
| latitude |
float |
Latitude in degrees (-90 to 90) |
required |
| longitude |
float |
Longitude in degrees (-180 to 180) |
required |
| grid_size_latitude |
float |
Grid size of latitude in degrees |
0.01 |
| grid_size_longitude |
float |
Grid size of longitude in degrees |
0.01 |
Returns
|
str |
Identifier of the binned latitude–longitude grid cell |
Raises
|
TypeError |
If latitude, longitude, grid_size_latitude, or grid_size_longitude are not numeric. |
|
ValueError |
If latitude is outside [-90, 90], longitude is outside [-180, 180], or if either grid size is less than or equal to 0. |
Examples
>>> lat_long_binning(49.2593, -123.2475)
'49.25_-123.25'