NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

Hi there,

Suppose I have a request to fetch all ways in a bounding box E.g.

way(30.474290463301,-92.427999973297,30.493133455774,-92.403044700623);
out;

and I need to make the same request in a different location:

way(30.48913956382,-92.41911649704,30.507979681231,-92.394161224365);
out;

Right now, I am querying in two separate requests as I need to know which elements belong to which request. What I want to do it to perform both queries in a single request (to avoid querying the server multiple times which is a bottleneck), but I need to know which found elements belong to which request.

For example: I want to call:

//Request A
way(30.474290463301,-92.427999973297,30.493133455774,-92.403044700623);
out;
//Request B
way(30.48913956382,-92.41911649704,30.507979681231,-92.394161224365);
out;

Which I want to produce the following result (note the "request" tag):

{
  "type": "way",
  "request": "B",
  "id": 12574244,
  "nodes": [
    114699604,
    114699607,

  ],
  "tags": {
    "highway": "residential",
    "name": "South Tanglewood Drive",
    "tiger:cfcc": "A41",
    "tiger:county": "Acadia, LA",
    "tiger:name_base": "Tanglewood",
    "tiger:name_direction_prefix": "S",
    "tiger:name_type": "Dr",
    "tiger:reviewed": "no",
    "tiger:zip_left": "70535",
    "tiger:zip_right": "70535"
  }
},
{
  "type": "way",
  "request": "A",
  "id": 12574385,
  "nodes": [
    114700993,
    114700994,
    114700997,
    114700999
  ],
  "tags": {
    "highway": "residential",
    "name": "James Place",
  }
}

Is what I want to achieve possible? Or do I need to keep using separate requests.

Thanks a lot for the help!

This question is marked "community wiki".

asked 01 Oct '17, 00:43

gmeister41's gravatar image

gmeister41
16335
accept rate: 0%


permanent link

answered 01 Oct '17, 04:36

maxerickson's gravatar image

maxerickson
12.7k1083176
accept rate: 32%

Perfect, this will do the job. Thanks!

(02 Oct '17, 01:42) gmeister41

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×710
×483
×290
×29
×4

question asked: 01 Oct '17, 00:43

question was seen: 2,248 times

last updated: 02 Oct '17, 01:42

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum