{"action":"created","issue":{"url":"https://api.github.com/repos/mapbox/mapnik-omnivore/issues/78","labels_url":"https://api.github.com/repos/mapbox/mapnik-omnivore/issues/78/labels{/name}","comments_url":"https://api.github.com/repos/mapbox/mapnik-omnivore/issues/78/comments","events_url":"https://api.github.com/repos/mapbox/mapnik-omnivore/issues/78/events","html_url":"https://github.com/mapbox/mapnik-omnivore/issues/78","id":56118336,"number":78,"title":"Unexpected error on receiving a GeometryCollection","user":{"login":"rclark","id":515424,"avatar_url":"https://avatars.githubusercontent.com/u/515424?v=3","gravatar_id":"","url":"https://api.github.com/users/rclark","html_url":"https://github.com/rclark","followers_url":"https://api.github.com/users/rclark/followers","following_url":"https://api.github.com/users/rclark/following{/other_user}","gists_url":"https://api.github.com/users/rclark/gists{/gist_id}","starred_url":"https://api.github.com/users/rclark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rclark/subscriptions","organizations_url":"https://api.github.com/users/rclark/orgs","repos_url":"https://api.github.com/users/rclark/repos","events_url":"https://api.github.com/users/rclark/events{/privacy}","received_events_url":"https://api.github.com/users/rclark/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-01-31T08:45:52Z","updated_at":"2015-02-02T19:42:35Z","closed_at":null,"body":"A JSON file of type `GeometryCollection` (see http://geojson.org/geojson-spec.html#geometrycollection) will [be read into omnivore as a geojson file](https://github.com/mapbox/mapnik-omnivore/blob/45ac76470f589439aa5b219d50690e43937bf5d7/lib/datasource-processor.js#L567-L585) and fail unexpectedly [when `ds.featureset()` returns null](https://github.com/mapbox/mapnik-omnivore/blob/45ac76470f589439aa5b219d50690e43937bf5d7/lib/datasource-processor.js#L577-L578).\r\n\r\ncc @GretaCB @springmeyer "},"comment":{"url":"https://api.github.com/repos/mapbox/mapnik-omnivore/issues/comments/72523274","html_url":"https://github.com/mapbox/mapnik-omnivore/issues/78#issuecomment-72523274","issue_url":"https://api.github.com/repos/mapbox/mapnik-omnivore/issues/78","id":72523274,"user":{"login":"springmeyer","id":20300,"avatar_url":"https://avatars.githubusercontent.com/u/20300?v=3","gravatar_id":"","url":"https://api.github.com/users/springmeyer","html_url":"https://github.com/springmeyer","followers_url":"https://api.github.com/users/springmeyer/followers","following_url":"https://api.github.com/users/springmeyer/following{/other_user}","gists_url":"https://api.github.com/users/springmeyer/gists{/gist_id}","starred_url":"https://api.github.com/users/springmeyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/springmeyer/subscriptions","organizations_url":"https://api.github.com/users/springmeyer/orgs","repos_url":"https://api.github.com/users/springmeyer/repos","events_url":"https://api.github.com/users/springmeyer/events{/privacy}","received_events_url":"https://api.github.com/users/springmeyer/received_events","type":"User","site_admin":false},"created_at":"2015-02-02T19:42:35Z","updated_at":"2015-02-02T19:42:35Z","body":"According to the geojson spec I think a `GeometryCollection` is valid either at the top level (because any geometry type can be top level), or inside a `FeatureCollection` (so inside a `features` array). But because Mapnik's `geojson.input` only supports `FeatureCollection`s currently it only supports `GeometryCollection` like so: https://github.com/mapnik/mapnik/blob/master/tests/visual_tests/styles/geojson-geometry-collection.xml#L18-L48\r\n\r\n> Or is a GeometryCollection a valid object inside the features array?\r\n\r\nYes\r\n\r\n> may be no way to perform validation without assuming that the type determination is made in the first several bytes of the file:\r\n\r\nAh, good point. I presume GDAL/OGR and other sniffers would fail in this case:\r\n\r\n```\r\n{\r\n  \"features\": [ \"... several thousand bytes of features ...\" ],\r\n  \"type\": \"FeatureCollection\"\r\n}\r\n```\r\n\r\nI propose we don't support that until we have to.\r\n"}}