Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
thefinn93 opened this issue Jun 11, 2014 · 2 comments
Open

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

thefinn93 opened this issue Jun 11, 2014 · 2 comments

Comments

@thefinn93
Copy link

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.

@nemesifier
Copy link

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

@alexander-bauer
Copy link
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants