{"action":"created","comment":{"url":"https://api.github.com/repos/OSGeo/gdal/pulls/comments/72887545","id":72887545,"diff_hunk":"@@ -0,0 +1,463 @@\n+/*******************************************************************************\n+ *  Project: OGR CAD Driver\n+ *  Purpose: Implements driver based on libopencad\n+ *  Author: Alexandr Borzykh, mush3d at gmail.com\n+ *  Author: Dmitry Baryshnikov, polimax@mail.ru\n+ *  Language: C++\n+ *******************************************************************************\n+ *  The MIT License (MIT)\n+ *\n+ *  Copyright (c) 2016 Alexandr Borzykh\n+ *  Copyright (c) 2016, NextGIS\n+ *\n+ *  Permission is hereby granted, free of charge, to any person obtaining a copy\n+ *  of this software and associated documentation files (the \"Software\"), to deal\n+ *  in the Software without restriction, including without limitation the rights\n+ *  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n+ *  copies of the Software, and to permit persons to whom the Software is\n+ *  furnished to do so, subject to the following conditions:\n+ *\n+ *  The above copyright notice and this permission notice shall be included in all\n+ *  copies or substantial portions of the Software.\n+ *\n+ *  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n+ *  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n+ *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n+ *  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n+ *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n+ *  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n+ *  SOFTWARE.\n+ *******************************************************************************/\n+#include \"ogr_cad.h\"\n+#include \"cpl_conv.h\"\n+#include \"gdal_proxy.h\"\n+#include \"gdal_pam.h\"\n+\n+#include \"vsilfileio.h\"\n+\n+class CADWrapperRasterBand : public GDALProxyRasterBand\n+{\n+  GDALRasterBand* poBaseBand;\n+\n+  protected:\n+    virtual GDALRasterBand* RefUnderlyingRasterBand() { return poBaseBand; }\n+\n+  public:\n+    explicit CADWrapperRasterBand( GDALRasterBand* poBaseBandIn )\n+{\n+        this->poBaseBand = poBaseBandIn;\n+        eDataType = poBaseBand->GetRasterDataType();\n+        poBaseBand->GetBlockSize(&nBlockXSize, &nBlockYSize);\n+}\n+    ~CADWrapperRasterBand() {}\n+};\n+\n+GDALCADDataset::GDALCADDataset() : poCADFile(NULL), papoLayers(NULL), nLayers(0),\n+    poRasterDS(NULL)\n+{\n+    adfGeoTransform[0] = 0.0;\n+    adfGeoTransform[1] = 1.0;\n+    adfGeoTransform[2] = 0.0;\n+    adfGeoTransform[3] = 0.0;\n+    adfGeoTransform[4] = 0.0;\n+    adfGeoTransform[5] = 1.0;\n+}\n+\n+GDALCADDataset::~GDALCADDataset()\n+    {\n+    if (poRasterDS != NULL)\n+    {\n+        GDALClose( poRasterDS );\n+        poRasterDS = NULL;\n+    }\n+    \n+    for( int i = 0; i < nLayers; i++ )\n+        delete papoLayers[i];\n+    CPLFree( papoLayers );\n+    if(poCADFile)\n+        delete( poCADFile );\n+}\n+    \n+void GDALCADDataset::FillTransform(CADImage* pImage, double dfUnits)\n+{\n+            unsigned char nResUnits = pImage->getResolutionUnits();\n+            double dfMultiply(1);\n+            \n+            switch(nResUnits)// 0 == none, 2 == centimeters, 5 == inches;","path":"gdal/ogr/ogrsf_frmts/cad/gdalcaddataset.cpp","position":86,"original_position":86,"commit_id":"82b08bc6b5e336fa965c011e78d95a0e76014179","original_commit_id":"82b08bc6b5e336fa965c011e78d95a0e76014179","user":{"login":"rouault","id":1192433,"avatar_url":"https://avatars.githubusercontent.com/u/1192433?v=3","gravatar_id":"","url":"https://api.github.com/users/rouault","html_url":"https://github.com/rouault","followers_url":"https://api.github.com/users/rouault/followers","following_url":"https://api.github.com/users/rouault/following{/other_user}","gists_url":"https://api.github.com/users/rouault/gists{/gist_id}","starred_url":"https://api.github.com/users/rouault/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rouault/subscriptions","organizations_url":"https://api.github.com/users/rouault/orgs","repos_url":"https://api.github.com/users/rouault/repos","events_url":"https://api.github.com/users/rouault/events{/privacy}","received_events_url":"https://api.github.com/users/rouault/received_events","type":"User","site_admin":false},"body":"Inconsistent indentation","created_at":"2016-07-30T13:43:19Z","updated_at":"2016-07-30T13:43:19Z","html_url":"https://github.com/OSGeo/gdal/pull/145#discussion_r72887545","pull_request_url":"https://api.github.com/repos/OSGeo/gdal/pulls/145","_links":{"self":{"href":"https://api.github.com/repos/OSGeo/gdal/pulls/comments/72887545"},"html":{"href":"https://github.com/OSGeo/gdal/pull/145#discussion_r72887545"},"pull_request":{"href":"https://api.github.com/repos/OSGeo/gdal/pulls/145"}}},"pull_request":{"url":"https://api.github.com/repos/OSGeo/gdal/pulls/145","id":79240811,"html_url":"https://github.com/OSGeo/gdal/pull/145","diff_url":"https://github.com/OSGeo/gdal/pull/145.diff","patch_url":"https://github.com/OSGeo/gdal/pull/145.patch","issue_url":"https://api.github.com/repos/OSGeo/gdal/issues/145","number":145,"state":"open","locked":false,"title":"OGR CAD Driver ","user":{"login":"sandyre","id":15324323,"avatar_url":"https://avatars.githubusercontent.com/u/15324323?v=3","gravatar_id":"","url":"https://api.github.com/users/sandyre","html_url":"https://github.com/sandyre","followers_url":"https://api.github.com/users/sandyre/followers","following_url":"https://api.github.com/users/sandyre/following{/other_user}","gists_url":"https://api.github.com/users/sandyre/gists{/gist_id}","starred_url":"https://api.github.com/users/sandyre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sandyre/subscriptions","organizations_url":"https://api.github.com/users/sandyre/orgs","repos_url":"https://api.github.com/users/sandyre/repos","events_url":"https://api.github.com/users/sandyre/events{/privacy}","received_events_url":"https://api.github.com/users/sandyre/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-07-28T18:01:11Z","updated_at":"2016-07-30T13:43:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7174242d237786065b6fe0217ae1b9e6d808892f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/OSGeo/gdal/pulls/145/commits","review_comments_url":"https://api.github.com/repos/OSGeo/gdal/pulls/145/comments","review_comment_url":"https://api.github.com/repos/OSGeo/gdal/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OSGeo/gdal/issues/145/comments","statuses_url":"https://api.github.com/repos/OSGeo/gdal/statuses/82b08bc6b5e336fa965c011e78d95a0e76014179","head":{"label":"sandyre:trunk","ref":"trunk","sha":"82b08bc6b5e336fa965c011e78d95a0e76014179","user":{"login":"sandyre","id":15324323,"avatar_url":"https://avatars.githubusercontent.com/u/15324323?v=3","gravatar_id":"","url":"https://api.github.com/users/sandyre","html_url":"https://github.com/sandyre","followers_url":"https://api.github.com/users/sandyre/followers","following_url":"https://api.github.com/users/sandyre/following{/other_user}","gists_url":"https://api.github.com/users/sandyre/gists{/gist_id}","starred_url":"https://api.github.com/users/sandyre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sandyre/subscriptions","organizations_url":"https://api.github.com/users/sandyre/orgs","repos_url":"https://api.github.com/users/sandyre/repos","events_url":"https://api.github.com/users/sandyre/events{/privacy}","received_events_url":"https://api.github.com/users/sandyre/received_events","type":"User","site_admin":false},"repo":{"id":60459622,"name":"gdal_libopencad","full_name":"sandyre/gdal_libopencad","owner":{"login":"sandyre","id":15324323,"avatar_url":"https://avatars.githubusercontent.com/u/15324323?v=3","gravatar_id":"","url":"https://api.github.com/users/sandyre","html_url":"https://github.com/sandyre","followers_url":"https://api.github.com/users/sandyre/followers","following_url":"https://api.github.com/users/sandyre/following{/other_user}","gists_url":"https://api.github.com/users/sandyre/gists{/gist_id}","starred_url":"https://api.github.com/users/sandyre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sandyre/subscriptions","organizations_url":"https://api.github.com/users/sandyre/orgs","repos_url":"https://api.github.com/users/sandyre/repos","events_url":"https://api.github.com/users/sandyre/events{/privacy}","received_events_url":"https://api.github.com/users/sandyre/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sandyre/gdal_libopencad","description":"GDAL is an open source X/MIT licensed translator library for raster and vector geospatial data formats. This is a mirror of the GDAL Subversion repository.","fork":true,"url":"https://api.github.com/repos/sandyre/gdal_libopencad","forks_url":"https://api.github.com/repos/sandyre/gdal_libopencad/forks","keys_url":"https://api.github.com/repos/sandyre/gdal_libopencad/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sandyre/gdal_libopencad/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sandyre/gdal_libopencad/teams","hooks_url":"https://api.github.com/repos/sandyre/gdal_libopencad/hooks","issue_events_url":"https://api.github.com/repos/sandyre/gdal_libopencad/issues/events{/number}","events_url":"https://api.github.com/repos/sandyre/gdal_libopencad/events","assignees_url":"https://api.github.com/repos/sandyre/gdal_libopencad/assignees{/user}","branches_url":"https://api.github.com/repos/sandyre/gdal_libopencad/branches{/branch}","tags_url":"https://api.github.com/repos/sandyre/gdal_libopencad/tags","blobs_url":"https://api.github.com/repos/sandyre/gdal_libopencad/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sandyre/gdal_libopencad/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sandyre/gdal_libopencad/git/refs{/sha}","trees_url":"https://api.github.com/repos/sandyre/gdal_libopencad/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sandyre/gdal_libopencad/statuses/{sha}","languages_url":"https://api.github.com/repos/sandyre/gdal_libopencad/languages","stargazers_url":"https://api.github.com/repos/sandyre/gdal_libopencad/stargazers","contributors_url":"https://api.github.com/repos/sandyre/gdal_libopencad/contributors","subscribers_url":"https://api.github.com/repos/sandyre/gdal_libopencad/subscribers","subscription_url":"https://api.github.com/repos/sandyre/gdal_libopencad/subscription","commits_url":"https://api.github.com/repos/sandyre/gdal_libopencad/commits{/sha}","git_commits_url":"https://api.github.com/repos/sandyre/gdal_libopencad/git/commits{/sha}","comments_url":"https://api.github.com/repos/sandyre/gdal_libopencad/comments{/number}","issue_comment_url":"https://api.github.com/repos/sandyre/gdal_libopencad/issues/comments{/number}","contents_url":"https://api.github.com/repos/sandyre/gdal_libopencad/contents/{+path}","compare_url":"https://api.github.com/repos/sandyre/gdal_libopencad/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sandyre/gdal_libopencad/merges","archive_url":"https://api.github.com/repos/sandyre/gdal_libopencad/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sandyre/gdal_libopencad/downloads","issues_url":"https://api.github.com/repos/sandyre/gdal_libopencad/issues{/number}","pulls_url":"https://api.github.com/repos/sandyre/gdal_libopencad/pulls{/number}","milestones_url":"https://api.github.com/repos/sandyre/gdal_libopencad/milestones{/number}","notifications_url":"https://api.github.com/repos/sandyre/gdal_libopencad/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sandyre/gdal_libopencad/labels{/name}","releases_url":"https://api.github.com/repos/sandyre/gdal_libopencad/releases{/id}","deployments_url":"https://api.github.com/repos/sandyre/gdal_libopencad/deployments","created_at":"2016-06-05T12:45:38Z","updated_at":"2016-06-05T12:46:00Z","pushed_at":"2016-07-29T11:31:09Z","git_url":"git://github.com/sandyre/gdal_libopencad.git","ssh_url":"git@github.com:sandyre/gdal_libopencad.git","clone_url":"https://github.com/sandyre/gdal_libopencad.git","svn_url":"https://github.com/sandyre/gdal_libopencad","homepage":"http://www.gdal.org/","size":120136,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"trunk"}},"base":{"label":"OSGeo:trunk","ref":"trunk","sha":"2582e2415cdabe1d826d1e0046ed7b848fc8017e","user":{"login":"OSGeo","id":1058467,"avatar_url":"https://avatars.githubusercontent.com/u/1058467?v=3","gravatar_id":"","url":"https://api.github.com/users/OSGeo","html_url":"https://github.com/OSGeo","followers_url":"https://api.github.com/users/OSGeo/followers","following_url":"https://api.github.com/users/OSGeo/following{/other_user}","gists_url":"https://api.github.com/users/OSGeo/gists{/gist_id}","starred_url":"https://api.github.com/users/OSGeo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OSGeo/subscriptions","organizations_url":"https://api.github.com/users/OSGeo/orgs","repos_url":"https://api.github.com/users/OSGeo/repos","events_url":"https://api.github.com/users/OSGeo/events{/privacy}","received_events_url":"https://api.github.com/users/OSGeo/received_events","type":"Organization","site_admin":false},"repo":{"id":6148317,"name":"gdal","full_name":"OSGeo/gdal","owner":{"login":"OSGeo","id":1058467,"avatar_url":"https://avatars.githubusercontent.com/u/1058467?v=3","gravatar_id":"","url":"https://api.github.com/users/OSGeo","html_url":"https://github.com/OSGeo","followers_url":"https://api.github.com/users/OSGeo/followers","following_url":"https://api.github.com/users/OSGeo/following{/other_user}","gists_url":"https://api.github.com/users/OSGeo/gists{/gist_id}","starred_url":"https://api.github.com/users/OSGeo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OSGeo/subscriptions","organizations_url":"https://api.github.com/users/OSGeo/orgs","repos_url":"https://api.github.com/users/OSGeo/repos","events_url":"https://api.github.com/users/OSGeo/events{/privacy}","received_events_url":"https://api.github.com/users/OSGeo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OSGeo/gdal","description":"GDAL is an open source X/MIT licensed translator library for raster and vector geospatial data formats. This is a mirror of the GDAL Subversion repository.","fork":false,"url":"https://api.github.com/repos/OSGeo/gdal","forks_url":"https://api.github.com/repos/OSGeo/gdal/forks","keys_url":"https://api.github.com/repos/OSGeo/gdal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OSGeo/gdal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OSGeo/gdal/teams","hooks_url":"https://api.github.com/repos/OSGeo/gdal/hooks","issue_events_url":"https://api.github.com/repos/OSGeo/gdal/issues/events{/number}","events_url":"https://api.github.com/repos/OSGeo/gdal/events","assignees_url":"https://api.github.com/repos/OSGeo/gdal/assignees{/user}","branches_url":"https://api.github.com/repos/OSGeo/gdal/branches{/branch}","tags_url":"https://api.github.com/repos/OSGeo/gdal/tags","blobs_url":"https://api.github.com/repos/OSGeo/gdal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OSGeo/gdal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OSGeo/gdal/git/refs{/sha}","trees_url":"https://api.github.com/repos/OSGeo/gdal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OSGeo/gdal/statuses/{sha}","languages_url":"https://api.github.com/repos/OSGeo/gdal/languages","stargazers_url":"https://api.github.com/repos/OSGeo/gdal/stargazers","contributors_url":"https://api.github.com/repos/OSGeo/gdal/contributors","subscribers_url":"https://api.github.com/repos/OSGeo/gdal/subscribers","subscription_url":"https://api.github.com/repos/OSGeo/gdal/subscription","commits_url":"https://api.github.com/repos/OSGeo/gdal/commits{/sha}","git_commits_url":"https://api.github.com/repos/OSGeo/gdal/git/commits{/sha}","comments_url":"https://api.github.com/repos/OSGeo/gdal/comments{/number}","issue_comment_url":"https://api.github.com/repos/OSGeo/gdal/issues/comments{/number}","contents_url":"https://api.github.com/repos/OSGeo/gdal/contents/{+path}","compare_url":"https://api.github.com/repos/OSGeo/gdal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OSGeo/gdal/merges","archive_url":"https://api.github.com/repos/OSGeo/gdal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OSGeo/gdal/downloads","issues_url":"https://api.github.com/repos/OSGeo/gdal/issues{/number}","pulls_url":"https://api.github.com/repos/OSGeo/gdal/pulls{/number}","milestones_url":"https://api.github.com/repos/OSGeo/gdal/milestones{/number}","notifications_url":"https://api.github.com/repos/OSGeo/gdal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OSGeo/gdal/labels{/name}","releases_url":"https://api.github.com/repos/OSGeo/gdal/releases{/id}","deployments_url":"https://api.github.com/repos/OSGeo/gdal/deployments","created_at":"2012-10-09T21:39:58Z","updated_at":"2016-07-25T16:30:27Z","pushed_at":"2016-07-29T19:14:28Z","git_url":"git://github.com/OSGeo/gdal.git","ssh_url":"git@github.com:OSGeo/gdal.git","clone_url":"https://github.com/OSGeo/gdal.git","svn_url":"https://github.com/OSGeo/gdal","homepage":"http://www.gdal.org/","size":170322,"stargazers_count":269,"watchers_count":269,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":254,"mirror_url":null,"open_issues_count":20,"forks":254,"open_issues":20,"watchers":269,"default_branch":"trunk"}},"_links":{"self":{"href":"https://api.github.com/repos/OSGeo/gdal/pulls/145"},"html":{"href":"https://github.com/OSGeo/gdal/pull/145"},"issue":{"href":"https://api.github.com/repos/OSGeo/gdal/issues/145"},"comments":{"href":"https://api.github.com/repos/OSGeo/gdal/issues/145/comments"},"review_comments":{"href":"https://api.github.com/repos/OSGeo/gdal/pulls/145/comments"},"review_comment":{"href":"https://api.github.com/repos/OSGeo/gdal/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OSGeo/gdal/pulls/145/commits"},"statuses":{"href":"https://api.github.com/repos/OSGeo/gdal/statuses/82b08bc6b5e336fa965c011e78d95a0e76014179"}}}}
{"actor":{"display_login":"rouault"}}