aydink / pymgrs

Pure Python MGRS coordinate converter.
MIT License
14 stars 7 forks source link

Python 3 compatiblity #3

Closed steven266 closed 4 years ago

steven266 commented 4 years ago

Hi there,

first of all, thank you for implementing MGRS in Python 👍🏿

I stumbled upon two errors while working with Python 3:

First was the mix of indentation where I got a "TabError: inconsistent use of tabs and spaces in indentation". I changed the indentation to 4 spaces.

Next was caused by the handling of division in Python 3. The following line will result in a float instead of int: sep = remainder / 2

This will cause the array indexes to be of type float instead of int. As I am not aware of the algorithm behind MGRS, I casted the array indexes to int. Maybe it is sufficient to cast the line mentioned above to an int.

Please feel free to merge my pull request :-)

Best regards, Steven