Permalink
Browse files

Speed up PostGIS layer saving by limiting the test query.

  • Loading branch information...
AJ Ashton
AJ Ashton committed May 26, 2011
1 parent de398e5 commit 09a55cc455cf05869640d06d93cfe3f49f83b8a3
Showing with 3 additions and 0 deletions.
  1. +3 −0 server/api.js
View
@@ -45,6 +45,9 @@ module.exports = function(app, settings) {
var options = req.query;
options.type = 'postgis';
try {
+ if (req.param('option') !== 'features') {
+ options.row_limit = 1;
+ }
var ds = new mapnik.Datasource(options);
} catch (e) {
return next('Datasource could not be loaded.' + e.message);

0 comments on commit 09a55cc

Please sign in to comment.