{"action":"created","issue":{"url":"https://api.github.com/repos/twain47/Nominatim/issues/389","repository_url":"https://api.github.com/repos/twain47/Nominatim","labels_url":"https://api.github.com/repos/twain47/Nominatim/issues/389/labels{/name}","comments_url":"https://api.github.com/repos/twain47/Nominatim/issues/389/comments","events_url":"https://api.github.com/repos/twain47/Nominatim/issues/389/events","html_url":"https://github.com/twain47/Nominatim/pull/389","id":138564987,"number":389,"title":"Reverse geocode include geometry (v2)","user":{"login":"mtmail","id":3727288,"avatar_url":"https://avatars.githubusercontent.com/u/3727288?v=3","gravatar_id":"","url":"https://api.github.com/users/mtmail","html_url":"https://github.com/mtmail","followers_url":"https://api.github.com/users/mtmail/followers","following_url":"https://api.github.com/users/mtmail/following{/other_user}","gists_url":"https://api.github.com/users/mtmail/gists{/gist_id}","starred_url":"https://api.github.com/users/mtmail/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mtmail/subscriptions","organizations_url":"https://api.github.com/users/mtmail/orgs","repos_url":"https://api.github.com/users/mtmail/repos","events_url":"https://api.github.com/users/mtmail/events{/privacy}","received_events_url":"https://api.github.com/users/mtmail/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-04T19:32:43Z","updated_at":"2016-03-08T20:45:07Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/twain47/Nominatim/pulls/389","html_url":"https://github.com/twain47/Nominatim/pull/389","diff_url":"https://github.com/twain47/Nominatim/pull/389.diff","patch_url":"https://github.com/twain47/Nominatim/pull/389.patch"},"body":"[ squaching (git rebase -i) failed miserably, thus I rather create a new pull request\r\n@lonvia's feedback is incorporated:\r\n- rebased to latest master branch\r\n- disabled &polygon=1 for reverse search, adjusted tests\r\n- cleaned up empty lines\r\n- skip bounding box array creation if variable is already an array\r\n- added space after comma where needed. I favor that, too.\r\n]\r\n\r\nThis adds support for `&polygon_kml`, `&polygon_svg=1` `&polygon_geojson=1`, `&polygon_text=1` to the reverse lookup. `&polygon_threshold=` for polygon simplification and the `CONST_PolygonOutput_MaximumTypes` setting is observed/supported.\r\n\r\nAdded relevant test for forward and reverse search. PHP and Python tests pass.\r\n\r\nEven without the `&polygon*` parameters we now try to add a `boundingbox` element to the output.\r\n\r\nAs before if `CONST_Search_AreaPolygons` isn't set to `true` the bounding box gets calculated using a configured radius which is based on place class and type.\r\n\r\nIn the past when the result was a node we calculated the polygon-as-text (`$aPolyPoints`) differently depending on the `CONST_Search_AreaPolygons` setting. If set to `true` the logic was\r\n\r\n    $iSteps = max(8,min(100,$fRadius * 3.14 * 100000));\r\n    $fStepSize = (2*pi())/$iSteps;\r\n\r\n... if not set the logic was ...\r\n\r\n    $iSteps = max(8, min(100, ($fRadius * 40000)^2));\r\n    $fStepSize = (2*pi())/$iSteps;\r\n\r\nNow we always use the former because it was likely used more often in production.\r\n\r\nWhen a `&polygon*` parameter is set we already did one additional database query for each result to fetch its geometry during forward search. For reverse search we now also have an additional database query.\r\n \r\nThe HTML details page already got the geometry from a direct SQL query so there was no change needed.\r\n"},"comment":{"url":"https://api.github.com/repos/twain47/Nominatim/issues/comments/193959473","html_url":"https://github.com/twain47/Nominatim/pull/389#issuecomment-193959473","issue_url":"https://api.github.com/repos/twain47/Nominatim/issues/389","id":193959473,"user":{"login":"lonvia","id":1447941,"avatar_url":"https://avatars.githubusercontent.com/u/1447941?v=3","gravatar_id":"","url":"https://api.github.com/users/lonvia","html_url":"https://github.com/lonvia","followers_url":"https://api.github.com/users/lonvia/followers","following_url":"https://api.github.com/users/lonvia/following{/other_user}","gists_url":"https://api.github.com/users/lonvia/gists{/gist_id}","starred_url":"https://api.github.com/users/lonvia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lonvia/subscriptions","organizations_url":"https://api.github.com/users/lonvia/orgs","repos_url":"https://api.github.com/users/lonvia/repos","events_url":"https://api.github.com/users/lonvia/events{/privacy}","received_events_url":"https://api.github.com/users/lonvia/received_events","type":"User","site_admin":false},"created_at":"2016-03-08T20:45:07Z","updated_at":"2016-03-08T20:45:07Z","body":"Looks almost good to go. Just one minor thing that looks like a bug and makes me wonder: do we have tests for bounding box output in the lettuce test part?"}}