-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
Add support for extended WKB encoding and PostGIS EWKB. #16
Comments
@gdey @ARolek I am looking at this ticket but I am not 100% how to accomplish this / what this ticket success looks like. If change the test case to be:
It does parse the Z if I made a [3]float type: So it seems like it is already clipping the Z cord because when I use the same test case as above with the unaltered code I get: It does leave the bytes on the reader because the data didn't fully use up the values but it "clips" them to the point that is need. I didn't try this for anything beyond point; can you point me to any examples of this Also one of the big things of EWKB is that you can set SRID, is that needed for this? Any help would be great. Thank you |
To include SRID you have to add 1 byte that encode the integer related to the SRID:
|
@gbroccolo would you be interested in implementing this? I think it would be nice to have, especially when working with PostGIS. |
@ARolek I'm pretty new with Golang, more confident with PostGIS. I can try... |
@gbroccolo your call, we're happy to help with code review if this is of interest to you. You could look at the wkb package for inspiration: https://github.com/go-spatial/geom/tree/master/encoding/wkb. On another note, we're also looking to have native PostGIS geometry decoders if you're interested in tackling those. |
@ARolek I have one question here: do you think is it better to create a dedicated package for the extended wkb? I.e. something like |
@gbroccolo I would need to look at the |
I need to look at the package. Give me a couple of days to look at it and get back to you. |
@gbroccolo I think it makes to make a dedicated package. It looks like there isn't a way to tell wether the bin is an extended or not, from the type. You have to attempt the decode. So, the user will have to know. You may want to restructure some of the internal packages for better sharing, but overall I think a dedicated package makes sense. |
Hi @gdey, thanks for the feedback! Yeah, even in other frameworks generally wkb and ewkb are defined in dedicated modules/packages. I'll start creating a |
@gdey @ARolek I added a comment related to this issue in go-spatial/tegola#449, just because I saw the two issues were related (maybe it was the wrong place). |
Here is postgis documentation on their extention to wkb to support ZM and srid values.
https://github.com/postgis/postgis/blob/2.1.0/doc/ZMSgeoms.txt
Wiki page on WKB with other consts.
https://en.wikipedia.org/wiki/Well-known_text#Well-known_binary
The text was updated successfully, but these errors were encountered: