[OSM-talk] undeleting ways?

Richard Fairhurst richard at systemed.net
Sun Feb 8 18:59:57 GMT 2009

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, so I spent 15 minutes staring at
it and decided it was far too much like hard work.

Instead, try this:


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: ruby

It'll spit out the results 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.

View this message in context: http://www.nabble.com/undeleting-ways--tp21808073p21902122.html
Sent from the OpenStreetMap - General mailing list archive at Nabble.com.

More information about the talk mailing list