I need all highway
type way
in certain area, I found this query the result I want, but using overpass-turbo (I would like to use only overpass-api or even better only osmosis):
<osm-script output="json">
<id-query {{nominatimArea:Temperley,Partido de Lomas de zamora,Buenos Aires,Argentina}} into="area"/>
<query type="way">
<has-kv k="highway"/>
<area-query from="area"/>
</query>
<print mode="body"/>
<recurse type="down"/>
<print mode="skeleton" order="quadtile"/>
</osm-script>
I need to perform this task from a backend hundreds of times using differents areas. So I think I should use overpass-api directly (not using the overpass-turbo frontend), doing a POST request here http://overpass-api.de/api/interpreter .
The issue is that above query fails using overpass-api, I think because of {{nominatimArea}}
. When I inspect the POST made for overpass-turbo, I found that the real query to overpass-api is:
<osm-script output="json">
<id-query type="area" ref="3602537337" into="area"/>
<query type="way">
<has-kv k="highway"/>
<area-query from="area"/>
</query>
<print mode="body"/>
<recurse type="down"/>
<print mode="skeleton" order="quadtile"/>
</osm-script>
When I run that query in overpass-api directly, I get the desired result.
As you can see, the difference is that {{nominatimArea}}
is replaced by type="area" ref="3602537337"
.
So, Is there a way to know that ref="3602537337"
associated to a {{nominatimArea}}
?
I have Nominatim installed locally, so I have the relation id
too, Is there a way to use that id or maybe something else?
Do I need another approach to this issue?
PD: Perfect scenario for me would be to use osmosis directly but I can't understand documentation ;( I have all the polygons I need, all names and relations ids too.