#NEWLINE# def latLongGridPredicate( field , digits = 1 ) : #NEWLINE# #INDENT# '\n    Given a lat / long pair, return the grid coordinates at the\n    nearest base value.  e.g., (42.3, -5.4) returns a grid at 0.1\n    degree resolution of 0.1 degrees of latitude ~ 7km, so this is\n    effectively a 14km lat grid.  This is imprecise for longitude,\n    since 1 degree of longitude is 0km at the poles, and up to 111km\n    at the equator. But it should be reasonably precise given some\n    prior logical block (e.g., country).\n    ' #NEWLINE# if any ( field ) : #NEWLINE# #INDENT# return ( str ( [ round ( dim , digits ) for dim in field ] ) , ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return ( )