We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Geo is currently unable to decode a MultiLineString that has an empty list of coordinates (although it is able to encode it):
iex(8)> Jason.decode!(~s/{"type":"MultiLineString","coordinates":[[]]}/) |> Geo.JSON.decode!() |> Geo.WKB.encode!() |> Geo.WKB.decode!() ** (FunctionClauseError) no function clause matching in anonymous fn/2 in Geo.WKB.Decoder.do_decode/4 The following arguments were given to anonymous fn/2 in Geo.WKB.Decoder.do_decode/4: # 1 1 # 2 "" (geo 3.4.2) lib/geo/wkb/decoder.ex:108: anonymous fn/2 in Geo.WKB.Decoder.do_decode/4 (elixir 1.12.3) lib/enum.ex:1710: anonymous fn/3 in Enum.map_reduce/3 (elixir 1.12.3) lib/enum.ex:3950: Enum.reduce_range/5 (elixir 1.12.3) lib/enum.ex:2389: Enum.map_reduce/3 (geo 3.4.2) lib/geo/wkb/decoder.ex:108: Geo.WKB.Decoder.do_decode/4 (geo 3.4.2) lib/geo/wkb/decoder.ex:235: anonymous fn/2 in Geo.WKB.Decoder.do_decode/4 (elixir 1.12.3) lib/enum.ex:1704: Enum."-map_reduce/3-lists^mapfoldl/2-0-"/3 (geo 3.4.2) lib/geo/wkb/decoder.ex:234: Geo.WKB.Decoder.do_decode/4 (geo 3.4.2) lib/geo/wkb.ex:82: Geo.WKB.decode!/1
The WKB that is generated is "000000000500000001000000000200000000", which appears to be valid and on an online conversion website (https://rodic.fr/blog/online-conversion-between-geometric-formats/) it decodes to {"type":"MultiLineString","coordinates":[[]]}.
"000000000500000001000000000200000000"
{"type":"MultiLineString","coordinates":[[]]}
The text was updated successfully, but these errors were encountered:
Handle MultiLineString with empty coordinates
4673657
Fixes felt#163
Successfully merging a pull request may close this issue.
Geo is currently unable to decode a MultiLineString that has an empty list of coordinates (although it is able to encode it):
The WKB that is generated is
"000000000500000001000000000200000000"
, which appears to be valid and on an online conversion website (https://rodic.fr/blog/online-conversion-between-geometric-formats/) it decodes to{"type":"MultiLineString","coordinates":[[]]}
.The text was updated successfully, but these errors were encountered: