Python functions on geographical coordinates