{"action":"created","issue":{"url":"https://api.github.com/repos/rgeo/rgeo-geojson/issues/10","labels_url":"https://api.github.com/repos/rgeo/rgeo-geojson/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/rgeo/rgeo-geojson/issues/10/comments","events_url":"https://api.github.com/repos/rgeo/rgeo-geojson/issues/10/events","html_url":"https://github.com/rgeo/rgeo-geojson/issues/10","id":55539943,"number":10,"title":"Problem with decode and polygon","user":{"login":"pankas87","id":3855195,"avatar_url":"https://avatars.githubusercontent.com/u/3855195?v=3","gravatar_id":"","url":"https://api.github.com/users/pankas87","html_url":"https://github.com/pankas87","followers_url":"https://api.github.com/users/pankas87/followers","following_url":"https://api.github.com/users/pankas87/following{/other_user}","gists_url":"https://api.github.com/users/pankas87/gists{/gist_id}","starred_url":"https://api.github.com/users/pankas87/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pankas87/subscriptions","organizations_url":"https://api.github.com/users/pankas87/orgs","repos_url":"https://api.github.com/users/pankas87/repos","events_url":"https://api.github.com/users/pankas87/events{/privacy}","received_events_url":"https://api.github.com/users/pankas87/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-26T21:26:57Z","updated_at":"2015-01-26T21:49:18Z","closed_at":null,"body":"I have a valid GeoJSON polygon which I checked using the [GeoJSON Lint service](http://geojsonlint.com/ \"GeoJSON Lint\").\r\n\r\nIt is displayed perfectly in Google Maps, using the data.addGeoJson() method.\r\n\r\nBut when I try to decode it using\r\n\r\n    RGeo::GeoJSON.decode(polygon_json, :json_parser => :json)\r\n\r\nI get a nil geometry. I have tried a lot of stuff but can get it to work correctly. Here's the GeoJSON polygon I'm trying to decode\r\n\r\n    {\r\n      \"geometry\": {\r\n        \"type\": \"Polygon\",\r\n        \"coordinates\": [\r\n          [\r\n            [\r\n              -69.30999755859375,\r\n              -33.610044573695632\r\n            ],\r\n            [\r\n              -69.54620361328125,\r\n              -33.89321737944087\r\n            ],\r\n            [\r\n              -68.95294189453125,\r\n              -33.749464192325767\r\n            ],\r\n            [\r\n              -69.1094970703125,\r\n              -33.982086259019368\r\n            ],\r\n            [\r\n              -69.30999755859375,\r\n              -33.610044573695632\r\n            ]\r\n          ]\r\n        ]\r\n      },\r\n      \"type\": \"Feature\",\r\n      \"properties\": {\r\n        \"Campo 1 (Texto)\": null,\r\n        \"gx_id\": \"undefined-undefined-1422304622752\",\r\n        \"Campo 3 (Num\\u00e9rico)\": null,\r\n        \"Campo 2 (Texto)\": null\r\n      }\r\n    }\r\n\r\nThe problem is not specific to this polygon, it happens with any polygon which has lines that go over previous lines in the polygon, like this\r\n\r\n![geojson lint example](https://cloud.githubusercontent.com/assets/3855195/5908701/bb2e9e36-a588-11e4-87a3-bd4b53cccabc.png)\r\n\r\nThe geoJSON representation of the polygons are created by me in JS based on user input from Google Maps Draw Tools.\r\n\r\nIs there something wrong with my polygon coordinates? Is there anything I can do to fix this issue or is it an issue of the gem?\r\n\r\nThank you for reading\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/rgeo/rgeo-geojson/issues/comments/71545493","html_url":"https://github.com/rgeo/rgeo-geojson/issues/10#issuecomment-71545493","issue_url":"https://api.github.com/repos/rgeo/rgeo-geojson/issues/10","id":71545493,"user":{"login":"erictheise","id":317680,"avatar_url":"https://avatars.githubusercontent.com/u/317680?v=3","gravatar_id":"","url":"https://api.github.com/users/erictheise","html_url":"https://github.com/erictheise","followers_url":"https://api.github.com/users/erictheise/followers","following_url":"https://api.github.com/users/erictheise/following{/other_user}","gists_url":"https://api.github.com/users/erictheise/gists{/gist_id}","starred_url":"https://api.github.com/users/erictheise/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erictheise/subscriptions","organizations_url":"https://api.github.com/users/erictheise/orgs","repos_url":"https://api.github.com/users/erictheise/repos","events_url":"https://api.github.com/users/erictheise/events{/privacy}","received_events_url":"https://api.github.com/users/erictheise/received_events","type":"User","site_admin":false},"created_at":"2015-01-26T21:49:18Z","updated_at":"2015-01-26T21:49:18Z","body":"GeoJSON doesn't care if a polygon self-intersects, but many tools in the chain are implemented against the [Simple Features](https://en.wikipedia.org/wiki/Simple_Features) standard which disallows it. Check the [PostGIS documentation](http://postgis.net/docs/using_postgis_dbmanagement.html) section on \"Ensuring OpenGIS compliancy of geometries\" and consider using multipolygon."}}