{"action":"created","issue":{"url":"https://api.github.com/repos/DotSpatial/DotSpatial/issues/181","repository_url":"https://api.github.com/repos/DotSpatial/DotSpatial","labels_url":"https://api.github.com/repos/DotSpatial/DotSpatial/issues/181/labels{/name}","comments_url":"https://api.github.com/repos/DotSpatial/DotSpatial/issues/181/comments","events_url":"https://api.github.com/repos/DotSpatial/DotSpatial/issues/181/events","html_url":"https://github.com/DotSpatial/DotSpatial/issues/181","id":153407356,"number":181,"title":"Raster origin problem","user":{"login":"mogikanin","id":840681,"avatar_url":"https://avatars.githubusercontent.com/u/840681?v=3","gravatar_id":"","url":"https://api.github.com/users/mogikanin","html_url":"https://github.com/mogikanin","followers_url":"https://api.github.com/users/mogikanin/followers","following_url":"https://api.github.com/users/mogikanin/following{/other_user}","gists_url":"https://api.github.com/users/mogikanin/gists{/gist_id}","starred_url":"https://api.github.com/users/mogikanin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mogikanin/subscriptions","organizations_url":"https://api.github.com/users/mogikanin/orgs","repos_url":"https://api.github.com/users/mogikanin/repos","events_url":"https://api.github.com/users/mogikanin/events{/privacy}","received_events_url":"https://api.github.com/users/mogikanin/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/DotSpatial/DotSpatial/labels/bug","name":"bug","color":"ee0701"},{"url":"https://api.github.com/repos/DotSpatial/DotSpatial/labels/CodePlex","name":"CodePlex","color":"ededed"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-06T08:50:45Z","updated_at":"2016-05-28T15:05:12Z","closed_at":"2016-05-28T15:05:12Z","body":"**This issue was imported from [CodePlex](http://dotspatial.codeplex.com/workitem/187)**\r\n\r\n**[karanovicm](http://www.codeplex.com/site/users/view/karanovicm)** wrote 2010-12-07 at 23:40\r\nHi All \r\n\r\nI created grid (raster *.bgd file type - attached) and imported in dot spatial using Demo Map and lower left corner is at -52,-50, importing the same grid in MapWindow4 lower left coordinates are at -51,-51, which looks right because I created grid using dot\r\n spatial library with Xllcenter and Yllcenter assigned at -50 for both with cell size of 2 and 50 rows and 50 columns.\r\n\r\n\r\nThe other problem arrives when I create the same grid but with 100 rows and 100 columns. Grid is imported I guess correctly but when tried to open properties, Demo Map crashed in SymbologyRasterExt.cs in function GetRandomVaules with error \"The given key\r\n was not present in the dictionary\" in the line \"result.Add(reservoir[indx]);\"\r\n\r\n\r\nSimilar problem to the problem reported in Issue #182 \r\n\r\nThank You\r\n\r\n**[Taber](http://www.codeplex.com/site/users/view/Taber)** wrote 2011-03-30 at 20:19\r\nI have a similar problem:\r\n\r\n<h2>This code create a raster:</h2>\r\n<pre><code>        r = Raster.CreateRaster(this._path, null, newCols, newRows, 1, typeof(float), new String[] { });\n        r.Name = Core.Enum.TYPE_GRID.TERRAIN.ToString();\n        gw.getEnvelope(out xmin, out xmax, out ymin, out ymax); // see below for explanation\n        Extent myE = new Extent(xmin, ymin, xmax, ymax);\n        r.Bounds = new RasterBounds(newRows, newCols, myE);</code></pre>\r\n<h2>r.NoDataValue = gw.getNoDataValue;</h2>\r\n<h2>And gw.getEnvelope is (i think the code is self-explained):</h2>\r\npublic void getEnvelope(out double xllcorner, out double xrlcorner, out double yllcorner, out double yhlcorner)\r\n\r\n<pre><code>    {\n        xllcorner = this.getXLLCorner;\n        xrlcorner = xllcorner + (this._cellSizeX * this._numCols);\n        yllcorner = this.getYLLCorner;\n        yhlcorner = yllcorner + (this._cellSizeY * this._numRows);</code></pre>\r\n<h2>}</h2>\r\nWhen i use a shapefile for test the raster's origins i see the attached image.\r\n\r\n<h2>If a modify the function which returns the envelope of my raster in this way:</h2>\r\npublic void getEnvelope(out double xllcorner, out double xrlcorner, out double yllcorner, out double yhlcorner)\r\n\r\n<pre><code>    {\n        xllcorner = this.getXLLCorner +(this.getDX / 2);\n        xrlcorner = xllcorner + (this._cellSizeX * this._numCols);\n        yllcorner = this.getYLLCorner -(this.getDY / 2);\n        yhlcorner = yllcorner + (this._cellSizeY * this._numRows);</code></pre>\r\n<h2>}</h2>\r\nThe shape and the raster fit both ok. \r\n\r\n\r\n\r\nI think the constructor from class \"RasterBounds\" dont work correctly. Its must be revised."},"comment":{"url":"https://api.github.com/repos/DotSpatial/DotSpatial/issues/comments/222313074","html_url":"https://github.com/DotSpatial/DotSpatial/issues/181#issuecomment-222313074","issue_url":"https://api.github.com/repos/DotSpatial/DotSpatial/issues/181","id":222313074,"user":{"login":"mogikanin","id":840681,"avatar_url":"https://avatars.githubusercontent.com/u/840681?v=3","gravatar_id":"","url":"https://api.github.com/users/mogikanin","html_url":"https://github.com/mogikanin","followers_url":"https://api.github.com/users/mogikanin/followers","following_url":"https://api.github.com/users/mogikanin/following{/other_user}","gists_url":"https://api.github.com/users/mogikanin/gists{/gist_id}","starred_url":"https://api.github.com/users/mogikanin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mogikanin/subscriptions","organizations_url":"https://api.github.com/users/mogikanin/orgs","repos_url":"https://api.github.com/users/mogikanin/repos","events_url":"https://api.github.com/users/mogikanin/events{/privacy}","received_events_url":"https://api.github.com/users/mogikanin/received_events","type":"User","site_admin":false},"created_at":"2016-05-28T15:05:12Z","updated_at":"2016-05-28T15:05:12Z","body":"Not reproduced"}}
{"actor":{"display_login":"mogikanin"}}