Tuesday, 5 October 2021

How can I create grid of coordinates from a center point in python?

Is there a method to extract a grid of coordinates (purple dots) from a center coordinate, with a 100 meters distance between each coordinate for example?

enter image description here

For example having an input of latitude and longitude center coordinate (red dot):

lat = 40.8264859
lon = -3.6805897

In a function that then returns you a list of lists or array with the corresponding lat,lon grid with 100 meters from each other, and a max number of coordinates away from the center point (in this image case that value would be 2). For example:

def get_grid_of_coordinates_from_center(lat, lon, meters_between_coor, coors_away_from_center):
    ...
    return list_of_lists


from How can I create grid of coordinates from a center point in python?

No comments:

Post a Comment