how can i store my coordinates in wkb.. i want to know its implementation of wkb and wkt in db .. any one can please guide me.
For example, a WKB value that corresponds to POINT(1 1) consists of this sequence of 21 bytes (each represented here by two hex digits):
The sequence may be broken down into these components:
Byte order : 01 WKB type : 01000000 X : 000000000000F03F Y : 000000000000F03F
Two notes about Well-Known Binary (WKB):
- If you are using a spatial enabled database, it will likely be able to perform conversions from Well-Known Text to WKB. For instance, in PostGIS this can by done with something like this: "SELECT encode(ST_AsBinary(ST_GeomFromText('POINT(1 1)', -1)), 'hex');" (-1 means no projection system)
- As Mapperz said in his response, WKB has a byte indicating the byte order storage. The WKB representation of a geometry is system endianness dependent. Thus, any geometry will have two possible WKB representations depending on system endianness.