[postgis-users] WKB format

David Garnier david.garnier at etudier-online.com
Thu Jul 4 12:24:18 PDT 2002


Hello,

I'm working on this WKBReader in java, and I have some problems getting the data out of postgres. I use the following query:
select asbinary(the_geom,'NDR') as wkb , astext(the_geom) as wkt  from road_shapes limit 25
Then I do a getBytes on wkb:
  From java I got this: 303130353030303030303031303030303030303130323030303030303033303030303030373532324331353433334641353943303130354130463546323630303434343034324231313533343244464235394330334132313734443032353030343434303734354643453643353746433539433032334639344132303235303034343430

  From plsql, I got this:
0105000000010000000102000000030000007522C15433FA59C0105A0F5F2600444042B115342DFB59C03A2174D025004440745FCE6C57FC59C023F94A2025004440

I think that there is two problems: the fourth bit of the each byte is set null. That would explain why there is no values above 7.

I'm thinking that this might be related to different encoding schemes between Java and postgres.

I figured that I would just ask around before diving head first into the source code of postgis.

Best Regards,
David Garnier




More information about the postgis-users mailing list