{"action":"closed","issue":{"url":"https://api.github.com/repos/mapnik/node-mapnik/issues/600","repository_url":"https://api.github.com/repos/mapnik/node-mapnik","labels_url":"https://api.github.com/repos/mapnik/node-mapnik/issues/600/labels{/name}","comments_url":"https://api.github.com/repos/mapnik/node-mapnik/issues/600/comments","events_url":"https://api.github.com/repos/mapnik/node-mapnik/issues/600/events","html_url":"https://github.com/mapnik/node-mapnik/issues/600","id":135025726,"number":600,"title":"Raster-scaling causes Floating point exception","user":{"login":"averas","id":1205805,"avatar_url":"https://avatars.githubusercontent.com/u/1205805?v=3","gravatar_id":"","url":"https://api.github.com/users/averas","html_url":"https://github.com/averas","followers_url":"https://api.github.com/users/averas/followers","following_url":"https://api.github.com/users/averas/following{/other_user}","gists_url":"https://api.github.com/users/averas/gists{/gist_id}","starred_url":"https://api.github.com/users/averas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/averas/subscriptions","organizations_url":"https://api.github.com/users/averas/orgs","repos_url":"https://api.github.com/users/averas/repos","events_url":"https://api.github.com/users/averas/events{/privacy}","received_events_url":"https://api.github.com/users/averas/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2016-02-20T02:58:57Z","updated_at":"2016-03-07T14:24:27Z","closed_at":"2016-03-07T14:24:27Z","body":"I'm generating tiles using tilelive and node-mapnik. In a certain map configuration I have I use a linear color ramp to encode raster values into png tiles. The carto style is:\r\n\r\n```\r\n#raster {\r\n  raster-opacity:1;\r\n  raster-scaling:near;\r\n  raster-colorizer-default-mode: linear;\r\n  raster-colorizer-default-color: transparent;\r\n  raster-colorizer-stops:\r\n    stop(0,rgb(0, 0, 0))\r\n    stop(255, rgb(255, 0, 0))\r\n    stop(256, rgb(0, 1, 0))\r\n    stop(511, rgb(255, 1, 0))\r\n    stop(512, rgb(0, 2, 0))\r\n    stop(767, rgb(255, 2, 0))\r\n    stop(768, rgb(0, 3, 0))\r\n    stop(1023, rgb(255, 3, 0))\r\n    ....\r\n```\r\nwhich gives me a Mapnik XML configuration of:\r\n\r\n```\r\n<Style name=\"raster\" filter-mode=\"first\">\r\n  <Rule>\r\n    <RasterSymbolizer opacity=\"1\" scaling=\"near\" default-mode=\"linear\" default-color=\"rgba(0, 0, 0, 0)\" >\r\n\t<stop value=\"0\" color=\"#000000\" /> \r\n\t<stop value=\"255\" color=\"#ff0000\" /> \r\n\t<stop value=\"256\" color=\"#000100\" /> \r\n\t<stop value=\"511\" color=\"#ff0100\" /> \r\n\t<stop value=\"512\" color=\"#000200\" /> \r\n\t<stop value=\"767\" color=\"#ff0200\" /> \r\n\t<stop value=\"768\" color=\"#000300\" /> \r\n\t<stop value=\"1023\" color=\"#ff0300\" /> \r\n    ....\r\n```\r\nAs you can see, what I'm doing is encoding the exact raster pixel value into something that I can later read when decoding the tile images client side.\r\n\r\nAll this works great, **as long as I keep the scaling parameter set to \"near\" or \"fast\"**. If I change it to any other algorithm, such as lanczos, node-mapnik generates a couple of tiles (which look fine), and then crashes with a:\r\n\r\n<pre>\r\nFloating point exception (core dumped)\r\n</pre>\r\n\r\nI have a strong feeling the color interpolation algorithms get in trouble based on my color ramp, I just can't understand why. Any clues?\r\n\r\ntilelive 5.12.1\r\nnode-mapnik 3.4.16"}}