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

expose layer-level advanced options (was: Support for layer level feature-caching option (carto syntax addition)) #705

Open
springmeyer opened this issue Sep 5, 2011 · 11 comments
Labels
Milestone

Comments

@springmeyer
Copy link
Member

Carto master recently added the ability to set additional layer properties (mapbox/carto#95). These were added using an attributes object off of the layer, but this breaks something in tilemill such that no layers show up in the UI and the mapnik XML is generated without any styles.

Also, it would be great if this option (which defaults to disabled in mapnik) could be set/enabled through the TileMill UI somehow because it can be an important performance boost if the machine has enough memory.

@willwhite
Copy link
Contributor

What are the steps to reproduce this?

@springmeyer
Copy link
Member Author

manually edit your mml adding this to one of your layers:

"attributes": {
        "cache-features": "true"
     }

In the case of the foss4g style we needed this for speedups, and after carto added support (so that it would not be ignored) we added it to the style, which continued to work great but broke tilemill until reverted: tilemill-project/foss4g-benchmark-style@ad4f50b

@willwhite
Copy link
Contributor

I have a feeling it's related to the name of the key attributes. I bet it's conflicting with backbone's attributes key on the project model objects. Can we use another name?

@springmeyer
Copy link
Member Author

check with @tmcw on the name. I'm fine with anything.

@willwhite
Copy link
Contributor

Use properties now instead of attributes. mapbox/carto@db73370

When testing I get this message. Is this expected?

### Layer properties warning: 'cache-features' is invalid, acceptable values are:
'name,srs,status,title,abstract,minzoom,maxzoom,queryable,clear-label-cache'
@springmeyer
Copy link
Member Author

yes, that is expected, it will still work but until http://trac.mapnik.org/changeset/3232 you will get a spurious warning from mapnik.

@willwhite willwhite reopened this Sep 6, 2011
@willwhite
Copy link
Contributor

We should expose these layer-level settings through the UI at some point.

@willwhite
Copy link
Contributor

We have an advanced field for Datasource options now, but it looks like we might need one for the <Layer> level too. What's the idea behind having separate <Layer> and <Datasource> elements. Can you have multiple datasources per layer?

If so, how much is that supported? Could this be the foundation for supporting joins across different types of datasources? For example, could we have a single layer that is fed by a GeoJSON file, a shapefile, and a sqlite database?

@springmeyer
Copy link
Member Author

Yes, we need one for Layers too. We also need the ability to turn layers status on and off (there is another ticket for this) and this could be accomplish with an advanced options input.

The relationship is currently one to one. A <Layer> can be seen as a datasource independent/agnostic abstraction on top of datasources. So the options of Layers control rendering behavior no matter where the data is coming from while the options passed to Datasources are specific to the plugin being used, whether shapefile, or postgis, etc.

@springmeyer
Copy link
Member Author

Anyone finding this - until this is fixed (until we add a UI to set layer properties) then the only way to accomplish this is to manually edit your project.mml adding a properties at the same level as the Datasource:

       "Datasource": {
         "file": "...."
       },
      "properties": {
        "cache-features": true
      },
@springmeyer
Copy link
Member Author

Note that all options supported at the Layer level (which are the same no matter the datasource) are available and ready to be exposed in the UI: https://github.com/mapnik/mapnik-reference/blob/c4ef3ea7608cd5a2ca806bb55686fd709ed75996/latest/reference.json#L81-L143

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 participants