def in_zoom(coord, range):
 zooms = search('^(\\d+)-(\\d+)$|^(\\d+)$', range)
 if (not zooms):
  raise Core.KnownUnknown(('Bad zoom range in a Sandwich Layer: %s' % repr(range)))
 (min_zoom, max_zoom, at_zoom) = zooms.groups()
 if ((min_zoom is not None) and (max_zoom is not None)):
  (min_zoom, max_zoom) = (int(min_zoom), int(max_zoom))
 elif (at_zoom is not None):
  (min_zoom, max_zoom) = (int(at_zoom), int(at_zoom))
 else:
  (min_zoom, max_zoom) = (0, float('inf'))
 return ((min_zoom <= coord.zoom) and (coord.zoom <= max_zoom))

def in_zoom ( coord , range ) : zooms = search ( '^(\\d+)-(\\d+)$|^(\\d+)$' , range ) if ( not zooms ) : raise Core . KnownUnknown ( ( 'Bad zoom range in a Sandwich Layer: %s' % repr ( range ) ) ) ( min_zoom , max_zoom , at_zoom ) = zooms . groups ( ) if ( ( min_zoom is not None ) and ( max_zoom is not None ) ) : ( min_zoom , max_zoom ) = ( int ( min_zoom ) , int ( max_zoom ) ) elif ( at_zoom is not None ) : ( min_zoom , max_zoom ) = ( int ( at_zoom ) , int ( at_zoom ) ) else : ( min_zoom , max_zoom ) = ( 0 , float ( 'inf' ) ) return ( ( min_zoom <= coord . zoom ) and ( coord . zoom <= max_zoom ) )
return true if the coordinate zoom is within the textual range .