{"action":"created","issue":{"url":"https://api.github.com/repos/CartoDB/carto-vl/issues/576","repository_url":"https://api.github.com/repos/CartoDB/carto-vl","labels_url":"https://api.github.com/repos/CartoDB/carto-vl/issues/576/labels{/name}","comments_url":"https://api.github.com/repos/CartoDB/carto-vl/issues/576/comments","events_url":"https://api.github.com/repos/CartoDB/carto-vl/issues/576/events","html_url":"https://github.com/CartoDB/carto-vl/issues/576","id":333335448,"node_id":"MDU6SXNzdWUzMzMzMzU0NDg=","number":576,"title":"MVT Source Metadata definition","user":{"login":"davidmanzanares","id":1692175,"node_id":"MDQ6VXNlcjE2OTIxNzU=","avatar_url":"https://avatars2.githubusercontent.com/u/1692175?v=4","gravatar_id":"","url":"https://api.github.com/users/davidmanzanares","html_url":"https://github.com/davidmanzanares","followers_url":"https://api.github.com/users/davidmanzanares/followers","following_url":"https://api.github.com/users/davidmanzanares/following{/other_user}","gists_url":"https://api.github.com/users/davidmanzanares/gists{/gist_id}","starred_url":"https://api.github.com/users/davidmanzanares/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidmanzanares/subscriptions","organizations_url":"https://api.github.com/users/davidmanzanares/orgs","repos_url":"https://api.github.com/users/davidmanzanares/repos","events_url":"https://api.github.com/users/davidmanzanares/events{/privacy}","received_events_url":"https://api.github.com/users/davidmanzanares/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"davidmanzanares","id":1692175,"node_id":"MDQ6VXNlcjE2OTIxNzU=","avatar_url":"https://avatars2.githubusercontent.com/u/1692175?v=4","gravatar_id":"","url":"https://api.github.com/users/davidmanzanares","html_url":"https://github.com/davidmanzanares","followers_url":"https://api.github.com/users/davidmanzanares/followers","following_url":"https://api.github.com/users/davidmanzanares/following{/other_user}","gists_url":"https://api.github.com/users/davidmanzanares/gists{/gist_id}","starred_url":"https://api.github.com/users/davidmanzanares/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidmanzanares/subscriptions","organizations_url":"https://api.github.com/users/davidmanzanares/orgs","repos_url":"https://api.github.com/users/davidmanzanares/repos","events_url":"https://api.github.com/users/davidmanzanares/events{/privacy}","received_events_url":"https://api.github.com/users/davidmanzanares/received_events","type":"User","site_admin":false},"assignees":[{"login":"davidmanzanares","id":1692175,"node_id":"MDQ6VXNlcjE2OTIxNzU=","avatar_url":"https://avatars2.githubusercontent.com/u/1692175?v=4","gravatar_id":"","url":"https://api.github.com/users/davidmanzanares","html_url":"https://github.com/davidmanzanares","followers_url":"https://api.github.com/users/davidmanzanares/followers","following_url":"https://api.github.com/users/davidmanzanares/following{/other_user}","gists_url":"https://api.github.com/users/davidmanzanares/gists{/gist_id}","starred_url":"https://api.github.com/users/davidmanzanares/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidmanzanares/subscriptions","organizations_url":"https://api.github.com/users/davidmanzanares/orgs","repos_url":"https://api.github.com/users/davidmanzanares/repos","events_url":"https://api.github.com/users/davidmanzanares/events{/privacy}","received_events_url":"https://api.github.com/users/davidmanzanares/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2018-06-18T16:04:54Z","updated_at":"2018-06-19T12:41:05Z","closed_at":null,"author_association":"COLLABORATOR","body":"Related to https://github.com/CartoDB/carto-vl/pull/487\r\n\r\nWe need to define a Metadata API for the new MVT source.\r\n\r\n## Metadata usage\r\n\r\nGeomType:\r\n    - used for selecting style defaults\r\n\r\nColumn types:\r\n    - Type checking on expression's _compile method\r\n\r\nMin, Avg, Max, Sum:\r\n    - Global agg expressions\r\n\r\nSample:\r\n    - Global agg (Percentile) expression\r\n\r\nCategory count:\r\n    - top() expression\r\n\r\n\r\n\r\n## Proposal\r\n\r\nGeomtype:\r\n    - autodiscovery to simplify MVT usage\r\n    - for windshaft, it's on the metadata, so we could speed up start-up time by pre-compaling the shaders before the first tile comes\r\n\r\nColumn types:\r\n    - autodiscovery to simplify MVT usage\r\n    - for windshaft, it's on the metadata, so we could speed up start-up time by pre-compaling the shaders\r\n\r\n\r\nMin,Avg,Max,Sum, Sample and Category count:\r\n    - for windshaft, it's on the metadata\r\n    - for MVT, it's optional in the metadata, if it is not present and the user tries to use these functions => Error!\r\n\r\n\r\n### Required changes\r\n\r\nThe MVT source should return the metadata once the first tile comes, layer should prepare the source to be able to produce tiles before waiting for the metadata.\r\n\r\ndecodeProperty should return string, number or undefined. When it returns other than undefined => check type, if undefined => set type on metadata\r\n\r\nAPI for Metadata:\r\n```\r\n{\r\n    properties: {\r\n        wadusProperty: {\r\n            max: 10,\r\n            min: 5,\r\n        },\r\n        wadusCatPropertyName: {\r\n            categories: {\r\n                red: {count: 100},\r\n                blue: {count: 12},\r\n                green: {count: 3},\r\n            }\r\n        },\r\n    },\r\n    sample: [\r\n        { wadusProperty: 6, wadusCatPropertyName: 'blue'},\r\n        { wadusProperty: 7, wadusCatPropertyName: 'red'},\r\n        { wadusProperty: 6, wadusCatPropertyName: 'blue'},\r\n    ]\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/CartoDB/carto-vl/issues/comments/398384663","html_url":"https://github.com/CartoDB/carto-vl/issues/576#issuecomment-398384663","issue_url":"https://api.github.com/repos/CartoDB/carto-vl/issues/576","id":398384663,"node_id":"MDEyOklzc3VlQ29tbWVudDM5ODM4NDY2Mw==","user":{"login":"davidmanzanares","id":1692175,"node_id":"MDQ6VXNlcjE2OTIxNzU=","avatar_url":"https://avatars2.githubusercontent.com/u/1692175?v=4","gravatar_id":"","url":"https://api.github.com/users/davidmanzanares","html_url":"https://github.com/davidmanzanares","followers_url":"https://api.github.com/users/davidmanzanares/followers","following_url":"https://api.github.com/users/davidmanzanares/following{/other_user}","gists_url":"https://api.github.com/users/davidmanzanares/gists{/gist_id}","starred_url":"https://api.github.com/users/davidmanzanares/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidmanzanares/subscriptions","organizations_url":"https://api.github.com/users/davidmanzanares/orgs","repos_url":"https://api.github.com/users/davidmanzanares/repos","events_url":"https://api.github.com/users/davidmanzanares/events{/privacy}","received_events_url":"https://api.github.com/users/davidmanzanares/received_events","type":"User","site_admin":false},"created_at":"2018-06-19T12:41:05Z","updated_at":"2018-06-19T12:41:05Z","author_association":"COLLABORATOR","body":"Well... I was wrong, quite wrong.\r\n\r\nTrying to autodiscover the types of the columns is a **bad idea™**. Since the MVT format doesn't provide the schema of the tile and since it doesn't provide any information for a value if it was `NULL` originally, we can try to autodiscover the types, but if the first tile contains few features and those features have `NULL` in all the values for a column we won't autodiscover that type, which will make the compilation crash.\r\n\r\nI think there is no way to overcome this limitation and that we should force the user to set the type for all the properties that the user may use.\r\n\r\ncc: @rochoa "}}
{"actor":{"display_login":"davidmanzanares"}}