[OSM-dev] [OverpassAPI] Distinguish request matching features and referenced content ?
François Lacombe
fl.infosreseaux at gmail.com
Mon Sep 28 18:35:58 UTC 2015
Hi Martin and thank you for this useful answer.
I would really prefer the second approach and its far lighter process
regarding the overpass server.
As I don't need to extract tags on referenced objects, it will be ok for me.
All the best,
François
François Lacombe
fl dot infosreseaux At gmail dot com
www.infos-reseaux.com
@InfosReseaux
2015-09-28 9:46 GMT+02:00 Martin Raifer <tyr.asd at gmail.com>:
> There are several ways to accomplish a kind of separation between the
> "matched" content and the "referenced" (geometry containing) objects.
> The most basic one would be to simply divide the query into two: First
> only outputting the matched content, and second outputting referenced
> objects. This has the downside of putting more load on the Overpass
> server than what is actually needed. A better solution would be to
> output the referenced content without any tags (by using `out skel;`
> after the recurse-down – see overpass-turbo's wizard how this can be
> done): Then you can distinguish between the main "information objects"
> which have tags and the "geometry-providing" referenced stuff which
> doesn't have any tags on them. This approach also reduces network
> traffic, as fewer tags means less bytes to be transferred.
>
> Martin
>
> On Sun, Sep 27, 2015 at 7:02 PM, François Lacombe
> <fl.infosreseaux at gmail.com> wrote:
>> Hi all,
>>
>> I'm currently trying to import some features from OSM a in a DB by
>> using several Overpass queries.
>>
>> As for loading any referenced content (nodes in ways, members in
>> relations), those requests contain "(._;>;);" statement.
>>
>> I'm not able so far to distinguish the request matching content and
>> the referenced content since all is coming between <osm> markups.
>>
>> My logic dealing with requests results is also trying to convert
>> referenced nodes and members the same way as the request matching
>> content since the logic doesn't know which is request matching or not.
>>
>> Should I improve my logic or get a cool way to obtain the output below ?
>> In this example, only the way is matching request statements, nodes
>> are part of the way.
>> <osm>
>> <way id="xxxxx" ... >
>> <nd ref="yyyyy"/>
>> <nd ref="zzzzz"/>
>> </way>
>>
>> <reference>
>> <node id="yyyyy"/>
>> <node id="zzzzz"/>
>> </reference>
>> </osm>
>>
>> The processing logic would only deal with the way and ignore the nodes.
>>
>> Many thanks in advance for any help, all the best,
>>
>>
>> François Lacombe
>>
>> fl dot infosreseaux At gmail dot com
>> www.infos-reseaux.com
>> @InfosReseaux
>>
>> _______________________________________________
>> dev mailing list
>> dev at openstreetmap.org
>> https://lists.openstreetmap.org/listinfo/dev
>
> _______________________________________________
> dev mailing list
> dev at openstreetmap.org
> https://lists.openstreetmap.org/listinfo/dev
More information about the dev
mailing list