Skip to content

Make /api/all?geojson return valid GeoJSON #198

Open

Description

@thefinn93

Currently /api/all?geojson returns something like GeoJSON, but with an extra layer around it:

{
   "data":{
      "type":"FeatureCollection",
      "features":[
         {
            "type":"Feature",
            "id":"fc00::",
            "geometry":{
               "type":"Point",
               "coordinates":[
                  -73.9823,
                  40.6761
               ]
            },
            "properties":{
               "Contact":"blah blah blah",
               "Details":"blah blah blah",
               "OwnerName":"blah blah blah",
               "PGP":"0000000000000000",
               "Status":1920
            }
         }
      ]
   },
   "error":null
}

While valid GeoJSON does not have a "data" key:

{
   "type":"FeatureCollection",
   "features":[
      {
         "type":"Feature",
         "id":"fc00::",
         "geometry":{
            "type":"Point",
            "coordinates":[
               -73.9823,
               40.6761
            ]
         },
         "properties":{
            "Contact":"blah blah blah",
            "Details":"blah blah blah",
            "OwnerName":"blah blah blah",
            "PGP":"0000000000000000",
            "Status":1920
         }
      }
   ]
}

This is causing problems exporting data and importing it into other maps, such as NodeShot.

Activity

  1. nemesifier commented on Jun 11, 2014

    @nemesifier

    hint: validate GeoJSON output with GeoJSON lint, eg: http://geojsonlint.com/

  2. alexander-bauer commented on Jun 11, 2014

    @alexander-bauer
    Member

    This is a little complicated as things stand, because this hits the API, rather than a direct handler. It should definitely be made direct so it can be used as geojson directly, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions