DB2 stores the vector data in an internal format (using 4 byte Integers). 
This format is not official. Reading the data only as blob makes no sense 
because you cannot apply any operations on it. 

You have to use ST_ASBINARY if you want a WKB representation.
Other possibilities are 

ST_ASTEXT  for a WKT representation and I think there is a third one 
ST_ASGML for an XML representation. 

ST_ASBINARY is by far the fastest way, I would recommend using this. 

The plugin converts the WKB representation into a JTS geometry using the 
geotools WKBReader. 

christian 

 

 

 


Shyam Nagarajan writes: 

> Hi, 
> 
> I want to reuse the code that has been written for the DB2 Plugin for
> another tool that I am developing. 
> 
> My question is on how to read the blob data that DB2 uses to store geometry
> data. I looked through the DB2 Plugin, from what I understand ST_AsBinary is
> used to convert the geometry blob data from db2 into a WKB and then this WKB
> is converted into a JTS Geometry. 
> 
> Can you please confirm? Are there any mechanisms to read the BYTE data of
> the blob directly to convert it into a WKB representation and vice versa? 
> 
> Thanks and Regards,
> Shyam
 


------------------------------------------------------------------------------
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to