preProcessingData function

auxiliary function to pre-process data per geographical location