openstreetmapgeojsonoverpass-apigeojsonio

Missing data for geojson


I made the following query in overpass-turbo

[out:json][timeout:25];
// gather results
(
  // query part for: “amenity=hospital”
  node["amenity"="hospital"]({{bbox}});
  way["amenity"="hospital"]({{bbox}});
  relation["amenity"="hospital"]({{bbox}});
);
// print results
out body;
>;
out center;
>;

but unfortunately i do not get all the nodes displayed into geojson.io from extracted geojson data (overpass-turbo).

Any idea that could help me to get all data?

Regards


Solution

  • It looks like http://geojson.io does show nodes but not polygons (= OSM ways). This could be a limitation of http://geojson.io or of the overpass turbo export, I'm not really familiar with the GeoJSON file format.

    You can tell overpass to convert ways to nodes with the geometry attribute out center;. Try the following query:

    [out:json][timeout:25];
    // gather results
    (
      // query part for: “amenity=hospital”
      node["amenity"="hospital"]({{bbox}});
      way["amenity"="hospital"]({{bbox}});
      relation["amenity"="hospital"]({{bbox}});
    );
    // print results
    out center;
    >;