Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

todo - diff from live server #7

Closed
springmeyer opened this issue Sep 7, 2011 · 1 comment
Closed

todo - diff from live server #7

springmeyer opened this issue Sep 7, 2011 · 1 comment

Comments

@springmeyer
Copy link
Owner

Just to document for now (no action needed):

  • request for seed went over size
  • gdal crashed with async map loading
  • 16 thread pool is what I've been using
diff --git a/renderer.js b/renderer.js
index 73c8b02..279be48 100644
--- a/renderer.js
+++ b/renderer.js
@@ -5,7 +5,7 @@ var util = require('util');
 var Pool = require('./pool');

 // Increase number of threads to 1.5x the number of logical CPUs.
-var threads = require('os').cpus().length + 4;
+var threads = 16;//require('os').cpus().length + 4;
 console.warn('Using %d threads', threads);
 require('eio').setMinParallel(threads);

@@ -19,7 +19,7 @@ module.exports = function(args) {
     var maps = new Pool(function() {
         var map = new mapnik.Map(256, 256);
         map.bufferSize = args.bufferSize;
-        map.load(args.stylesheet, {
+        /*map.load(args.stylesheet, {
             strict: false,
             base: path.dirname(args.stylesheet)
         }, function(err, map) {
@@ -29,14 +29,20 @@ module.exports = function(args) {
             util.print('\rCreating map objects (' + created + '/' + args.concurrency + ')...');
             maps.release(map);
         });
+        */
+        map.loadSync(args.stylesheet);
+        map.zoomAll();
+        created++;
+        util.print('\rCreating map objects (' + created + '/' + args.concurrency + ')...');
+        maps.release(map);
     }, args.concurrency);

     return function(query, callback) {
         query.width = +query.width || 256;
         query.height = +query.height || 256;
-        if (query.width < 1 || query.width > 2048 || query.height < 1 || query.height > 2048) {
+        /*if (query.width < 1 || query.width > 2048 || query.height < 1 || query.height > 2048) {
             return callback(new Error('Invalid size: ' + query.width + '×' + query.height));
-        }
+        }*/

         var bbox = query.bbox ? query.bbox.split(',') : [];
         if (bbox.length !== 4) return callback(new Error('Invalid bbox: ' + util.inspect(bbox)));
@springmeyer
Copy link
Owner Author

stale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant