def latlon_round(latlon, spacing=1000):
 g = latlon_to_grid(latlon)
 g.easting = ((g.easting // spacing) * spacing)
 g.northing = ((g.northing // spacing) * spacing)
 return g.latlon()

def latlon_round ( latlon , spacing = 1000 ) : g = latlon_to_grid ( latlon ) g . easting = ( ( g . easting // spacing ) * spacing ) g . northing = ( ( g . northing // spacing ) * spacing ) return g . latlon ( )
round to nearest grid corner .