[OSM-talk] Mapnik style in slippy map
frederik at remote.org
Thu Aug 2 18:44:02 BST 2007
>> And yes, there *really* are 20740 nodes that carry a tag whose key is
>> "moved according to town brige in Mandal and Åvik(/Åvig) harbor)" and
>> whose value is empty.
> Having loaded that area into JOSM (from the normal server, not my local
> one) and selected all nodes, I can't see those tags.
Something strange is going on here but I've found out what it is. I
picked one of the nodes from the planet file at random and requested it
from the API - no funny tags at all. Then requested the history - all
looks well. That would mean that either someone with database access has
removed the tag in the last 48 hours or so, bypassing the history
mechanism (highly unlikely!) or that the code generating the planet
works differently from the API. And this is in fact the case - the API
does not hand out tags with empty values (code from Node.rb, asterisk
marking inserted by me):
def self.split_tags(el, tags)
tags.split(';').each do |tag|
parts = tag.split('=')
key = ''
val = ''
key = parts.strip unless parts.nil?
val = parts.strip unless parts.nil?
if key != '' && val != '' **************************
el2 = XML::Node.new('tag')
el2['k'] = key.to_s
el2['v'] = val.to_s
el << el2
But the code that generates the planet file does not use the same XML
generation, and it has no provision for skipping empty values.
So there you go. That's why the API never returns those funny tags. And
everytime someone makes a modification to an object carrying a tag
without value, the tag is silently deleted (because the new, uploaded
version of the object does not contain the tag). Which is not too bad
since value-less tags are useless anyway ;-)
Frederik Ramm ## eMail frederik at remote.org ## N49°00.09' E008°23.33'
More information about the talk