Best design for Open Source Python / PostGIS prototype

Buffering bottleneck

When using ST_Buffer you can reduce the complexity of the resulting shape by adding a lower num_seg_quarter_circle option. This should reduce the amount of processing when buffering, and in subsequent operations.

From the PostGIS documentation:

enter image description here

Generally in PostGIS you will get better performance if you run queries against existing properly indexed tables. This gives you easy access to several optimisations (such as clustering). Consider processing the 1% that changes separately, and merging the two at the end.


Not thinking at all about architecture, for all Web mapping applications, you want to do as much of the processing ahead of time. This means that if you can, buffers should be pre-computed, all of your data should be in the output SRS, etc. Obviously, some data and calculations need to be dynamic.

I suggest that beyond Python, you look at MapServer and Geoserver to do the calculations and produce the output. Both of them could produce image tiles or GeoJSON output. Both applications can use PostGIS as a back end.