N.Y. Public Officers Law § 30
4. Neither the provisions of this section, nor of any general, special or local law, charter, code, ordinance, resolution, rule or regulation, creating a vacancy in a local office of a political subdivision or municipal corporation if the incumbent thereof ceases to be a resident of such political subdivision or municipal corporation, shall apply in the case of a person who is a member of the police force of any political subdivision or municipal corporation of the state and who while a member of such force resides (a) in the county in which such political subdivision or municipal corporation is located; or (b) in a county within the state contiguous to the county in which such political subdivision or municipal corporation is located; or (c) in a county within the state contiguous to such political subdivision or municipal corporation; or (d) in a county within the state contiguous to a county described in item (c) hereof where the former is less than fifteen miles from such political subdivision or municipal corporation, measured from their respective nearest boundary lines; or (e) in a county within the state contiguous to a county described in item (d) hereof where the former is less than thirty miles from such political subdivision or municipal corporation, measured from their respective nearest boundary lines: