Skip to content
New issue

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

Can't parse subarray of buffer #34

Open
twastvedt opened this issue Jun 4, 2020 · 0 comments
Open

Can't parse subarray of buffer #34

twastvedt opened this issue Jun 4, 2020 · 0 comments

Comments

@twastvedt
Copy link

MySQL stores geometry with a 4 byte SRID prefix before the WKB (doc). I guess the format is different than PostGIS's EWKB though, as parsing the whole field doesn't produce valid results. Skipping the first for bytes works though, like this:

GeometryParser.parse(Buffer.from(buffer.subarray(4)))

but using just the output from subarray:

GeometryParser.parse(buffer.subarray(4))

produces this error: Uncaught Error: first argument must be a string or Buffer. According to Node, subarray() just creates a new buffer pointing to a subset of the same data. Would be nice to not have to duplicate the data in order to parse it. Fairly minor, I admit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant