{"action":"created","issue":{"url":"https://api.github.com/repos/darold/ora2pg/issues/138","labels_url":"https://api.github.com/repos/darold/ora2pg/issues/138/labels{/name}","comments_url":"https://api.github.com/repos/darold/ora2pg/issues/138/comments","events_url":"https://api.github.com/repos/darold/ora2pg/issues/138/events","html_url":"https://github.com/darold/ora2pg/issues/138","id":107921250,"number":138,"title":"Importing invalid geometries","user":{"login":"Rokko11","id":3337927,"avatar_url":"https://avatars.githubusercontent.com/u/3337927?v=3","gravatar_id":"","url":"https://api.github.com/users/Rokko11","html_url":"https://github.com/Rokko11","followers_url":"https://api.github.com/users/Rokko11/followers","following_url":"https://api.github.com/users/Rokko11/following{/other_user}","gists_url":"https://api.github.com/users/Rokko11/gists{/gist_id}","starred_url":"https://api.github.com/users/Rokko11/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rokko11/subscriptions","organizations_url":"https://api.github.com/users/Rokko11/orgs","repos_url":"https://api.github.com/users/Rokko11/repos","events_url":"https://api.github.com/users/Rokko11/events{/privacy}","received_events_url":"https://api.github.com/users/Rokko11/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-09-23T13:37:01Z","updated_at":"2015-09-28T06:47:45Z","closed_at":"2015-09-28T06:47:45Z","body":"Hi!\r\n\r\nI have some non-closed polygons in my Oracle-db and want to transfer them to Postgres.\r\n\r\nI use a DATA_LIMIT of 10000, but in every chunk there seems to be at least one invalid row.\r\n```\r\nHINT:  \"...01616 49.123456, 9.123456 49.123456),\" <-- parse error at position 2599 within geometry\r\nERROR (log error enabled): ERROR:  geometry contains non-closed rings\r\n```\r\n\r\nIs it possible to make them valid on runtime?\r\nIs it possible to import them invalid and make them valid with sql\r\n\r\nOr do I have to correct them in the source first?\r\n\r\nRegards,\r\nRokko"},"comment":{"url":"https://api.github.com/repos/darold/ora2pg/issues/comments/143653788","html_url":"https://github.com/darold/ora2pg/issues/138#issuecomment-143653788","issue_url":"https://api.github.com/repos/darold/ora2pg/issues/138","id":143653788,"user":{"login":"Rokko11","id":3337927,"avatar_url":"https://avatars.githubusercontent.com/u/3337927?v=3","gravatar_id":"","url":"https://api.github.com/users/Rokko11","html_url":"https://github.com/Rokko11","followers_url":"https://api.github.com/users/Rokko11/followers","following_url":"https://api.github.com/users/Rokko11/following{/other_user}","gists_url":"https://api.github.com/users/Rokko11/gists{/gist_id}","starred_url":"https://api.github.com/users/Rokko11/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rokko11/subscriptions","organizations_url":"https://api.github.com/users/Rokko11/orgs","repos_url":"https://api.github.com/users/Rokko11/repos","events_url":"https://api.github.com/users/Rokko11/events{/privacy}","received_events_url":"https://api.github.com/users/Rokko11/received_events","type":"User","site_admin":false},"created_at":"2015-09-28T06:47:45Z","updated_at":"2015-09-28T06:47:45Z","body":"Hi!\r\n\r\nNo, there aren't any constraints on the table. Just one primary_key and one gist-index on the geometry-column.\r\n\r\nMy workaround now is:\r\n- Dumping the copy-statements into a sql-File\r\n- Transforming invalid geometries into valid ones via `sed`-command\r\n\r\n  ```\r\nsed -i 's/\\((\\)\\([0-9. -]*\\)\\(, [^)]*\\)/\\1\\2\\3, \\2/g' table_data.sql\r\nPolygon (a,b,c,d,e,f) -> Polygon (a,b,c,d,e,f,a,b)\r\n```\r\n- Importing into postgres-Database.\r\n\r\nRegards,\r\nRokko"}}