Improved PostGIS-Interface

JensMattke at aol.com JensMattke at aol.com
Fri Apr 30 16:12:18 CEST 2004


Hi.

Some time ago, I complained about the speed of the postGIS-Inteface.
I also suggested to keep the data persistent for a session - this suggestion 
was postpone to a later date.

Unsatisfied with that, I thougth about a possibility to, at least, increase 
the speed of querying spatial data. I found thuban was using the 
'astext()'-function of postGIS to read the shapes.
Next, I compared this possibility with reading the shapes with binary cursor 
from the database. (This was in Java and JDBC, because I'm much more familiar 
with it) It happend to be more than 30 times faster.

So I decided to rewrite the postgisdb.py and wellknowntext.py files using a 
binary cursor. Unfortunately, it seems to me as if psycopg is unable to read 
'normal data' (integer, double, text...) as a binary cursor. Trying that, always 
killed the python-interpreter. So there are now two queries for one old 
query. One for the shapeid-data like 'gid' and stuff, and one for the shapes.
I have to confess, it did only increase speed by the factor three to four. 
Thuban needed 226 secs for 91.000 shapes with the old version and 69 secs with 
my versions. (Yes, I always cleared the query-buffer of postgreSQL)

Though this still isn't fast enough for my purpose, I thought perhaps you 
would like to see it.

Happy May Day! (Klingt das nicht komisch?)

Jens
-------------- nächster Teil --------------
Ein Dateianhang mit HTML-Daten wurde geschreddert...
URL: http://intevation.de/pipermail/thuban-devel/attachments/20040430/bb059d31/attachment.html
-------------- nächster Teil --------------
Ein Dateianhang mit Binärdaten wurde geschreddert...
Dateiname   : wellknownbinary.ZIP
Dateityp    : application/zip
Dateigröße  : 9487 bytes
Beschreibung: nicht verfügbar
URL         : http://intevation.de/pipermail/thuban-devel/attachments/20040430/bb059d31/wellknownbinary.zip


More information about the Thuban-devel mailing list