Hello,
which return me this result
Is there a way get same but without ND tags? like this:
I will get needed lat lon from <bounds>, and in this case i don't want to get ND's because this tags make returned data heavy asked 26 Jan '18, 14:29 davittorosyan |
the ND-tags are the nodes. If you just want the center of the way, you could use "out center" instead of "out geom". I'm not sure whether you can get the bounding box without the nodes. Both are part of the "out geom" statement answered 26 Jan '18, 14:34 escada and if you want all restaurants, you should also adapt your query to search for nodes and relations tagged with "amenity restaurant". So why not use this query instead ? The query was almost completely constructed with the Wizard from "Overpass Turbo", I just replaced "geom" with "center" in the last line
(26 Jan '18, 14:39)
escada
"out center" this is good solution tho have center point for each way, this will save my CPU to calculate center coordinate from <bounds> tag. But my problem little another now, i just don't want receive ND(node) tags, because instead of 5,000 lines XML file i receiving about 30,000(because this ND's very lot in each WAY tag) is there any solution to remove them from way tag but keep < center > tag? without ND's but with all other tags(inlcuding < center > tag)
(26 Jan '18, 15:37)
davittorosyan
did you take the take to look at the data from the query I linked to ? There are no ND tags when you use out center
(27 Jan '18, 19:06)
escada
yes, thank you for example, but sorry, I cant use this csv:out format for getting data ... because my parsers working with XML, but main reason, i dont want use out:csv, because each way object can have different parameters, phone, fax, opening_hours etc... but in your example i should predefine fields [out:csv( ::"id", ::lat, ::lon, name, cuisine, operator, "contact:website", "contact:phone"; true; "|" )]; is there another way to have my wanted format? Or its impossible? thank you
(27 Jan '18, 19:24)
davittorosyan
The query I link to returns XML. (see "this query" two comments back) And as for the output formats, please try the different output statements that are shown in the documentation if the format that you want is not between them, you can perhaps create a feature request. And otherwise, the extra data can easily be ignored by any decent XML parser. I doubt that your computer cannot handle the extra information in a quick way. 5000 lines of XML is nothing for today's CPUs
(27 Jan '18, 19:36)
escada
Thank you for answer, i will check is this solution for me.
(27 Jan '18, 19:58)
davittorosyan
showing 5 of 6
show 1 more comments
|
I don't know how to get rid of the node references (nd) as you ask for output, but I guess that what you want is a kind of csv-like output with the info of the ways for restaurants. In that case, you have the csv output mode. For your example, you could try with:
If you delete the
you will get the fields separated by a tab. You can also substitute the | by another string that suits you better. You have much more info on that csv mode here, specially about the fields you can add... I hope this suits you. answered 26 Jan '18, 14:58 edvac One of stackoverflow OSM developers find the solution, just need write "tags" in OUT: out tags;
(28 Jan '18, 15:23)
davittorosyan
Ah! Good! Didn't know that option :)
(28 Jan '18, 18:10)
edvac
|