tilequeue icon indicating copy to clipboard operation
tilequeue copied to clipboard

[docs] what does simplify_start do?

Open pnorman opened this issue 8 years ago • 2 comments

tilequeue/command.py contains the python

https://github.com/tilezen/tilequeue/blob/master/tilequeue/command.py#L494-L507

        layer_datum = dict(
...
            simplify_start=layer_config.get('simplify_start', 0),
...)

I can't find any documentation on what tilequeue/tileserver does with this, or any other references of simplify_start in their code.

pnorman avatar Oct 22 '17 21:10 pnorman

Apologies for the confusion! It's added to the layer datum so that it can be used in vector-datasource to control whether to apply simplification to the geometry at a particular zoom or not.

I agree we should add a comment explaining that. Is there anything else we can do to make that bit of code easier to understand?

zerebubuth avatar Oct 23 '17 10:10 zerebubuth

I think there's two things

  • Add a comment above the section, explaining that these are being made available to the functions in the transform section of that layer in the query-config file
  • Make the idea of passing arguments to the transform functions more general

Right now the config is

layers:
  water:
    template: water.jinja2
    start_zoom: 0
    geometry_types: [Point, MultiPoint, Polygon, MultiPolygon, LineString, MultiLineString]
    simplify_before_intersect: true
    simplify_start: 9
    transform:
      - function_name
    sort: vectordatasource.sort.water
    area-inclusion-threshold: 1

Instead of simplify_start being a key under the water collection, there could be another one like

layers:
  water:
    template: water.jinja2
    ...
    transform-parameters:
      simplify_start: 9
      ...
    transform:
      - function_name

And then all of transform-parameters could get passed to the functions, instead of hardcoding vector-datasource logic into tilequeue

pnorman avatar Oct 23 '17 21:10 pnorman