I'm working on a small geographical project, and I'm having a small trouble with one thing. I have a spatial database (SpatiaLite) in which I store some geometries (it has geometry columns). Specifically - polygons. They are stored of course as BLOB objects in the database. Now I would like to query the database, retrieve this geometry object and the process it so that I can for example plot it later. The way I see it, there are two ways of doing that: either extract the raw BLOB, and then decode it somehow, or fetch its well-known text representation using the SpatiaLite AsText (Geometry) command. The result would look like:
POLYGON ((0, 5), (3, 4) ...)
Not really sure which way is better, any advice how to approach this? The implementation is done in Python 2.7.