{"action":"created","issue":{"url":"https://api.github.com/repos/3liz/QgisCadastrePlugin/issues/143","repository_url":"https://api.github.com/repos/3liz/QgisCadastrePlugin","labels_url":"https://api.github.com/repos/3liz/QgisCadastrePlugin/issues/143/labels{/name}","comments_url":"https://api.github.com/repos/3liz/QgisCadastrePlugin/issues/143/comments","events_url":"https://api.github.com/repos/3liz/QgisCadastrePlugin/issues/143/events","html_url":"https://github.com/3liz/QgisCadastrePlugin/issues/143","id":348240763,"node_id":"MDU6SXNzdWUzNDgyNDA3NjM=","number":143,"title":"doublons dans la table geo_parcelle","user":{"login":"landryb","id":3421760,"node_id":"MDQ6VXNlcjM0MjE3NjA=","avatar_url":"https://avatars3.githubusercontent.com/u/3421760?v=4","gravatar_id":"","url":"https://api.github.com/users/landryb","html_url":"https://github.com/landryb","followers_url":"https://api.github.com/users/landryb/followers","following_url":"https://api.github.com/users/landryb/following{/other_user}","gists_url":"https://api.github.com/users/landryb/gists{/gist_id}","starred_url":"https://api.github.com/users/landryb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/landryb/subscriptions","organizations_url":"https://api.github.com/users/landryb/orgs","repos_url":"https://api.github.com/users/landryb/repos","events_url":"https://api.github.com/users/landryb/events{/privacy}","received_events_url":"https://api.github.com/users/landryb/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-07T09:30:41Z","updated_at":"2018-08-09T05:53:03Z","closed_at":null,"author_association":"NONE","body":"Cf georchestra/cadastrapp#408, et probablement lié au commit 549a1a36 dans le modèle QGIS, j'ai des doublons à l'import dans la table `geo_parcelle`.\r\n\r\n```\r\n[db:5432] qadastre@qadastre=> select count(geo_parcelle),count(distinct(geo_parcelle)) from qad2018.geo_parcelle where geo_parcelle like '2018630216%';\r\n count | count\r\n-------+-------\r\n   357 |   320\r\n\r\n[db:5432] qadastre@qadastre=> select count(parcelle) from qad2018.parcelle where parcelle like '2018630216%';\r\n   320\r\n```\r\n\r\nSuite à ce commit je pense qu'il manque un DISTINCT ici: https://github.com/3liz/QgisCadastrePlugin/blob/master/scripts/plugin/edigeo_formatage_donnees.sql#L80\r\n\r\nsi je l'ajoute, j'ai bien le même nombre de parcelles dans les tables `parcelle` et `geo_parcelle`.\r\n```\r\n[db:5432] qadastre@qadastre=> select count(geo_parcelle),count(distinct(geo_parcelle)) from qad2018_63216.geo_parcelle;\r\ncount | count\r\n-------+-------\r\n   320 |   320\r\n```\r\nTout cela n'arriverait pas s'il y'avait des clefs primaires sur ces tables...\r\n\r\nJe ne suis pas 100% certain que ce soit le bon correctif, mais dans tous les cas il y'a un souci à régler :)"},"comment":{"url":"https://api.github.com/repos/3liz/QgisCadastrePlugin/issues/comments/411644989","html_url":"https://github.com/3liz/QgisCadastrePlugin/issues/143#issuecomment-411644989","issue_url":"https://api.github.com/repos/3liz/QgisCadastrePlugin/issues/143","id":411644989,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMTY0NDk4OQ==","user":{"login":"landryb","id":3421760,"node_id":"MDQ6VXNlcjM0MjE3NjA=","avatar_url":"https://avatars3.githubusercontent.com/u/3421760?v=4","gravatar_id":"","url":"https://api.github.com/users/landryb","html_url":"https://github.com/landryb","followers_url":"https://api.github.com/users/landryb/followers","following_url":"https://api.github.com/users/landryb/following{/other_user}","gists_url":"https://api.github.com/users/landryb/gists{/gist_id}","starred_url":"https://api.github.com/users/landryb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/landryb/subscriptions","organizations_url":"https://api.github.com/users/landryb/orgs","repos_url":"https://api.github.com/users/landryb/repos","events_url":"https://api.github.com/users/landryb/events{/privacy}","received_events_url":"https://api.github.com/users/landryb/received_events","type":"User","site_admin":false},"created_at":"2018-08-09T05:53:03Z","updated_at":"2018-08-09T05:53:03Z","author_association":"NONE","body":"Avec ma PR, il n'y a a priori plus de doublons dans les tables `geo_parcelle` et `parcelle_info` après l'import de 2 départements:\r\n```\r\n[db:5432] qadastre@qadastre=> select lot, count(geo_parcelle), count(distinct(geo_parcelle)) from qad2018.geo_parcelle group by lot;\r\n  lot  |  count  |  count\r\n-------+---------+---------\r\n dep01 | 1329585 | 1329585\r\n dep03 |  718388 |  718378\r\n\r\n[db:5432] qadastre@qadastre=> select lot, count(geo_parcelle), count(distinct(geo_parcelle)) from qad2018.parcelle_info group by lot;\r\n  lot  |  count  |  count\r\n-------+---------+---------\r\n dep01 | 1329585 | 1329585\r\n dep03 |  718388 |  718378\r\n```"}}
{"actor":{"display_login":"landryb"}}