felt / geo

A collection of GIS functions for Elixir

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Does not correctly decode WKB

samsondav opened this issue · comments

commented

Here is an example WKB (this came from a MySQL Geometry type column)

"000000000101000000000000000000F03F000000000000F03F"

This online tool correctly decodes it as a point. But Geo throws an error:

Geo.WKB.decode("000000000101000000000000000000F03F000000000000F03F")
** (ArgumentError) argument error
     (stdlib) :binary.part("00F03F", 0, 8)
        (geo) lib/geo/wkb/reader.ex:16: Geo.WKB.Reader.read/2
        (geo) lib/geo/wkb.ex:202: Geo.WKB.decode/2
     (stdlib) erl_eval.erl:670: :erl_eval.do_apply/6
commented

Closing this because the WKB is invalid... it contains a 32 bit integer at the beginning representing MySQL's internal format.