-
Notifications
You must be signed in to change notification settings - Fork 58
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
Replace overviews by dynamic aggregation #1031
Comments
Context: Dynamic Aggregations [WIP]Chain of AdaptersAll the dynamic aggregation magic takes place in the Aggregation MapConfig Adapter that is initialized and added to de MapConfig adapters chain in the API router: adapters = [
new MapConfigNamedLayersAdapter(templateMaps, pgConnection),
new MapConfigBufferSizeAdapter(),
new SqlWrapMapConfigAdapter(),
new DataviewsWidgetsAdapter(),
new AnalysisMapConfigAdapter(analysisBackend),
new VectorMapConfigAdapter(pgConnection),
new AggregationMapConfigAdapter(pgConnection), // <<<====
new TurboCartoAdapter()
]; Aggregation AdapterThis adapters getMapConfig(user, requestMapConfig, params, context, callback) {
//...
if (!this._shouldAdapt(mapConfig, params)) {
return callback(null, requestMapConfig);
}
//...
this._adaptLayers(connection, mapConfig, requestMapConfig, context, callback);
} The _shouldAdapt (mapConfig, params) {
const { aggregation } = params;
if (aggregation === 'false') {
return false;
}
if (aggregation === 'true' || mapConfig.isAggregationMapConfig()) {
return true;
}
return false;
} The class AggregationMapConfig extends MapConfig {
//...
isAggregationMapConfig () {
return this.isVectorOnlyMapConfig() || this.hasAnyLayerAggregation();
}
isAggregationLayer (index) {
return this.isVectorOnlyMapConfig() || this.hasLayerAggregation(index);
}
//...
} The function MapConfig.prototype.isVectorLayer = function (index) {
const layer = this.getLayer(index);
const type = getType(layer.type);
const sql = this.getLayerOption(index, 'sql');
const cartocss = this.getLayerOption(index, 'cartocss');
const cartocssVersion = this.getLayerOption(index, 'cartocss_version');
return type === 'mapnik' &&
typeof sql === 'string' &&
cartocss === undefined &&
cartocssVersion === undefined;
}; The function hasLayerAggregation (index) {
const layer = this.getLayer(index);
const { aggregation } = layer.options;
return aggregation !== undefined &&
(typeof aggregation === 'object' || typeof aggregation === 'boolean');
} |
PR: #1038 |
Context: [PROJECT] Deprecate raster overviews
In order to keep current performance when dropping the overviews feature, it's desirable to activate
dynamic aggregation
also for raster tiles.The text was updated successfully, but these errors were encountered: