{"action":"created","issue":{"url":"https://api.github.com/repos/chronoscio/backend/issues/53","repository_url":"https://api.github.com/repos/chronoscio/backend","labels_url":"https://api.github.com/repos/chronoscio/backend/issues/53/labels{/name}","comments_url":"https://api.github.com/repos/chronoscio/backend/issues/53/comments","events_url":"https://api.github.com/repos/chronoscio/backend/issues/53/events","html_url":"https://github.com/chronoscio/backend/issues/53","id":368880281,"node_id":"MDU6SXNzdWUzNjg4ODAyODE=","number":53,"title":"Atomic `Polygon` model","user":{"login":"amaurymartiny","id":1293565,"node_id":"MDQ6VXNlcjEyOTM1NjU=","avatar_url":"https://avatars0.githubusercontent.com/u/1293565?v=4","gravatar_id":"","url":"https://api.github.com/users/amaurymartiny","html_url":"https://github.com/amaurymartiny","followers_url":"https://api.github.com/users/amaurymartiny/followers","following_url":"https://api.github.com/users/amaurymartiny/following{/other_user}","gists_url":"https://api.github.com/users/amaurymartiny/gists{/gist_id}","starred_url":"https://api.github.com/users/amaurymartiny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amaurymartiny/subscriptions","organizations_url":"https://api.github.com/users/amaurymartiny/orgs","repos_url":"https://api.github.com/users/amaurymartiny/repos","events_url":"https://api.github.com/users/amaurymartiny/events{/privacy}","received_events_url":"https://api.github.com/users/amaurymartiny/received_events","type":"User","site_admin":false},"labels":[{"id":998093489,"node_id":"MDU6TGFiZWw5OTgwOTM0ODk=","url":"https://api.github.com/repos/chronoscio/backend/labels/kind/proposal","name":"kind/proposal","color":"006b75","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2018-10-10T22:27:12Z","updated_at":"2018-10-25T08:43:21Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"Proposed by @wtokumaru in #26:\r\n\r\n> Can we separate the geojson data from the Territory and have it as a separate Polygon (or whatever) Entity that different territories can point to (like how they point to a Nation/PoliticalEntity)? We need this in order to avoid having like 20 Belaruses or Romes or Alsace-Loraines. Even the notion of a territory being something that trades hands or an administrative border/subdividision retained between social changes inherently can not be not limited to a single continuous time range...\r\n\r\nThis model would have the following fields:\r\n- id\r\n- name\r\n- geometry (geojson field)\r\n- references\r\n\r\nI personally like this idea. I had in mind to create a new Territory each time a PoliticalEntity changes borders, thinking that some geojson will be duplicate, but it's okay b/c db storage is cheap. But if we want a clean solution, this is definitely the way to go.\r\n\r\nWe will create a small collection of all known atomic territories, and future mappers can just pick&assemble them to build Territories.\r\n\r\nNote: This corresponds exactly to CIDOC's http://www.cidoc-crm.org/Entity/E94-Space-Primitive/Version-6.2.\r\n\r\n---\r\n\r\nProblems:\r\n\r\n1. Once we have a small collection of Polygons, how to efficiently search through them?\r\n    - We'll have a `name` field, but it can be duplicate, is not precise etc...\r\n    - If the search algorithm is not performant, mappers will create duplicate polygons, and we'll have polygons that are 99% similar.\r\n2. If I want to create the Territory of France today in 2018, probably I'll find the Polygons of the 101 departments in our collection. So UX-wise, I basically need to search/click on 101 items? (possibly more, if the department is not the most atomic polygon)"},"comment":{"url":"https://api.github.com/repos/chronoscio/backend/issues/comments/432965766","html_url":"https://github.com/chronoscio/backend/issues/53#issuecomment-432965766","issue_url":"https://api.github.com/repos/chronoscio/backend/issues/53","id":432965766,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMjk2NTc2Ng==","user":{"login":"amaurymartiny","id":1293565,"node_id":"MDQ6VXNlcjEyOTM1NjU=","avatar_url":"https://avatars0.githubusercontent.com/u/1293565?v=4","gravatar_id":"","url":"https://api.github.com/users/amaurymartiny","html_url":"https://github.com/amaurymartiny","followers_url":"https://api.github.com/users/amaurymartiny/followers","following_url":"https://api.github.com/users/amaurymartiny/following{/other_user}","gists_url":"https://api.github.com/users/amaurymartiny/gists{/gist_id}","starred_url":"https://api.github.com/users/amaurymartiny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amaurymartiny/subscriptions","organizations_url":"https://api.github.com/users/amaurymartiny/orgs","repos_url":"https://api.github.com/users/amaurymartiny/repos","events_url":"https://api.github.com/users/amaurymartiny/events{/privacy}","received_events_url":"https://api.github.com/users/amaurymartiny/received_events","type":"User","site_admin":false},"created_at":"2018-10-25T08:43:21Z","updated_at":"2018-10-25T08:43:21Z","author_association":"CONTRIBUTOR","body":"As @wtokumaru pointed out, I think that this solution is \"at least as good, but most probably better\" than the current implementation:\r\n- right now we duplicate geojsons no matter what\r\n- if we implement this, we might have duplicate atomic polygons. The better we make the search algorithm, the less we have duplicates. With some stitching cache proposed by @wtokumaru, it shouldn't even hurt query performance.\r\n- On the long-term, it's easier to ask this data questions: \"how many time has Alsace-Lorraine changed hands between 1850-1950\"?\r\n\r\nUX proposal: when the mapper creates the polygon for a political entity, he can hover his mouse over an empty area on the map, right-click and select \"Search for territories here\", and it would show on the left-pane all territories that covers that particular lat/lng point. The mapper can then just select the territory he wants to add to this political entity. Repeat until all the political entity is covered. tldr: I think we can find some UX solutions.\r\n\r\nSo overall, I'm in favor on implementing this."}}
{"actor":{"display_login":"amaurymartiny"}}