{"action":"created","issue":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-js/issues/2671","repository_url":"https://api.github.com/repos/mapbox/mapbox-gl-js","labels_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/issues/2671/labels{/name}","comments_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/issues/2671/comments","events_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/issues/2671/events","html_url":"https://github.com/mapbox/mapbox-gl-js/issues/2671","id":158534338,"number":2671,"title":"Property merging or calculated values","user":{"login":"redspider","id":63004,"avatar_url":"https://avatars.githubusercontent.com/u/63004?v=3","gravatar_id":"","url":"https://api.github.com/users/redspider","html_url":"https://github.com/redspider","followers_url":"https://api.github.com/users/redspider/followers","following_url":"https://api.github.com/users/redspider/following{/other_user}","gists_url":"https://api.github.com/users/redspider/gists{/gist_id}","starred_url":"https://api.github.com/users/redspider/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/redspider/subscriptions","organizations_url":"https://api.github.com/users/redspider/orgs","repos_url":"https://api.github.com/users/redspider/repos","events_url":"https://api.github.com/users/redspider/events{/privacy}","received_events_url":"https://api.github.com/users/redspider/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-06-05T02:40:32Z","updated_at":"2016-07-31T17:25:57Z","closed_at":"2016-06-07T00:55:32Z","body":"I am rendering a heat-map, consisting of NZ meshblock shapes stored in vector tiles, and coloured based on the currently selected subset of a multi-dimension dataset. \r\n\r\n![eyj1f](https://cloud.githubusercontent.com/assets/63004/15803304/dac044ba-2b2a-11e6-91ef-6d0e8692e3ec.png)\r\n\r\nI am currently forced to do this by creating multiple layers from the tile source, each with a specific colour fill (low, medium, high etc), and then using setFilter to hide or show that particular meshblock in a given layer depending on the calculated value.\r\n\r\nThis has a number of downsides:\r\n\r\n1. It's slow, there are a large number of meshblocks and having to create a setFilter IN consisting of most of them for the lowest colour for every change in the query parameters, for every colour layer, is not quick (it works, but it's not that smooth).\r\n2. I am limited to a small number of different colours, subtle differences in shade aren't an option as it would require many layers.\r\n\r\nWith the advent of fill data styling I had hoped to be able to avoid at least number 2, but it doesn't seem to be the case. The problem is that with the geometry coming from vector tiles, but the data being loaded in separately, there appears to be no way to put the data into the features as a property, and thus no way to style it.\r\n\r\nI can see this being solved in one of (at least) two ways:\r\n\r\n1. Permit me to push a dataset into the workers and a function to calculate a property based on this dataset. This would be ideal as the dataset is not huge (so duplicate copies in workers is not an issue), but it isn't practical to put every permutation into the tiles.\r\n2. Permit me to provide a set of properties to merge with a source or layer, based on an existing property - i.e. if the property meshblock = '1029392' then add mergeset['1029392'] or similar.\r\n\r\nI am uncertain whether this is on the roadmap or whether there's an existing solution. It seems possible that the merge could be done by using `querySourceFeatures`, merging the properties then doing `setData` on a separate geoJSON source, but it seems likely that would result in needless rebuilds when zooming out.\r\n"},"comment":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-js/issues/comments/236443671","html_url":"https://github.com/mapbox/mapbox-gl-js/issues/2671#issuecomment-236443671","issue_url":"https://api.github.com/repos/mapbox/mapbox-gl-js/issues/2671","id":236443671,"user":{"login":"bmenant","id":756887,"avatar_url":"https://avatars.githubusercontent.com/u/756887?v=3","gravatar_id":"","url":"https://api.github.com/users/bmenant","html_url":"https://github.com/bmenant","followers_url":"https://api.github.com/users/bmenant/followers","following_url":"https://api.github.com/users/bmenant/following{/other_user}","gists_url":"https://api.github.com/users/bmenant/gists{/gist_id}","starred_url":"https://api.github.com/users/bmenant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmenant/subscriptions","organizations_url":"https://api.github.com/users/bmenant/orgs","repos_url":"https://api.github.com/users/bmenant/repos","events_url":"https://api.github.com/users/bmenant/events{/privacy}","received_events_url":"https://api.github.com/users/bmenant/received_events","type":"User","site_admin":false},"created_at":"2016-07-31T17:25:57Z","updated_at":"2016-07-31T17:25:57Z","body":"I can’t agree more with @andrewharvey \r\n> Although this ticket is about client generated slices of multidimensional datasets (where the properties aren't baked into the vector tiles), it's exactly the same issue of styling using realtime/sensor data\r\n\r\nFor instance, in my case, data properties of the GeoJSON take 5% of the whole file. Geometries change once upon a year, while metadata change every day. Therefore, reprocessing a new vectorTile source because few properties changed is totally inefficient. Not to mention the extra-work and skills needed to deploy and automate the backend stack able to process reasonable amount of geo-data.\r\n\r\nAs @redspider I’m looking forward to see a viable solution raising from Mapbox’s talented team."}}
{"actor":{"display_login":"bmenant"}}