geo_in_rectangle: extract data validation code