[OSM-dev] [OSM-talk] The future of Potlatch
Richard Fairhurst
richard at systemeD.net
Fri May 2 18:00:34 BST 2008
bvh wrote:
> On Fri, May 02, 2008 at 03:37:57PM +0100, Richard Fairhurst wrote:
>> The other one is that it would be good if the getway call, in
>
> Just curious : what does this call actually do in fact?
Just gets a way and its tags, and all its nodes and their tags.
http://trac.openstreetmap.org/browser/sites/rails_port/app/
controllers/amf_controller.rb#L173
It's pretty similar to /api/0.5/way/<id>/full, it just predates it
(and as Dave says it reprojects, largely for historical reasons).
The performance issue is with Way.find(wayid). This is several times
slower than the equivalent SQL:
SELECT latitude*0.0000001 AS latitude,longitude*0.0000001 AS
longitude,current_nodes.id,tags,visible
FROM current_way_nodes,current_nodes
WHERE current_way_nodes.id=#{id}
AND current_way_nodes.node_id=current_nodes.id
...I guess because it's creating Rails objects for all the nodes
along the way, or something. Because Potlatch calls this for every
single way, there's a pretty big performance hit.
cheers
Richard
More information about the dev
mailing list