[OSM-talk] undeleting ways?

Richard Fairhurst richard at systemeD.net
Sun Feb 8 19:01:37 GMT 2009


[Nabble appears to be going wappy, sorry for the previous half-sent  
message]


MP wrote:
 > I tried searching on CPAN for AMF classes, but I have
 > found only server-side libraries for perl - I found code
 > to create an AMF serice, but no code to call it. Do you
 > know of any Perl package to call the AMF code?

 From a brief glance you should be able to use Data::AMF, but the  
documentation is verging on non-existent: I spent 15 minutes staring  
at it and decided it was far too much like hard work.

Instead, try this:

     http://svn.openstreetmap.org/applications/utils/amf

It's in Ruby - though I'm more a Perl hacker than a Ruby one, I had  
the Ruby AMF code written for Potlatch, so figured it would be easier  
to reuse this. You'll need to install the httpclient and stringio  
libraries ('gem install httpclient' etc.). Lots of the amf encoding/ 
decoding logic is in the script rather than the library, which is  
clearly a bad thing - I just felt like quickly hacking up something  
that worked.

Edit amf_finddeleted.rb so the bbox is what you want, then just:

     ruby amf_finddeleted.rb

It'll fetch the deleted ways in Potlatch's array format, which is  
documented in amf_finddeleted.rb (lines 65-70). You could either  
process it further in Ruby, or copy-and-paste to do something in  
Perl, or use YAML to interchange between the two - whatever.

 > BTW is there any plan to expose this part of API as a traditional
 > XML interface too in the future?

Well, it's in the main Rails codebase intentionally so someone could  
do that, but I'm not comfortable enough with XML to do it myself. If  
it were to happen, probably better to wait until after API 0.6  
anyway, because I'm slightly rewriting it as part of that.

cheers
Richard




More information about the talk mailing list