{"action":"created","issue":{"url":"https://api.github.com/repos/gravitystorm/openstreetmap-carto/issues/2199","repository_url":"https://api.github.com/repos/gravitystorm/openstreetmap-carto","labels_url":"https://api.github.com/repos/gravitystorm/openstreetmap-carto/issues/2199/labels{/name}","comments_url":"https://api.github.com/repos/gravitystorm/openstreetmap-carto/issues/2199/comments","events_url":"https://api.github.com/repos/gravitystorm/openstreetmap-carto/issues/2199/events","html_url":"https://github.com/gravitystorm/openstreetmap-carto/issues/2199","id":162301289,"number":2199,"title":"do not display borders between national parks on lower zoom levels","user":{"login":"matkoniecz","id":899988,"avatar_url":"https://avatars.githubusercontent.com/u/899988?v=3","gravatar_id":"","url":"https://api.github.com/users/matkoniecz","html_url":"https://github.com/matkoniecz","followers_url":"https://api.github.com/users/matkoniecz/followers","following_url":"https://api.github.com/users/matkoniecz/following{/other_user}","gists_url":"https://api.github.com/users/matkoniecz/gists{/gist_id}","starred_url":"https://api.github.com/users/matkoniecz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matkoniecz/subscriptions","organizations_url":"https://api.github.com/users/matkoniecz/orgs","repos_url":"https://api.github.com/users/matkoniecz/repos","events_url":"https://api.github.com/users/matkoniecz/events{/privacy}","received_events_url":"https://api.github.com/users/matkoniecz/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"matkoniecz","id":899988,"avatar_url":"https://avatars.githubusercontent.com/u/899988?v=3","gravatar_id":"","url":"https://api.github.com/users/matkoniecz","html_url":"https://github.com/matkoniecz","followers_url":"https://api.github.com/users/matkoniecz/followers","following_url":"https://api.github.com/users/matkoniecz/following{/other_user}","gists_url":"https://api.github.com/users/matkoniecz/gists{/gist_id}","starred_url":"https://api.github.com/users/matkoniecz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matkoniecz/subscriptions","organizations_url":"https://api.github.com/users/matkoniecz/orgs","repos_url":"https://api.github.com/users/matkoniecz/repos","events_url":"https://api.github.com/users/matkoniecz/events{/privacy}","received_events_url":"https://api.github.com/users/matkoniecz/received_events","type":"User","site_admin":false},"assignees":[{"login":"matkoniecz","id":899988,"avatar_url":"https://avatars.githubusercontent.com/u/899988?v=3","gravatar_id":"","url":"https://api.github.com/users/matkoniecz","html_url":"https://github.com/matkoniecz","followers_url":"https://api.github.com/users/matkoniecz/followers","following_url":"https://api.github.com/users/matkoniecz/following{/other_user}","gists_url":"https://api.github.com/users/matkoniecz/gists{/gist_id}","starred_url":"https://api.github.com/users/matkoniecz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matkoniecz/subscriptions","organizations_url":"https://api.github.com/users/matkoniecz/orgs","repos_url":"https://api.github.com/users/matkoniecz/repos","events_url":"https://api.github.com/users/matkoniecz/events{/privacy}","received_events_url":"https://api.github.com/users/matkoniecz/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/gravitystorm/openstreetmap-carto/milestones/3","html_url":"https://github.com/gravitystorm/openstreetmap-carto/milestones/Bugs%20and%20improvements","labels_url":"https://api.github.com/repos/gravitystorm/openstreetmap-carto/milestones/3/labels","id":804552,"number":3,"title":"Bugs and improvements","description":"","creator":{"login":"math1985","id":5251909,"avatar_url":"https://avatars.githubusercontent.com/u/5251909?v=3","gravatar_id":"","url":"https://api.github.com/users/math1985","html_url":"https://github.com/math1985","followers_url":"https://api.github.com/users/math1985/followers","following_url":"https://api.github.com/users/math1985/following{/other_user}","gists_url":"https://api.github.com/users/math1985/gists{/gist_id}","starred_url":"https://api.github.com/users/math1985/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/math1985/subscriptions","organizations_url":"https://api.github.com/users/math1985/orgs","repos_url":"https://api.github.com/users/math1985/repos","events_url":"https://api.github.com/users/math1985/events{/privacy}","received_events_url":"https://api.github.com/users/math1985/received_events","type":"User","site_admin":false},"open_issues":242,"closed_issues":318,"state":"open","created_at":"2014-09-26T17:37:22Z","updated_at":"2016-06-26T21:31:28Z","due_on":null,"closed_at":null},"comments":13,"created_at":"2016-06-25T21:51:36Z","updated_at":"2016-06-26T21:31:28Z","closed_at":"2016-06-26T21:31:28Z","body":"In some regions there are multiple joining national parks. Western USA is the most impressive, with many protected areas covering significant area with byzantine shapes and topology.\r\n\r\nFor example in this area where national park borders seems to be drawn by Elbridge Gerry everything is anyway inside a protected area.\r\n![selection_007](https://cloud.githubusercontent.com/assets/899988/16359173/a4d1e90c-3b2a-11e6-8a14-15e0f51fea7d.png)\r\n\r\nAs result both on high and low zoom levels is quite bad.\r\n![selection_009](https://cloud.githubusercontent.com/assets/899988/16359184/09e13f1e-3b2b-11e6-8d23-132bdcf95cdb.png)\r\n\r\nThis is not limited to the USA. For example - http://www.openstreetmap.org/#map=7/48.247/24.587 is area where Slovenia, Ukraine and Poland have five joining protected areas.\r\n\r\n![selection_010](https://cloud.githubusercontent.com/assets/899988/16359197/babecbb2-3b2b-11e6-965e-c6a2c2669537.png)\r\n\r\nNote that many joining national parks are curently badly mapped as not joined, so there are some rendering artefacts caused by poor tagging. This effect is welcome rather than a problem but it makes testing harder.\r\n\r\nhttp://www.openstreetmap.org/#map=17/52.57878/14.63135\r\n\r\n![selection_011](https://cloud.githubusercontent.com/assets/899988/16359212/40a543b4-3b2c-11e6-81f4-0b71296c8e92.png)\r\n\r\nOn higher zoom levels it makes sense to display borders also between joining protected areas, it is open question what should be choosen as threshold (currently in proof of concept all joining borders are eliminated).\r\n\r\nI developed it as part of a more complex change, but it stands well also on its own.\r\n\r\nI submit it as a issue, not PR as I have only a proof of concept. SQL query is partially a massive HACK/TODO and there are some suspicious rendering articacts (I submitting it anyway, as after days of battling with pg_hba.conf, qgis etc it finally works)).\r\n\r\nMy code used to generate before/after below is at https://github.com/matkoniecz/openstreetmap-carto/commit/3f05be36ace1605b7dc5f53662e4dbfc1ce8d8d5 (updated code is at https://github.com/gravitystorm/openstreetmap-carto/compare/master...matkoniecz:dissolve_national_parks_proof_of_concept?expand=1)\r\n\r\nI will now look for way to correctly compute way_pixels (in case that it is obvious for somebody - comments/hints are welcomed).\r\n\r\nIn regions like UK with sensible structure of protected areas it should have no noticeable change.\r\n\r\nThere are some negatives effects - obviously it hides some data about structure of protected areas and is a performance hit.\r\n\r\nbefore/after\r\n\r\n![on entire_world 37 41499 -111 55294 7 10 master - dissolve 300px kosmtik_mapnik_reference default_](https://cloud.githubusercontent.com/assets/899988/16359314/b018ed10-3b2f-11e6-9ab8-6af21243b484.png)\r\n\r\nhere tagging mistakes ale clearly visible:\r\n![on entire_world 49 0907 22 5646 7 10 master - dissolve 300px tilemill_mapnik_reference default_](https://cloud.githubusercontent.com/assets/899988/16359315/b19bb14a-3b2f-11e6-84d9-03778f51fe3b.png)\r\nhttps://cloud.githubusercontent.com/assets/899988/16359316/b3aaaec8-3b2f-11e6-8b25-3ca418feeb44.png\r\n"},"comment":{"url":"https://api.github.com/repos/gravitystorm/openstreetmap-carto/issues/comments/228624233","html_url":"https://github.com/gravitystorm/openstreetmap-carto/issues/2199#issuecomment-228624233","issue_url":"https://api.github.com/repos/gravitystorm/openstreetmap-carto/issues/2199","id":228624233,"user":{"login":"matkoniecz","id":899988,"avatar_url":"https://avatars.githubusercontent.com/u/899988?v=3","gravatar_id":"","url":"https://api.github.com/users/matkoniecz","html_url":"https://github.com/matkoniecz","followers_url":"https://api.github.com/users/matkoniecz/followers","following_url":"https://api.github.com/users/matkoniecz/following{/other_user}","gists_url":"https://api.github.com/users/matkoniecz/gists{/gist_id}","starred_url":"https://api.github.com/users/matkoniecz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matkoniecz/subscriptions","organizations_url":"https://api.github.com/users/matkoniecz/orgs","repos_url":"https://api.github.com/users/matkoniecz/repos","events_url":"https://api.github.com/users/matkoniecz/events{/privacy}","received_events_url":"https://api.github.com/users/matkoniecz/received_events","type":"User","site_admin":false},"created_at":"2016-06-26T21:31:28Z","updated_at":"2016-06-26T21:31:28Z","body":"> ST_Area is in projected units.\r\n\r\nThabks for the info!\r\n\r\n> The problem is the ST_Dump.\r\n\r\nWhat about such query? It is ugly, but it works.\r\n\r\n```\r\n        (SELECT\r\n            way,\r\n            NULL AS name,\r\n            'national_park' AS boundary,\r\n            ST_Area(way) AS way_pixels\r\n          FROM (\r\n            SELECT\r\n              (ST_Dump( ST_Union( way ) )).geom AS way,\r\n              NULL AS name,\r\n              'national_park' AS boundary,\r\n              10000 AS way_pixels\r\n            FROM (\r\n              SELECT\r\n                way,\r\n                boundary\r\n              FROM planet_osm_polygon\r\n              WHERE (boundary = 'national_park' OR leisure = 'nature_reserve')\r\n                  AND ST_Intersects(way, !bbox!)\r\n                  AND building IS NULL\r\n                  AND way_area > 0.01*!pixel_width!::real*!pixel_height!::real\r\n            ) AS unmerged_polygons\r\n          ) AS merged_polygons\r\n        ) AS national_park_boundaries\r\n```"}}
{"actor":{"display_login":"matkoniecz"}}