{"action":"created","comment":{"url":"https://api.github.com/repos/codice/ddf/pulls/comments/123062907","pull_request_review_id":45230835,"id":123062907,"diff_hunk":"@@ -231,4 +202,41 @@ Point createPointFromWkt(String wkt) {\n \n         return null;\n     }\n+\n+    private Object webQuery(String urlStr) {\n+        final String response;\n+\n+        try {\n+            WebClient client = createWebClient(urlStr);\n+            response = client.acceptEncoding(StandardCharsets.UTF_8.name())\n+                    .accept(\"application/json\")\n+                    .get(String.class);\n+        } catch (WebApplicationException | ProcessingException e) {\n+            LOGGER.debug(\"Error while making GeoNames request.\", e);\n+            return null;\n+        }\n+\n+        try {\n+            JSONParser parser = new JSONParser(JSONParser.MODE_JSON_SIMPLE);\n+            return parser.parse(response);\n+        } catch (ParseException e) {\n+            LOGGER.debug(\"Error while parsing JSON message from GeoNames service.\", e);\n+            return null;\n+        }\n+    }\n+\n+    WebClient createWebClient(String urlStr) {\n+        return WebClient.create(urlStr);\n+    }\n+\n+    String getUrlEncodedLocation(String location) {\n+\n+        try {\n+            location = URLEncoder.encode(location, StandardCharsets.UTF_8.name());\n+        } catch (UnsupportedEncodingException e) {\n+            LOGGER.debug(\"Unable to encode location.\", e);","path":"catalog/spatial/geocoding/spatial-geocoding-websearch/src/main/java/org/codice/ddf/spatial/geocoder/geonames/GeoNamesWebService.java","position":227,"original_position":227,"commit_id":"5b4fcf01f744c17750b0d595db27bc05d6e737fc","original_commit_id":"5b4fcf01f744c17750b0d595db27bc05d6e737fc","user":{"login":"bdeining","id":6551038,"avatar_url":"https://avatars1.githubusercontent.com/u/6551038?v=3","gravatar_id":"","url":"https://api.github.com/users/bdeining","html_url":"https://github.com/bdeining","followers_url":"https://api.github.com/users/bdeining/followers","following_url":"https://api.github.com/users/bdeining/following{/other_user}","gists_url":"https://api.github.com/users/bdeining/gists{/gist_id}","starred_url":"https://api.github.com/users/bdeining/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bdeining/subscriptions","organizations_url":"https://api.github.com/users/bdeining/orgs","repos_url":"https://api.github.com/users/bdeining/repos","events_url":"https://api.github.com/users/bdeining/events{/privacy}","received_events_url":"https://api.github.com/users/bdeining/received_events","type":"User","site_admin":false},"body":"Could log `location` here too","created_at":"2017-06-20T18:48:00Z","updated_at":"2017-06-20T18:50:05Z","html_url":"https://github.com/codice/ddf/pull/2077#discussion_r123062907","pull_request_url":"https://api.github.com/repos/codice/ddf/pulls/2077","_links":{"self":{"href":"https://api.github.com/repos/codice/ddf/pulls/comments/123062907"},"html":{"href":"https://github.com/codice/ddf/pull/2077#discussion_r123062907"},"pull_request":{"href":"https://api.github.com/repos/codice/ddf/pulls/2077"}}},"pull_request":{"url":"https://api.github.com/repos/codice/ddf/pulls/2077","id":126597557,"html_url":"https://github.com/codice/ddf/pull/2077","diff_url":"https://github.com/codice/ddf/pull/2077.diff","patch_url":"https://github.com/codice/ddf/pull/2077.patch","issue_url":"https://api.github.com/repos/codice/ddf/issues/2077","number":2077,"state":"open","locked":false,"title":"DDF-3069 Geospatial search by named location (Part 2, WIP possible itest issue)","user":{"login":"albany551","id":1081932,"avatar_url":"https://avatars3.githubusercontent.com/u/1081932?v=3","gravatar_id":"","url":"https://api.github.com/users/albany551","html_url":"https://github.com/albany551","followers_url":"https://api.github.com/users/albany551/followers","following_url":"https://api.github.com/users/albany551/following{/other_user}","gists_url":"https://api.github.com/users/albany551/gists{/gist_id}","starred_url":"https://api.github.com/users/albany551/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/albany551/subscriptions","organizations_url":"https://api.github.com/users/albany551/orgs","repos_url":"https://api.github.com/users/albany551/repos","events_url":"https://api.github.com/users/albany551/events{/privacy}","received_events_url":"https://api.github.com/users/albany551/received_events","type":"User","site_admin":false},"body":"#### What does this PR do?\r\nReplaces the stubbed keyword search service used in catalog-ui-search with actual geonames.org data, completing the keyword search feature.\r\n- Geonames.org data are currently delivered from two different implementations. One uses an offline (local) index, the other makes http requests to geonames.org on the fly.\r\n- The interface these implementations currently live behind, `GeoCoder`, only returns a single (the top) result. To make an autocomplete UI possible, I've moved this functionality down to an existing and slightly lower-level interface, `GeoEntryQueryable`, that is able to return _n_ results.\r\n  - `GeoCoder` now only has a single implementation, `GazeteerGeoCoder`, whose job it is to take the first result from a `GeoEntryQueryable` service reference.\r\n  - The spatial-geocoding-localsearch bundle is gone, as everything it was previously doing is now accomplished by `GazeteerGeoCoder`.\r\n  - spatial-geocoding-websearch now implements the `GeoEntryQueryable` interface instead of the `GeoCoder` one.\r\n - An instance of `GeoEntryQueryable` is now what will be dependency-injected to switch between the local and web versions of the geonames.org service.\r\n\r\n#### Who is reviewing it (please choose AT LEAST two reviewers that need to approve the PR before it can get merged)?\r\n\r\n@jrnorth \r\n@rzwiefel \r\n@bdeining \r\n\r\n#### Choose 2 committers to review/merge the PR (please choose ONLY two committers from below, delete the rest).\r\n@millerw8\r\n@pklinef\r\n\r\n#### How should this be tested? (List steps with links to updated documentation)\r\n\r\n1. Open search UI and edit an existing search\r\n2. Choose \"Somewhere Specific\" for the \"Located\" field and select the \"Keyword\" tab.\r\n3. Search for a region, country, or city and select one. In the absence of a local index, relevant suggestions should be pulled live from geonames.org. For now, all results will be bounding box shapes.\r\n4. For the chosen geographical feature:\r\n   1. Ensure that its shape becomes visible on the map and the appropriate edit fields are shown (polygon field for a polygon, north/south/east/west for a bounding box, etc.).\r\n   2. Save the search, then edit it again. Ensure the the shape has been properly saved. (Note that by design bounding boxes get converted to polygons after saving).\r\n\r\n#### What are the relevant tickets?\r\n[](https://codice.atlassian.net/browse/DDF-3069)\r\n\r\n#### Checklist:\r\n- [ ] Documentation Updated\r\n- [ ] Change Log Updated\r\n- [x] Update / Add Unit Tests\r\n- [ ] Update / Add Integration Tests\r\n\r\n","created_at":"2017-06-20T18:18:23Z","updated_at":"2017-06-20T18:50:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"525a662c91c2b12686a4f920c49ed0d787575706","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/codice/ddf/pulls/2077/commits","review_comments_url":"https://api.github.com/repos/codice/ddf/pulls/2077/comments","review_comment_url":"https://api.github.com/repos/codice/ddf/pulls/comments{/number}","comments_url":"https://api.github.com/repos/codice/ddf/issues/2077/comments","statuses_url":"https://api.github.com/repos/codice/ddf/statuses/5b4fcf01f744c17750b0d595db27bc05d6e737fc","head":{"label":"albany551:DDF-3069-2","ref":"DDF-3069-2","sha":"5b4fcf01f744c17750b0d595db27bc05d6e737fc","user":{"login":"albany551","id":1081932,"avatar_url":"https://avatars3.githubusercontent.com/u/1081932?v=3","gravatar_id":"","url":"https://api.github.com/users/albany551","html_url":"https://github.com/albany551","followers_url":"https://api.github.com/users/albany551/followers","following_url":"https://api.github.com/users/albany551/following{/other_user}","gists_url":"https://api.github.com/users/albany551/gists{/gist_id}","starred_url":"https://api.github.com/users/albany551/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/albany551/subscriptions","organizations_url":"https://api.github.com/users/albany551/orgs","repos_url":"https://api.github.com/users/albany551/repos","events_url":"https://api.github.com/users/albany551/events{/privacy}","received_events_url":"https://api.github.com/users/albany551/received_events","type":"User","site_admin":false},"repo":{"id":93787800,"name":"ddf","full_name":"albany551/ddf","owner":{"login":"albany551","id":1081932,"avatar_url":"https://avatars3.githubusercontent.com/u/1081932?v=3","gravatar_id":"","url":"https://api.github.com/users/albany551","html_url":"https://github.com/albany551","followers_url":"https://api.github.com/users/albany551/followers","following_url":"https://api.github.com/users/albany551/following{/other_user}","gists_url":"https://api.github.com/users/albany551/gists{/gist_id}","starred_url":"https://api.github.com/users/albany551/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/albany551/subscriptions","organizations_url":"https://api.github.com/users/albany551/orgs","repos_url":"https://api.github.com/users/albany551/repos","events_url":"https://api.github.com/users/albany551/events{/privacy}","received_events_url":"https://api.github.com/users/albany551/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/albany551/ddf","description":"Distributed Data Framework - an open source, modular integration framework.","fork":true,"url":"https://api.github.com/repos/albany551/ddf","forks_url":"https://api.github.com/repos/albany551/ddf/forks","keys_url":"https://api.github.com/repos/albany551/ddf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/albany551/ddf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/albany551/ddf/teams","hooks_url":"https://api.github.com/repos/albany551/ddf/hooks","issue_events_url":"https://api.github.com/repos/albany551/ddf/issues/events{/number}","events_url":"https://api.github.com/repos/albany551/ddf/events","assignees_url":"https://api.github.com/repos/albany551/ddf/assignees{/user}","branches_url":"https://api.github.com/repos/albany551/ddf/branches{/branch}","tags_url":"https://api.github.com/repos/albany551/ddf/tags","blobs_url":"https://api.github.com/repos/albany551/ddf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/albany551/ddf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/albany551/ddf/git/refs{/sha}","trees_url":"https://api.github.com/repos/albany551/ddf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/albany551/ddf/statuses/{sha}","languages_url":"https://api.github.com/repos/albany551/ddf/languages","stargazers_url":"https://api.github.com/repos/albany551/ddf/stargazers","contributors_url":"https://api.github.com/repos/albany551/ddf/contributors","subscribers_url":"https://api.github.com/repos/albany551/ddf/subscribers","subscription_url":"https://api.github.com/repos/albany551/ddf/subscription","commits_url":"https://api.github.com/repos/albany551/ddf/commits{/sha}","git_commits_url":"https://api.github.com/repos/albany551/ddf/git/commits{/sha}","comments_url":"https://api.github.com/repos/albany551/ddf/comments{/number}","issue_comment_url":"https://api.github.com/repos/albany551/ddf/issues/comments{/number}","contents_url":"https://api.github.com/repos/albany551/ddf/contents/{+path}","compare_url":"https://api.github.com/repos/albany551/ddf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/albany551/ddf/merges","archive_url":"https://api.github.com/repos/albany551/ddf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/albany551/ddf/downloads","issues_url":"https://api.github.com/repos/albany551/ddf/issues{/number}","pulls_url":"https://api.github.com/repos/albany551/ddf/pulls{/number}","milestones_url":"https://api.github.com/repos/albany551/ddf/milestones{/number}","notifications_url":"https://api.github.com/repos/albany551/ddf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/albany551/ddf/labels{/name}","releases_url":"https://api.github.com/repos/albany551/ddf/releases{/id}","deployments_url":"https://api.github.com/repos/albany551/ddf/deployments","created_at":"2017-06-08T20:10:22Z","updated_at":"2017-06-08T20:10:40Z","pushed_at":"2017-06-20T18:36:14Z","git_url":"git://github.com/albany551/ddf.git","ssh_url":"git@github.com:albany551/ddf.git","clone_url":"https://github.com/albany551/ddf.git","svn_url":"https://github.com/albany551/ddf","homepage":"http://ddf.codice.org","size":319967,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"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":"master"}},"base":{"label":"codice:master","ref":"master","sha":"53d880c44d2a8170bf33556d91a64d2cb680e13a","user":{"login":"codice","id":2386734,"avatar_url":"https://avatars1.githubusercontent.com/u/2386734?v=3","gravatar_id":"","url":"https://api.github.com/users/codice","html_url":"https://github.com/codice","followers_url":"https://api.github.com/users/codice/followers","following_url":"https://api.github.com/users/codice/following{/other_user}","gists_url":"https://api.github.com/users/codice/gists{/gist_id}","starred_url":"https://api.github.com/users/codice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codice/subscriptions","organizations_url":"https://api.github.com/users/codice/orgs","repos_url":"https://api.github.com/users/codice/repos","events_url":"https://api.github.com/users/codice/events{/privacy}","received_events_url":"https://api.github.com/users/codice/received_events","type":"Organization","site_admin":false},"repo":{"id":15173563,"name":"ddf","full_name":"codice/ddf","owner":{"login":"codice","id":2386734,"avatar_url":"https://avatars1.githubusercontent.com/u/2386734?v=3","gravatar_id":"","url":"https://api.github.com/users/codice","html_url":"https://github.com/codice","followers_url":"https://api.github.com/users/codice/followers","following_url":"https://api.github.com/users/codice/following{/other_user}","gists_url":"https://api.github.com/users/codice/gists{/gist_id}","starred_url":"https://api.github.com/users/codice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codice/subscriptions","organizations_url":"https://api.github.com/users/codice/orgs","repos_url":"https://api.github.com/users/codice/repos","events_url":"https://api.github.com/users/codice/events{/privacy}","received_events_url":"https://api.github.com/users/codice/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/codice/ddf","description":"Distributed Data Framework - an open source, modular integration framework.","fork":false,"url":"https://api.github.com/repos/codice/ddf","forks_url":"https://api.github.com/repos/codice/ddf/forks","keys_url":"https://api.github.com/repos/codice/ddf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codice/ddf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codice/ddf/teams","hooks_url":"https://api.github.com/repos/codice/ddf/hooks","issue_events_url":"https://api.github.com/repos/codice/ddf/issues/events{/number}","events_url":"https://api.github.com/repos/codice/ddf/events","assignees_url":"https://api.github.com/repos/codice/ddf/assignees{/user}","branches_url":"https://api.github.com/repos/codice/ddf/branches{/branch}","tags_url":"https://api.github.com/repos/codice/ddf/tags","blobs_url":"https://api.github.com/repos/codice/ddf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codice/ddf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codice/ddf/git/refs{/sha}","trees_url":"https://api.github.com/repos/codice/ddf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codice/ddf/statuses/{sha}","languages_url":"https://api.github.com/repos/codice/ddf/languages","stargazers_url":"https://api.github.com/repos/codice/ddf/stargazers","contributors_url":"https://api.github.com/repos/codice/ddf/contributors","subscribers_url":"https://api.github.com/repos/codice/ddf/subscribers","subscription_url":"https://api.github.com/repos/codice/ddf/subscription","commits_url":"https://api.github.com/repos/codice/ddf/commits{/sha}","git_commits_url":"https://api.github.com/repos/codice/ddf/git/commits{/sha}","comments_url":"https://api.github.com/repos/codice/ddf/comments{/number}","issue_comment_url":"https://api.github.com/repos/codice/ddf/issues/comments{/number}","contents_url":"https://api.github.com/repos/codice/ddf/contents/{+path}","compare_url":"https://api.github.com/repos/codice/ddf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codice/ddf/merges","archive_url":"https://api.github.com/repos/codice/ddf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codice/ddf/downloads","issues_url":"https://api.github.com/repos/codice/ddf/issues{/number}","pulls_url":"https://api.github.com/repos/codice/ddf/pulls{/number}","milestones_url":"https://api.github.com/repos/codice/ddf/milestones{/number}","notifications_url":"https://api.github.com/repos/codice/ddf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codice/ddf/labels{/name}","releases_url":"https://api.github.com/repos/codice/ddf/releases{/id}","deployments_url":"https://api.github.com/repos/codice/ddf/deployments","created_at":"2013-12-13T20:38:28Z","updated_at":"2017-04-12T02:00:28Z","pushed_at":"2017-06-20T18:36:16Z","git_url":"git://github.com/codice/ddf.git","ssh_url":"git@github.com:codice/ddf.git","clone_url":"https://github.com/codice/ddf.git","svn_url":"https://github.com/codice/ddf","homepage":"http://ddf.codice.org","size":322247,"stargazers_count":59,"watchers_count":59,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":112,"mirror_url":null,"open_issues_count":28,"forks":112,"open_issues":28,"watchers":59,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/codice/ddf/pulls/2077"},"html":{"href":"https://github.com/codice/ddf/pull/2077"},"issue":{"href":"https://api.github.com/repos/codice/ddf/issues/2077"},"comments":{"href":"https://api.github.com/repos/codice/ddf/issues/2077/comments"},"review_comments":{"href":"https://api.github.com/repos/codice/ddf/pulls/2077/comments"},"review_comment":{"href":"https://api.github.com/repos/codice/ddf/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/codice/ddf/pulls/2077/commits"},"statuses":{"href":"https://api.github.com/repos/codice/ddf/statuses/5b4fcf01f744c17750b0d595db27bc05d6e737fc"}}}}
{"actor":{"display_login":"bdeining"}}