0

Here's my query

[out:json][timeout:25];
// gather results
(
  // query part for: “building”
  way["building"]({{bbox}});
  relation["building"]({{bbox}});
);
// print results
out center ids tags geom ;

>;
out skel qt;

If I use center then geom values are not shown. I want to output center and geom. How is that possible?

1 Answer 1

1

You could use two separate output commands:

[out:json][timeout:25];
(
  way["building"]({{bbox}});
  relation["building"]({{bbox}});
);
out geom;
out center ids;  // use ids to only get the centerpoint without nodes & tags

2
  • Yes. It does give you center and geom information but too much redundant information.
    – NinjaMAN
    Nov 4 at 6:45
  • @NinjaMAN - I updated my answer to use "out center ids" instead of "out center". This removes duplicated nodes and tags, but it will still output two elements - maybe good enough? Note that since the "out" only supports one output format at a time, I'm not sure there's a way to get both the full geometry and the center into one single element with the json output. Nov 7 at 4:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.