[GRASSLIST:8387] Re: oft: image and report in postgres

Trevor Wiens twiens at interbaun.com
Thu Sep 22 15:06:40 EDT 2005


On Thu, 22 Sep 2005 20:55:19 +0200
ivan marchesini <marchesini at unipg.it> wrote:

> Dear Users,
> I have worked on a grass-postgres system and finally I have obtained my
> geographical database...
> now each area feature in the map is connected to a record in a table
> that contains a lot of fields....
> Now I would like to insert a new field (an OID field for example) to
> store the photographic aerial snapshot of each area in the map (I will
> write a script to collect this image for each feature)
> I know that I can import the images into the OID field using the
> lo_import command but the problem is:
> 
> how can I generate a report of the obtained table which contain the
> tabular data of each area feature and also the aerial image???
> I would like to obtain a report constituted by a number of pages equal
> to the number of area features, and I would like to have in each page
> the ID of the area feature, the aream the perimeter, but overall the
> aerial image!!!!
> 
> I have tried to use OpenOffice (that I have connected to postgreSQL) and
> PGaccess to create reports containing the image field but I have hadn't
> success!!!
> 
> can you suggest me a different procedure??? or a way to solve my
> problem???
> 
> thank you very much
> 
> Ivan

I've used pyPgSQL library to access PostgreSQL from Python with good sucess. There might be an easier way to do it, but if I had this task, I would write a script to generate a LaTeX file which could then include the images. There may be a Python library in existance to help with this. For my scripting, which also included calls to R through Rpy, I did some LaTeX output through R and some written from scratch within Python. Setting it up took a bit of time, but because I had a lot of data to process it was worth it. I'm not sure of your familiarity with LaTeX but if you haven't used it before, then this probably isn't the best approach to take.

Sorry I can't be more helpful.

T
-- 
Trevor Wiens
twiens at interbaun.com

The greatest obstacle to discovery is not ignorance - it is the illusion of knowledge.
(Daniel J. Boorstin)




More information about the grass-user mailing list