fix reading GeometryIndexed
This commit is contained in:
parent
b8ba7877c6
commit
a66692f771
1 changed files with 3 additions and 3 deletions
6
src/c3nav/mapdata/utils/cache/indexed.py
vendored
6
src/c3nav/mapdata/utils/cache/indexed.py
vendored
|
@ -10,8 +10,8 @@ class GeometryIndexed:
|
||||||
# binary format (everything little-endian):
|
# binary format (everything little-endian):
|
||||||
# 1 byte (uint8): variant id
|
# 1 byte (uint8): variant id
|
||||||
# 1 byte (uint8): resolution
|
# 1 byte (uint8): resolution
|
||||||
# 2 bytes (uint16): origin x
|
# 2 bytes (int16): origin x
|
||||||
# 2 bytes (uint16): origin y
|
# 2 bytes (int16): origin y
|
||||||
# 2 bytes (uint16): origin width
|
# 2 bytes (uint16): origin width
|
||||||
# 2 bytes (uint16): origin height
|
# 2 bytes (uint16): origin height
|
||||||
# (optional meta data, depending on subclass)
|
# (optional meta data, depending on subclass)
|
||||||
|
@ -42,7 +42,7 @@ class GeometryIndexed:
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def read(cls, f):
|
def read(cls, f):
|
||||||
variant_id, resolution, x, y, width, height = struct.unpack('<BBHHHH', f.read(10))
|
variant_id, resolution, x, y, width, height = struct.unpack('<BBhhHH', f.read(10))
|
||||||
if variant_id != cls.variant_id:
|
if variant_id != cls.variant_id:
|
||||||
raise ValueError('variant id does not match')
|
raise ValueError('variant id does not match')
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue