{"action":"closed","number":27,"pull_request":{"url":"https://api.github.com/repos/Turfjs/turf-www/pulls/27","id":26842083,"html_url":"https://github.com/Turfjs/turf-www/pull/27","diff_url":"https://github.com/Turfjs/turf-www/pull/27.diff","patch_url":"https://github.com/Turfjs/turf-www/pull/27.patch","issue_url":"https://api.github.com/repos/Turfjs/turf-www/issues/27","number":27,"state":"closed","locked":false,"title":"Fix geojson file loading in examples","user":{"login":"rukku","id":284046,"avatar_url":"https://avatars.githubusercontent.com/u/284046?v=3","gravatar_id":"","url":"https://api.github.com/users/rukku","html_url":"https://github.com/rukku","followers_url":"https://api.github.com/users/rukku/followers","following_url":"https://api.github.com/users/rukku/following{/other_user}","gists_url":"https://api.github.com/users/rukku/gists{/gist_id}","starred_url":"https://api.github.com/users/rukku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rukku/subscriptions","organizations_url":"https://api.github.com/users/rukku/orgs","repos_url":"https://api.github.com/users/rukku/repos","events_url":"https://api.github.com/users/rukku/events{/privacy}","received_events_url":"https://api.github.com/users/rukku/received_events","type":"User","site_admin":false},"body":"I'm new to node.js (I just started earlier today) and I was trying out the examples. I kept getting the following error\r\n\r\n```shell\r\nError: Unknown GeoJSON type: undefined\r\n    at jsts.io.GeoJSONParser.read (C:\\Users\\geonin\\node_modules\\turf\\node_modules\\turf-intersect\\node_modules\\jsts\\lib\\jsts.js:1013:47)\r\n    at jsts.io.GeoJSONReader.read (C:\\Users\\geonin\\node_modules\\turf\\node_modules\\turf-intersect\\node_modules\\jsts\\lib\\jsts.js:97:351)\r\n    at Object.module.exports [as intersect] (C:\\Users\\geonin\\node_modules\\turf\\node_modules\\turf-intersect\\index.js:20:16)\r\n    at Object.<anonymous> (C:\\Users\\geonin\\code\\noderight\\turf-intersectup.js:26:29)\r\n    at Module._compile (module.js:456:26)\r\n    at Object.Module._extensions..js (module.js:474:10)\r\n    at Module.load (module.js:356:32)\r\n    at Function.Module._load (module.js:312:12)\r\n    at Function.Module.runMain (module.js:497:10)\r\n    at startup (node.js:119:16)\r\n```\r\n\r\nConsole.log shows that that the values of the loaded geojson files are buffers and hence aren't valid geojson objects\r\n\r\n```shell\r\n<Buffer 7b 0d 0a 20 20 22 74 79 70 65 22 3a 20 22 50 6f 6c 79 67 6f 6e 22 2c 0d 0a 20 20 22 63 6f 6f 72 64 69 6e 61 74 65 73 22 3a 20 5b 0d 0a 20 20 20 20 5b 0d ...>\r\n<Buffer 7b 0d 0a 20 20 22 74 79 70 65 22 3a 20 22 50 6f 6c 79 67 6f 6e 22 2c 0d 0a 20 20 22 63 6f 6f 72 64 69 6e 61 74 65 73 22 3a 20 5b 0d 0a 20 20 20 20 5b 0d ...>\r\n```\r\n\r\nAdded the encoding option for fs.readFileSync as stated in the fs API and the files are finally recognized as geojson but I still kept getting the same error. Finally got it to work by using JSON.parse(). (Should I have filed this as a bug report first?)\r\n\r\n\r\n\r\n\r\n\r\n","created_at":"2015-01-05T18:42:11Z","updated_at":"2015-01-05T21:53:34Z","closed_at":"2015-01-05T21:53:34Z","merged_at":"2015-01-05T21:53:34Z","merge_commit_sha":"e00b1dfaa54dc159cfaee9290c65fcf3f925fb37","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Turfjs/turf-www/pulls/27/commits","review_comments_url":"https://api.github.com/repos/Turfjs/turf-www/pulls/27/comments","review_comment_url":"https://api.github.com/repos/Turfjs/turf-www/pulls/comments/{number}","comments_url":"https://api.github.com/repos/Turfjs/turf-www/issues/27/comments","statuses_url":"https://api.github.com/repos/Turfjs/turf-www/statuses/37edc31f1151849bcd4f47df44a51063a4513f03","head":{"label":"rukku:JSONparsing","ref":"JSONparsing","sha":"37edc31f1151849bcd4f47df44a51063a4513f03","user":{"login":"rukku","id":284046,"avatar_url":"https://avatars.githubusercontent.com/u/284046?v=3","gravatar_id":"","url":"https://api.github.com/users/rukku","html_url":"https://github.com/rukku","followers_url":"https://api.github.com/users/rukku/followers","following_url":"https://api.github.com/users/rukku/following{/other_user}","gists_url":"https://api.github.com/users/rukku/gists{/gist_id}","starred_url":"https://api.github.com/users/rukku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rukku/subscriptions","organizations_url":"https://api.github.com/users/rukku/orgs","repos_url":"https://api.github.com/users/rukku/repos","events_url":"https://api.github.com/users/rukku/events{/privacy}","received_events_url":"https://api.github.com/users/rukku/received_events","type":"User","site_admin":false},"repo":{"id":28825309,"name":"turf-www","full_name":"rukku/turf-www","owner":{"login":"rukku","id":284046,"avatar_url":"https://avatars.githubusercontent.com/u/284046?v=3","gravatar_id":"","url":"https://api.github.com/users/rukku","html_url":"https://github.com/rukku","followers_url":"https://api.github.com/users/rukku/followers","following_url":"https://api.github.com/users/rukku/following{/other_user}","gists_url":"https://api.github.com/users/rukku/gists{/gist_id}","starred_url":"https://api.github.com/users/rukku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rukku/subscriptions","organizations_url":"https://api.github.com/users/rukku/orgs","repos_url":"https://api.github.com/users/rukku/repos","events_url":"https://api.github.com/users/rukku/events{/privacy}","received_events_url":"https://api.github.com/users/rukku/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rukku/turf-www","description":"turf website","fork":true,"url":"https://api.github.com/repos/rukku/turf-www","forks_url":"https://api.github.com/repos/rukku/turf-www/forks","keys_url":"https://api.github.com/repos/rukku/turf-www/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rukku/turf-www/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rukku/turf-www/teams","hooks_url":"https://api.github.com/repos/rukku/turf-www/hooks","issue_events_url":"https://api.github.com/repos/rukku/turf-www/issues/events{/number}","events_url":"https://api.github.com/repos/rukku/turf-www/events","assignees_url":"https://api.github.com/repos/rukku/turf-www/assignees{/user}","branches_url":"https://api.github.com/repos/rukku/turf-www/branches{/branch}","tags_url":"https://api.github.com/repos/rukku/turf-www/tags","blobs_url":"https://api.github.com/repos/rukku/turf-www/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rukku/turf-www/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rukku/turf-www/git/refs{/sha}","trees_url":"https://api.github.com/repos/rukku/turf-www/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rukku/turf-www/statuses/{sha}","languages_url":"https://api.github.com/repos/rukku/turf-www/languages","stargazers_url":"https://api.github.com/repos/rukku/turf-www/stargazers","contributors_url":"https://api.github.com/repos/rukku/turf-www/contributors","subscribers_url":"https://api.github.com/repos/rukku/turf-www/subscribers","subscription_url":"https://api.github.com/repos/rukku/turf-www/subscription","commits_url":"https://api.github.com/repos/rukku/turf-www/commits{/sha}","git_commits_url":"https://api.github.com/repos/rukku/turf-www/git/commits{/sha}","comments_url":"https://api.github.com/repos/rukku/turf-www/comments{/number}","issue_comment_url":"https://api.github.com/repos/rukku/turf-www/issues/comments/{number}","contents_url":"https://api.github.com/repos/rukku/turf-www/contents/{+path}","compare_url":"https://api.github.com/repos/rukku/turf-www/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rukku/turf-www/merges","archive_url":"https://api.github.com/repos/rukku/turf-www/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rukku/turf-www/downloads","issues_url":"https://api.github.com/repos/rukku/turf-www/issues{/number}","pulls_url":"https://api.github.com/repos/rukku/turf-www/pulls{/number}","milestones_url":"https://api.github.com/repos/rukku/turf-www/milestones{/number}","notifications_url":"https://api.github.com/repos/rukku/turf-www/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rukku/turf-www/labels{/name}","releases_url":"https://api.github.com/repos/rukku/turf-www/releases{/id}","created_at":"2015-01-05T18:19:20Z","updated_at":"2015-01-05T18:19:20Z","pushed_at":"2015-01-05T18:24:40Z","git_url":"git://github.com/rukku/turf-www.git","ssh_url":"git@github.com:rukku/turf-www.git","clone_url":"https://github.com/rukku/turf-www.git","svn_url":"https://github.com/rukku/turf-www","homepage":null,"size":636,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"gh-pages"}},"base":{"label":"Turfjs:gh-pages","ref":"gh-pages","sha":"a97253b9ea763effc596bfd7b1ead7ca341f5c6f","user":{"login":"Turfjs","id":7736769,"avatar_url":"https://avatars.githubusercontent.com/u/7736769?v=3","gravatar_id":"","url":"https://api.github.com/users/Turfjs","html_url":"https://github.com/Turfjs","followers_url":"https://api.github.com/users/Turfjs/followers","following_url":"https://api.github.com/users/Turfjs/following{/other_user}","gists_url":"https://api.github.com/users/Turfjs/gists{/gist_id}","starred_url":"https://api.github.com/users/Turfjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Turfjs/subscriptions","organizations_url":"https://api.github.com/users/Turfjs/orgs","repos_url":"https://api.github.com/users/Turfjs/repos","events_url":"https://api.github.com/users/Turfjs/events{/privacy}","received_events_url":"https://api.github.com/users/Turfjs/received_events","type":"Organization","site_admin":false},"repo":{"id":20894827,"name":"turf-www","full_name":"Turfjs/turf-www","owner":{"login":"Turfjs","id":7736769,"avatar_url":"https://avatars.githubusercontent.com/u/7736769?v=3","gravatar_id":"","url":"https://api.github.com/users/Turfjs","html_url":"https://github.com/Turfjs","followers_url":"https://api.github.com/users/Turfjs/followers","following_url":"https://api.github.com/users/Turfjs/following{/other_user}","gists_url":"https://api.github.com/users/Turfjs/gists{/gist_id}","starred_url":"https://api.github.com/users/Turfjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Turfjs/subscriptions","organizations_url":"https://api.github.com/users/Turfjs/orgs","repos_url":"https://api.github.com/users/Turfjs/repos","events_url":"https://api.github.com/users/Turfjs/events{/privacy}","received_events_url":"https://api.github.com/users/Turfjs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Turfjs/turf-www","description":"turf website","fork":false,"url":"https://api.github.com/repos/Turfjs/turf-www","forks_url":"https://api.github.com/repos/Turfjs/turf-www/forks","keys_url":"https://api.github.com/repos/Turfjs/turf-www/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Turfjs/turf-www/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Turfjs/turf-www/teams","hooks_url":"https://api.github.com/repos/Turfjs/turf-www/hooks","issue_events_url":"https://api.github.com/repos/Turfjs/turf-www/issues/events{/number}","events_url":"https://api.github.com/repos/Turfjs/turf-www/events","assignees_url":"https://api.github.com/repos/Turfjs/turf-www/assignees{/user}","branches_url":"https://api.github.com/repos/Turfjs/turf-www/branches{/branch}","tags_url":"https://api.github.com/repos/Turfjs/turf-www/tags","blobs_url":"https://api.github.com/repos/Turfjs/turf-www/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Turfjs/turf-www/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Turfjs/turf-www/git/refs{/sha}","trees_url":"https://api.github.com/repos/Turfjs/turf-www/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Turfjs/turf-www/statuses/{sha}","languages_url":"https://api.github.com/repos/Turfjs/turf-www/languages","stargazers_url":"https://api.github.com/repos/Turfjs/turf-www/stargazers","contributors_url":"https://api.github.com/repos/Turfjs/turf-www/contributors","subscribers_url":"https://api.github.com/repos/Turfjs/turf-www/subscribers","subscription_url":"https://api.github.com/repos/Turfjs/turf-www/subscription","commits_url":"https://api.github.com/repos/Turfjs/turf-www/commits{/sha}","git_commits_url":"https://api.github.com/repos/Turfjs/turf-www/git/commits{/sha}","comments_url":"https://api.github.com/repos/Turfjs/turf-www/comments{/number}","issue_comment_url":"https://api.github.com/repos/Turfjs/turf-www/issues/comments/{number}","contents_url":"https://api.github.com/repos/Turfjs/turf-www/contents/{+path}","compare_url":"https://api.github.com/repos/Turfjs/turf-www/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Turfjs/turf-www/merges","archive_url":"https://api.github.com/repos/Turfjs/turf-www/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Turfjs/turf-www/downloads","issues_url":"https://api.github.com/repos/Turfjs/turf-www/issues{/number}","pulls_url":"https://api.github.com/repos/Turfjs/turf-www/pulls{/number}","milestones_url":"https://api.github.com/repos/Turfjs/turf-www/milestones{/number}","notifications_url":"https://api.github.com/repos/Turfjs/turf-www/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Turfjs/turf-www/labels{/name}","releases_url":"https://api.github.com/repos/Turfjs/turf-www/releases{/id}","created_at":"2014-06-16T18:03:12Z","updated_at":"2015-01-05T20:33:06Z","pushed_at":"2015-01-05T21:53:34Z","git_url":"git://github.com/Turfjs/turf-www.git","ssh_url":"git@github.com:Turfjs/turf-www.git","clone_url":"https://github.com/Turfjs/turf-www.git","svn_url":"https://github.com/Turfjs/turf-www","homepage":"http://turfjs.org/","size":636,"stargazers_count":1,"watchers_count":1,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2,"mirror_url":null,"open_issues_count":16,"forks":2,"open_issues":16,"watchers":1,"default_branch":"gh-pages"}},"_links":{"self":{"href":"https://api.github.com/repos/Turfjs/turf-www/pulls/27"},"html":{"href":"https://github.com/Turfjs/turf-www/pull/27"},"issue":{"href":"https://api.github.com/repos/Turfjs/turf-www/issues/27"},"comments":{"href":"https://api.github.com/repos/Turfjs/turf-www/issues/27/comments"},"review_comments":{"href":"https://api.github.com/repos/Turfjs/turf-www/pulls/27/comments"},"review_comment":{"href":"https://api.github.com/repos/Turfjs/turf-www/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/Turfjs/turf-www/pulls/27/commits"},"statuses":{"href":"https://api.github.com/repos/Turfjs/turf-www/statuses/37edc31f1151849bcd4f47df44a51063a4513f03"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"morganherlocker","id":814300,"avatar_url":"https://avatars.githubusercontent.com/u/814300?v=3","gravatar_id":"","url":"https://api.github.com/users/morganherlocker","html_url":"https://github.com/morganherlocker","followers_url":"https://api.github.com/users/morganherlocker/followers","following_url":"https://api.github.com/users/morganherlocker/following{/other_user}","gists_url":"https://api.github.com/users/morganherlocker/gists{/gist_id}","starred_url":"https://api.github.com/users/morganherlocker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/morganherlocker/subscriptions","organizations_url":"https://api.github.com/users/morganherlocker/orgs","repos_url":"https://api.github.com/users/morganherlocker/repos","events_url":"https://api.github.com/users/morganherlocker/events{/privacy}","received_events_url":"https://api.github.com/users/morganherlocker/received_events","type":"User","site_admin":false},"comments":0,"review_comments":0,"commits":1,"additions":2,"deletions":2,"changed_files":1}}