Merge pull request #369 from CartoDB/geojson-renderer

Geojson renderer
This commit is contained in:
Raul Ochoa 2016-02-04 19:26:41 +01:00
commit d2558197d2
9 changed files with 816 additions and 548 deletions

View File

@ -11,6 +11,7 @@ addons:
- libgif-dev
before_install:
- npm install -g npm@2
- createdb template_postgis
- psql -c "CREATE EXTENSION postgis" template_postgis

View File

@ -147,7 +147,24 @@ var config = {
// memory. If we want to enforce this behaviour we have to implement a cache eviction policy for the
// internal cache.
cacheOnTimeout: true
},
geojson: {
dbPoolParams: {
// maximum number of resources to create at any given time
size: 16,
// max milliseconds a resource can go unused before it should be destroyed
idleTimeout: 3000,
// frequency to check for idle resources
reapInterval: 1000
},
// SQL queries will be wrapped with ST_ClipByBox2D
// Returning the portion of a geometry falling within a rectangle
// It will only work if snapToGrid is enabled
clipByBox2d: false, // this requires postgis >=2.2 and geos >=3.5
}
},
http: {
timeout: 2000, // the timeout in ms for a http tile request
@ -250,7 +267,10 @@ var config = {
// whether it should intercept tile render errors an act based on them, enabled by default.
onTileErrorStrategy: true,
// whether the affected tables for a given SQL must query directly postgresql or use the SQL API
cdbQueryTablesFromPostgres: true
cdbQueryTablesFromPostgres: true,
// whether in mapconfig is available stats & metadata for each layer
layerMetadata: true
}
};

View File

@ -141,7 +141,24 @@ var config = {
// memory. If we want to enforce this behaviour we have to implement a cache eviction policy for the
// internal cache.
cacheOnTimeout: true
},
geojson: {
dbPoolParams: {
// maximum number of resources to create at any given time
size: 16,
// max milliseconds a resource can go unused before it should be destroyed
idleTimeout: 3000,
// frequency to check for idle resources
reapInterval: 1000
},
// SQL queries will be wrapped with ST_ClipByBox2D
// Returning the portion of a geometry falling within a rectangle
// It will only work if snapToGrid is enabled
clipByBox2d: false, // this requires postgis >=2.2 and geos >=3.5
}
},
http: {
timeout: 2000, // the timeout in ms for a http tile request
@ -250,7 +267,9 @@ var config = {
// whether it should intercept tile render errors an act based on them, enabled by default.
onTileErrorStrategy: true,
// whether the affected tables for a given SQL must query directly postgresql or use the SQL API
cdbQueryTablesFromPostgres: true
cdbQueryTablesFromPostgres: true,
// whether in mapconfig is available stats & metadata for each layer
layerMetadata: false
}
};

View File

@ -141,7 +141,24 @@ var config = {
// memory. If we want to enforce this behaviour we have to implement a cache eviction policy for the
// internal cache.
cacheOnTimeout: true
},
geojson: {
dbPoolParams: {
// maximum number of resources to create at any given time
size: 16,
// max milliseconds a resource can go unused before it should be destroyed
idleTimeout: 3000,
// frequency to check for idle resources
reapInterval: 1000
},
// SQL queries will be wrapped with ST_ClipByBox2D
// Returning the portion of a geometry falling within a rectangle
// It will only work if snapToGrid is enabled
clipByBox2d: false, // this requires postgis >=2.2 and geos >=3.5
}
},
http: {
timeout: 2000, // the timeout in ms for a http tile request
@ -250,7 +267,9 @@ var config = {
// whether it should intercept tile render errors an act based on them, enabled by default.
onTileErrorStrategy: true,
// whether the affected tables for a given SQL must query directly postgresql or use the SQL API
cdbQueryTablesFromPostgres: true
cdbQueryTablesFromPostgres: true,
// whether in mapconfig is available stats & metadata for each layer
layerMetadata: true
}
};

View File

@ -141,6 +141,22 @@ var config = {
// memory. If we want to enforce this behaviour we have to implement a cache eviction policy for the
// internal cache.
cacheOnTimeout: true
},
geojson: {
dbPoolParams: {
// maximum number of resources to create at any given time
size: 16,
// max milliseconds a resource can go unused before it should be destroyed
idleTimeout: 3000,
// frequency to check for idle resources
reapInterval: 1000
},
// SQL queries will be wrapped with ST_ClipByBox2D
// Returning the portion of a geometry falling within a rectangle
// It will only work if snapToGrid is enabled
clipByBox2d: false // this requires postgis >=2.2 and geos >=3.5
}
},
http: {
@ -246,7 +262,9 @@ var config = {
// whether it should intercept tile render errors an act based on them, enabled by default.
onTileErrorStrategy: true,
// whether the affected tables for a given SQL must query directly postgresql or use the SQL API
cdbQueryTablesFromPostgres: true
cdbQueryTablesFromPostgres: true,
// whether in mapconfig is available stats & metadata for each layer
layerMetadata: true
}
};

1222
npm-shrinkwrap.json generated

File diff suppressed because it is too large Load Diff

View File

@ -26,7 +26,7 @@
"node-statsd": "~0.0.7",
"underscore" : "~1.6.0",
"dot": "~1.0.2",
"windshaft": "1.7.0",
"windshaft": "1.8.2",
"step": "~0.0.6",
"queue-async": "~1.0.7",
"request": "~2.62.0",
@ -53,6 +53,6 @@
},
"engines": {
"node": ">=0.8 <0.11",
"npm": ">=1.2.1"
"npm": ">=2.14.16"
}
}

View File

@ -400,12 +400,11 @@ describe('multilayer', function() {
function jsonp_test(body) {
assert.ok(body.layergroupid);
expected_token = LayergroupToken.parse(body.layergroupid).token;
assert.deepEqual(body.metadata, {
layers: [
{ type: "mapnik", "meta":{} },
{ type: "mapnik", "meta":{} }
]
});
assert.ok(body.metadata.layers.length === 2);
assert.ok(body.metadata.layers[0].type === 'mapnik');
assert.ok(body.metadata.layers[0].meta);
assert.ok(body.metadata.layers[1].type === 'mapnik');
assert.ok(body.metadata.layers[1].meta);
didRunJsonCallback = true;
}
eval(res.body);
@ -1278,4 +1277,3 @@ describe('multilayer', function() {
});
});

View File

@ -374,4 +374,3 @@ describe('multilayer interactivity and layers order', function() {
chaosScenarios.forEach(testInteractivityLayersOrderScenario);
});