-
Notifications
You must be signed in to change notification settings - Fork 130
Validation missing for selectors not matching layers #29
Comments
Hmm. I think this should only do anything if we can institute warnings - errors would be too harsh a judgment for something that's perfectly validating carto & potentially useful (for previewing maps, excluding layers temporarily) |
yep, warnings would be great, I agree an error would be too harsh. |
Hi there, just a quick report as I came across this today. what triggers expected observed On warnings vs errors, I wonder if errors are a more predictable response here. It wouldn't stop code being temporarily disabled via comments for example. |
So far this isn't true: Carto stylesheets are valid in grammar and properties but are not validated as in 'this stylesheet will validate this data'. Making that determination means that right now there's virtually no talking between Mapnik and Carto, and no need to load datasources in validation. Of course, this needs to change. |
I think there may be a misunderstanding (probably on my part). In my case the carto stylesheet was actually not valid in properties (there was a misspelt property) yet was passed as valid because the unmatched selector it was under does not seem to be included in the syntax validation step. Is it expected behaviour that if the selector doesn't have a corresponding Layer in the MML it's grammar/syntax is not validated? I hear what you're saying about stylesheets validating data in Mapnik - I'm really looking forwards to seeing how far carto gets integrated into Mapnik with the GSOC work. edit: code is better. This is a example MML that doesn't report any errors on render: {
"srs": "+proj=merc...",
"Stylesheet": [
{'id': "style.mss", 'data':' #non-existant-layer{bad-tag:bad_value;}'}
],
"Layer": [{
"name": "world",...
}]
} |
…rogram failure, warn when layer has no associated styles, warn when styles do not match correspondig layer selector, ref #29
We have now warnings when a layer has no associated styles and when styles do not match a corresponding layer selector. The following situation (taken from osm-carto):
generates a warning about styles not matching the layer selector #admin-low-zoom. This is because #admin-low-zoom is filtered only for zooms < 11. The warning is correct but this code is also legit. We should figure out a way if we could suppress this kind of warnings because they are likely to create some noise. |
As for the other error report: Currently rules are only validated upon serializing them to XML. I'm not sure if it is worth to change that. Edit: the added complexity is not worth it. |
…idation before serialization, ref #29
I think it does not make sense to delay 1.0 any longer because of #29 (comment). |
This works without warning or error if #foo is not a valid layer.
The text was updated successfully, but these errors were encountered: