bosth / plpygis

PL/Python for PostGIS

Home Page:https://vimeo.com/248099711

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NameError raised when loading a big-endian wkb

lovasoa opened this issue · comments

While working on #1, I found a bug in the existing code: https://github.com/bosth/plpygis/blob/master/plpygis/geometry.py#L194-L195

Reader should be HexReader.

This can be triggered with

Geometry("000000000100000000000000000000000000000000")

which raises

Error
Traceback (most recent call last):
...
  File ".../plpygis/plpygis/geometry.py", line 195, in _from_wkb
    reader = Reader(wkb, ">")  # big-endian reader
NameError: name 'Reader' is not defined

Maybe a static type checker should be added to this project to catch this kind of errors during development.