[OSM-dev] Potlatch update

Richard Fairhurst richard at systemeD.net
Tue May 8 10:46:07 BST 2007

Nick Whitelegg wrote:

> Not 100%sure of the architecture of potlatch just now, but, if I  
> wanted to add functionality such as adding nodes, drawing areas and  
> NPE and SRTM backgrounds, could I do that without having to set up  
> a full Rails/OSM server environment on the Freemap server? (want to  
> avoid that if poss due to limited resources and unwillingness to  
> make Freemap become non functional - also I'd prefer to spend more  
> time on coding and less on configuration :-) )
> In other words could I get away with just installing the swf bits  
> and the Perl script (think that's a proxy isn't it?) and proxy all  
> the calls to the main OSM server?

I guess the main issue would be that Potlatch uses a OSM user token  
for authentication whenever you want to write to the database. You  
have one of these when logged in to OSM, but not (I presume) when  
logged into Freemap.

But it wouldn't be difficult to modify amf_controller.rb so that you  
could also authenticate with user/pass. Let me know if you want this  
doing and I'm happy to make the change.

 From there, the easiest thing to do would then be to change the API  
URL that the SWF calls (line 242 of potlatch.cgi) to become an  
absolute address, viz 'remote.connect("http://www.openstreetmap.org/ 
api/0.4/amf");'. You would also need Steve/Nick to add a  
crossdomain.xml file at the root of osm.org to permit SWFs from  
freemap.org.uk to access data from osm.org.

Incidentally, the old, pre-Rails server API script (rubyamf.cgi), or  
even the PHP version, would only need a little updating - which I'm  
planning to do anyway - to run off a local database if you didn't  
want to use the main OSM data.


More information about the dev mailing list