2011/11/19 Hermann Peifer <pei...@gmx.eu>:
> On 19/11/2011 13:48, Jo wrote:
>>>>
>>>> You probably want to add oneway=-1 to that list. There are some
>>>> oddballs who used that indicate oneway is against the vector sense.
>>>> Also JOSM proposes to use it when reversing a way.
>>>>
>>>> Jo
>>>
>>> Thanks for the hint. I already thought about it but forgot to mention
>>> that
>>> the above tests are using regular expressions. ^motorway also matches
>>> motorway_link, etc. and 1 also matches -1.
>>
>> Is a regex really the best choice for that problem? It's a closed list
>> of possibilities (or it ought to be), regexes seriously degrade
>> performance in comparison to for instance dictionary lookups (sorry
>> for the Python terminology, what I refer to is an unordered datatype
>> where one can perform lookups on keys, which are stored in a hash to
>> increase performance). When one of the values is outside of that list,
>> it should be flagged as an error and be corrected in the data. Or it
>> should become part of the list, if it is valid after all.
>>
>> Just my 2 cents. Regexes are not always the right answer for a problem
>> and performance quickly becomes a problem when working with massive
>> amounts of data, like what one finds in the OSM DB.
>
> Thanks for the hint. One could indeed put the oneway values (yes|true|1|-1)
> into a hash and have some performance benefit from that. In my case, the
> real bottleneck in the process is actually to download the OSM extracts from
> Geofabrik, which takes about 10 times longer than the script run...
>
> About the closed list of possibilities: OSM Mappers are pretty creative and
> the value list for a simple key like oneway is not as closed as one might
> think: http://taginfo.openstreetmap.org/keys/oneway#values
>
> On the other hand: the 5 most popular oneway values cover 99.9+ %.

Most of those should simply be corrected and if it's undefined, then
why even mention it? Those can simply be removed...

Jo

_______________________________________________
Talk-de mailing list
Talk-de@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk-de

Antwort per Email an