[OSM-talk] Map Features, maxspeed and maplint

Shaun McDonald shaun at shaunmcdonald.me.uk
Sat Oct 11 12:11:27 BST 2008


On 11 Oct 2008, at 08:09, Ed Loach wrote:
> [..]
> As Matthias writes:
> "From the
> programmer's point of view I don't think it makes much of a
> difference
> whether the unit is stored in the key or in the value."

hrm with ruby if you are expecting a number in that field and try to  
parse it, the units will be lost:
Unknown-00-1f-5b-ec-f0-9b:~ shaunmcdonald$ ruby -v
ruby 1.8.6 (2008-03-03 patchlevel 114) [universal-darwin9.0]
Unknown-00-1f-5b-ec-f0-9b:~ shaunmcdonald$ irb
 >> "30mph".to_i
=> 30
 >>

http://ruby-doc.org/core/classes/String.html#M000802

Now there is a reason from a programmers point of view why units  
should be left out of the value.

(I now better run an hide while someone comes up with a way to parse  
that string into an object containing the speed and the units).


Shaun

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/talk/attachments/20081011/6c5b7512/attachment.html>


More information about the talk mailing list