{"action":"created","issue":{"url":"https://api.github.com/repos/orbisgis/h2gis/issues/598","labels_url":"https://api.github.com/repos/orbisgis/h2gis/issues/598/labels{/name}","comments_url":"https://api.github.com/repos/orbisgis/h2gis/issues/598/comments","events_url":"https://api.github.com/repos/orbisgis/h2gis/issues/598/events","html_url":"https://github.com/orbisgis/h2gis/issues/598","id":111248251,"number":598,"title":"ST_D8Slope","user":{"login":"ebocher","id":1820572,"avatar_url":"https://avatars.githubusercontent.com/u/1820572?v=3","gravatar_id":"","url":"https://api.github.com/users/ebocher","html_url":"https://github.com/ebocher","followers_url":"https://api.github.com/users/ebocher/followers","following_url":"https://api.github.com/users/ebocher/following{/other_user}","gists_url":"https://api.github.com/users/ebocher/gists{/gist_id}","starred_url":"https://api.github.com/users/ebocher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ebocher/subscriptions","organizations_url":"https://api.github.com/users/ebocher/orgs","repos_url":"https://api.github.com/users/ebocher/repos","events_url":"https://api.github.com/users/ebocher/events{/privacy}","received_events_url":"https://api.github.com/users/ebocher/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/orbisgis/h2gis/labels/Priority%20Critical","name":"Priority Critical","color":"e11d21"},{"url":"https://api.github.com/repos/orbisgis/h2gis/labels/Raster","name":"Raster","color":"fbca04"}],"state":"closed","locked":false,"assignee":{"login":"nicolas-f","id":1382241,"avatar_url":"https://avatars.githubusercontent.com/u/1382241?v=3","gravatar_id":"","url":"https://api.github.com/users/nicolas-f","html_url":"https://github.com/nicolas-f","followers_url":"https://api.github.com/users/nicolas-f/followers","following_url":"https://api.github.com/users/nicolas-f/following{/other_user}","gists_url":"https://api.github.com/users/nicolas-f/gists{/gist_id}","starred_url":"https://api.github.com/users/nicolas-f/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nicolas-f/subscriptions","organizations_url":"https://api.github.com/users/nicolas-f/orgs","repos_url":"https://api.github.com/users/nicolas-f/repos","events_url":"https://api.github.com/users/nicolas-f/events{/privacy}","received_events_url":"https://api.github.com/users/nicolas-f/received_events","type":"User","site_admin":false},"milestone":null,"comments":4,"created_at":"2015-10-13T19:09:18Z","updated_at":"2015-11-06T08:34:05Z","closed_at":"2015-11-06T08:34:05Z","body":"The SQL function ST_D8Slope needs to implement   a JAI operator and a SQL function.\r\n\r\n * JAI operator\r\n\r\nImplement a JAI operator to compute the maximum slope on 3x3 windows.\r\nThe slope could be compute in degree, radian or percent.\r\n\r\nThe syntax will be\r\n\r\n```java\r\nParameterBlock p = new ParameterBlock();\r\np.addSource(geoRaster);\r\np.add(\"percent\");\r\n // Run the new operator.\r\n RenderedOp output = JAI.create(\"D8Slope\", p);\r\n\r\n```\r\n\r\nThe code to compute the slope is available in grap on the HydrologyUtilities.java file.\r\nThe method getSlope must be adapted to run in\r\n```java\r\npublic abstract class D8SlopeOp extends AreaOpImage\r\n protected void computeRect(Raster[] sources, WritableRaster dest, Rectangle destRect) {\r\n\r\n```\r\n\r\n * SQL function\r\n\r\nThe ST_D8Slope will have the following signatures\r\n\r\n```sql\r\n\r\nST_D8Slope(RASTER::TYPE) -> return a new raster with a slope in degrees by default.\r\n\r\nST_D8Slope(RASTER::TYPE, 'percent') -> in percents \r\n\r\n```\r\n\r\nNote :  postgis raster has a ST_Slope (http://postgis.net/docs/RT_ST_Slope.html) function but the syntax is not clear and too ugly for a end user."},"comment":{"url":"https://api.github.com/repos/orbisgis/h2gis/issues/comments/154344281","html_url":"https://github.com/orbisgis/h2gis/issues/598#issuecomment-154344281","issue_url":"https://api.github.com/repos/orbisgis/h2gis/issues/598","id":154344281,"user":{"login":"ebocher","id":1820572,"avatar_url":"https://avatars.githubusercontent.com/u/1820572?v=3","gravatar_id":"","url":"https://api.github.com/users/ebocher","html_url":"https://github.com/ebocher","followers_url":"https://api.github.com/users/ebocher/followers","following_url":"https://api.github.com/users/ebocher/following{/other_user}","gists_url":"https://api.github.com/users/ebocher/gists{/gist_id}","starred_url":"https://api.github.com/users/ebocher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ebocher/subscriptions","organizations_url":"https://api.github.com/users/ebocher/orgs","repos_url":"https://api.github.com/users/ebocher/repos","events_url":"https://api.github.com/users/ebocher/events{/privacy}","received_events_url":"https://api.github.com/users/ebocher/received_events","type":"User","site_admin":false},"created_at":"2015-11-06T08:34:04Z","updated_at":"2015-11-06T08:34:04Z","body":"clap clap"}}