{"action":"opened","issue":{"url":"https://api.github.com/repos/miloyip/rapidjson/issues/346","labels_url":"https://api.github.com/repos/miloyip/rapidjson/issues/346/labels{/name}","comments_url":"https://api.github.com/repos/miloyip/rapidjson/issues/346/comments","events_url":"https://api.github.com/repos/miloyip/rapidjson/issues/346/events","html_url":"https://github.com/miloyip/rapidjson/issues/346","id":82284692,"number":346,"title":"How do you resolve kParseErrorDocumentRootNotSingular error?","user":{"login":"xmarklabs","id":7764361,"avatar_url":"https://avatars.githubusercontent.com/u/7764361?v=3","gravatar_id":"","url":"https://api.github.com/users/xmarklabs","html_url":"https://github.com/xmarklabs","followers_url":"https://api.github.com/users/xmarklabs/followers","following_url":"https://api.github.com/users/xmarklabs/following{/other_user}","gists_url":"https://api.github.com/users/xmarklabs/gists{/gist_id}","starred_url":"https://api.github.com/users/xmarklabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xmarklabs/subscriptions","organizations_url":"https://api.github.com/users/xmarklabs/orgs","repos_url":"https://api.github.com/users/xmarklabs/repos","events_url":"https://api.github.com/users/xmarklabs/events{/privacy}","received_events_url":"https://api.github.com/users/xmarklabs/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-05-29T06:16:47Z","updated_at":"2015-05-29T06:16:47Z","closed_at":null,"body":"Im trying to use Rapidjson on iOS to parse map data that is in a GeoJson format. The parsing works fine for most cases but fails for some particular cases. I have noticed that the Json parsing fails when particular children elements are empty.  \r\n\r\nFor example if i try to parse the following GeoJson i get a kParseErrorDocumentRootNotSingular error with an error offset of 12310 and im assuming it is because certain member elements in this Json (landuse_labels.features , places.features , pois.features) are empty. \r\n\r\n{\r\n    \"buildings\": {\r\n        \"type\": \"FeatureCollection\",\r\n        \"features\": [\r\n            {\r\n                \"geometry\": {\r\n                    \"type\": \"Polygon\",\r\n                    \"coordinates\": [\r\n                        [\r\n                            [\r\n                                -71.345721,\r\n                                41.787756\r\n                            ],\r\n                            [\r\n                                -71.345661,\r\n                                41.787846\r\n                            ],\r\n                            [\r\n                                -71.345534,\r\n                                41.787878\r\n                            ],\r\n                            [\r\n                                -71.345413,\r\n                                41.787834\r\n                            ],\r\n                            [\r\n                                -71.34537,\r\n                                41.787739\r\n                            ],\r\n                            [\r\n                                -71.345429,\r\n                                41.787649\r\n                            ],\r\n                            [\r\n                                -71.345556,\r\n                                41.787617\r\n                            ],\r\n                            [\r\n                                -71.345677,\r\n                                41.787661\r\n                            ],\r\n                            [\r\n                                -71.345721,\r\n                                41.787756\r\n                            ]\r\n                        ]\r\n                    ]\r\n                },\r\n                \"type\": \"Feature\",\r\n                \"properties\": {\r\n                    \"id\": 274563682,\r\n                    \"area\": 1171\r\n                }\r\n            }\r\n        ]\r\n    },\r\n    \"landuse_labels\": {\r\n        \"type\": \"FeatureCollection\",\r\n        \"features\": []\r\n    },\r\n    \"places\": {\r\n        \"type\": \"FeatureCollection\",\r\n        \"features\": []\r\n    },\r\n    \"pois\": {\r\n        \"type\": \"FeatureCollection\",\r\n        \"features\": []\r\n    },\r\n    \"water\": {\r\n        \"type\": \"FeatureCollection\",\r\n        \"features\": [\r\n            {\r\n                \"geometry\": {\r\n                    \"type\": \"Polygon\",\r\n                    \"coordinates\": [\r\n                        [\r\n                            [\r\n                                -71.355634,\r\n                                41.782305\r\n                            ],\r\n                            [\r\n                                -71.355587,\r\n                                41.782452\r\n                            ],\r\n                            [\r\n                                -71.355456,\r\n                                41.782564\r\n                            ],\r\n                            [\r\n                                -71.354612,\r\n                                41.782906\r\n                            ],\r\n                            [\r\n                                -71.354012,\r\n                                41.783493\r\n                            ],\r\n                            [\r\n                                -71.3539,\r\n                                41.783382\r\n                            ],\r\n                            [\r\n                                -71.353947,\r\n                                41.782948\r\n                            ],\r\n                            [\r\n                                -71.354106,\r\n                                41.782655\r\n                            ],\r\n                            [\r\n                                -71.354893,\r\n                                41.781809\r\n                            ],\r\n                            [\r\n                                -71.355259,\r\n                                41.781697\r\n                            ],\r\n                            [\r\n                                -71.355456,\r\n                                41.78169\r\n                            ],\r\n                            [\r\n                                -71.355596,\r\n                                41.782012\r\n                            ],\r\n                            [\r\n                                -71.355634,\r\n                                41.782305\r\n                            ]\r\n                        ]\r\n                    ]\r\n                },\r\n                \"type\": \"Feature\",\r\n                \"properties\": {\r\n                    \"source\": \"openstreetmap.org\",\r\n                    \"kind\": \"water\",\r\n                    \"id\": 208859735,\r\n                    \"area\": 23294\r\n                }\r\n            }\r\n        ]\r\n    },\r\n    \"roads\": {\r\n        \"type\": \"FeatureCollection\",\r\n        \"features\": [\r\n            {\r\n                \"geometry\": {\r\n                    \"type\": \"LineString\",\r\n                    \"coordinates\": [\r\n                        [\r\n                            -71.345215,\r\n                            41.786407\r\n                        ],\r\n                        [\r\n                            -71.347176,\r\n                            41.786438\r\n                        ],\r\n                        [\r\n                            -71.348999,\r\n                            41.785934\r\n                        ],\r\n                        [\r\n                            -71.356201,\r\n                            41.78373\r\n                        ]\r\n                    ]\r\n                },\r\n                \"type\": \"Feature\",\r\n                \"properties\": {\r\n                    \"kind\": \"minor_road\",\r\n                    \"name\": \"Socony Road\",\r\n                    \"sort_key\": 16,\r\n                    \"is_link\": \"no\",\r\n                    \"is_tunnel\": \"no\",\r\n                    \"is_bridge\": \"no\",\r\n                    \"id\": 92269642,\r\n                    \"highway\": \"service\"\r\n                }\r\n            },\r\n            {\r\n                \"geometry\": {\r\n                    \"type\": \"LineString\",\r\n                    \"coordinates\": [\r\n                        [\r\n                            -71.348999,\r\n                            41.785934\r\n                        ],\r\n                        [\r\n                            -71.349228,\r\n                            41.786022\r\n                        ],\r\n                        [\r\n                            -71.349434,\r\n                            41.786343\r\n                        ],\r\n                        [\r\n                            -71.349681,\r\n                            41.787697\r\n                        ]\r\n                    ]\r\n                },\r\n                \"type\": \"Feature\",\r\n                \"properties\": {\r\n                    \"kind\": \"minor_road\",\r\n                    \"sort_key\": 16,\r\n                    \"is_link\": \"no\",\r\n                    \"is_tunnel\": \"no\",\r\n                    \"is_bridge\": \"no\",\r\n                    \"id\": 19351772,\r\n                    \"highway\": \"service\"\r\n                }\r\n            },\r\n            {\r\n                \"geometry\": {\r\n                    \"type\": \"LineString\",\r\n                    \"coordinates\": [\r\n                        [\r\n                            -71.348557,\r\n                            41.780216\r\n                        ],\r\n                        [\r\n                            -71.348282,\r\n                            41.779915\r\n                        ],\r\n                        [\r\n                            -71.34773,\r\n                            41.779505\r\n                        ]\r\n                    ]\r\n                },\r\n                \"type\": \"Feature\",\r\n                \"properties\": {\r\n                    \"kind\": \"minor_road\",\r\n                    \"sort_key\": 17,\r\n                    \"is_link\": \"no\",\r\n                    \"is_tunnel\": \"no\",\r\n                    \"is_bridge\": \"no\",\r\n                    \"id\": 19352227,\r\n                    \"highway\": \"residential\"\r\n                }\r\n            },\r\n            {\r\n                \"geometry\": {\r\n                    \"type\": \"LineString\",\r\n                    \"coordinates\": [\r\n                        [\r\n                            -71.35094,\r\n                            41.779505\r\n                        ],\r\n                        [\r\n                            -71.3489,\r\n                            41.780132\r\n                        ],\r\n                        [\r\n                            -71.348053,\r\n                            41.780331\r\n                        ],\r\n                        [\r\n                            -71.347382,\r\n                            41.780384\r\n                        ],\r\n                        [\r\n                            -71.345215,\r\n                            41.78033\r\n                        ]\r\n                    ]\r\n                },\r\n                \"type\": \"Feature\",\r\n                \"properties\": {\r\n                    \"kind\": \"minor_road\",\r\n                    \"name\": \"Forbes Street\",\r\n                    \"sort_key\": 17,\r\n                    \"is_link\": \"no\",\r\n                    \"is_tunnel\": \"no\",\r\n                    \"is_bridge\": \"no\",\r\n                    \"id\": 278496863,\r\n                    \"highway\": \"residential\"\r\n                }\r\n            },\r\n            {\r\n                \"geometry\": {\r\n                    \"type\": \"LineString\",\r\n                    \"coordinates\": [\r\n                        [\r\n                            -71.356201,\r\n                            41.787685\r\n                        ],\r\n                        [\r\n                            -71.355858,\r\n                            41.78751\r\n                        ]\r\n                    ]\r\n                },\r\n                \"type\": \"Feature\",\r\n                \"properties\": {\r\n                    \"kind\": \"minor_road\",\r\n                    \"name\": \"Village Drive\",\r\n                    \"sort_key\": 17,\r\n                    \"is_link\": \"no\",\r\n                    \"is_tunnel\": \"no\",\r\n                    \"is_bridge\": \"no\",\r\n                    \"id\": 19369545,\r\n                    \"highway\": \"residential\"\r\n                }\r\n            }\r\n        ]\r\n    },\r\n    \"earth\": {\r\n        \"type\": \"FeatureCollection\",\r\n        \"features\": [\r\n            {\r\n                \"geometry\": {\r\n                    \"type\": \"Polygon\",\r\n                    \"coordinates\": [\r\n                        [\r\n                            [\r\n                                -71.345215,\r\n                                41.779505\r\n                            ],\r\n                            [\r\n                                -71.356201,\r\n                                41.779505\r\n                            ],\r\n                            [\r\n                                -71.356201,\r\n                                41.787697\r\n                            ],\r\n                            [\r\n                                -71.345215,\r\n                                41.787697\r\n                            ],\r\n                            [\r\n                                -71.345215,\r\n                                41.779505\r\n                            ]\r\n                        ]\r\n                    ]\r\n                },\r\n                \"type\": \"Feature\",\r\n                \"properties\": {\r\n                    \"land\": \"base\",\r\n                    \"id\": 269814\r\n                }\r\n            }\r\n        ]\r\n    },\r\n    \"landuse\": {\r\n        \"type\": \"FeatureCollection\",\r\n        \"features\": [\r\n            {\r\n                \"geometry\": {\r\n                    \"type\": \"Polygon\",\r\n                    \"coordinates\": [\r\n                        [\r\n                            [\r\n                                -71.345215,\r\n                                41.783188\r\n                            ],\r\n                            [\r\n                                -71.345753,\r\n                                41.783583\r\n                            ],\r\n                            [\r\n                                -71.345674,\r\n                                41.784833\r\n                            ],\r\n                            [\r\n                                -71.345953,\r\n                                41.786105\r\n                            ],\r\n                            [\r\n                                -71.347718,\r\n                                41.786109\r\n                            ],\r\n                            [\r\n                                -71.349014,\r\n                                41.785746\r\n                            ],\r\n                            [\r\n                                -71.349427,\r\n                                41.786051\r\n                            ],\r\n                            [\r\n                                -71.349707,\r\n                                41.786463\r\n                            ],\r\n                            [\r\n                                -71.349867,\r\n                                41.787697\r\n                            ],\r\n                            [\r\n                                -71.345215,\r\n                                41.787697\r\n                            ],\r\n                            [\r\n                                -71.345215,\r\n                                41.783188\r\n                            ]\r\n                        ]\r\n                    ]\r\n                },\r\n                \"type\": \"Feature\",\r\n                \"properties\": {\r\n                    \"source\": \"openstreetmap.org\",\r\n                    \"kind\": \"industrial\",\r\n                    \"id\": 274563704,\r\n                    \"area\": 1633940\r\n                }\r\n            }\r\n        ]\r\n    }\r\n}\r\n\r\n\r\nWhat does kParseErrorDocumentRootNotSingular exactly imply? Can i resolve this error without altering the geoJson response? \r\n\r\n"}}