Improved PostGIS-Interface JensMattke at
Fri Apr 30 16:12:18 CEST 2004


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 and 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?)

-------------- next part --------------
An HTML attachment was scrubbed...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wellknownbinary.ZIP
Type: application/zip
Size: 9487 bytes
Desc: not available
Url :

More information about the Thuban-devel mailing list

This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)