I have inherited this python program and, being sort of a noob with bits and such I can't figure out what the problem is. I am getting a syntax error on the first line of the following function:
def tileKey(self, z, x, y):
zBits = z & 0xFFL
# 8bits, 256 levels. normally [0,21]
xBits = x & 0xFFFFFFFL
# 28 bits
yBits = y & 0xFFFFFFFL
# 28 bits
key = (zBits << 56) | (xBits << 28) | (yBits << 0)
# return the key value integer 720576213915009588
return key
If you're using Python 3.x, then you can't use the 'L' suffix anymore as it's no longer required and not part of the syntax:
yBits = y & 0xFFFFFFFL
Original exception was:
File "<stdin>", line 1
0xFFL
^
SyntaxError: invalid syntax
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With