Potlatch 1/Remote calls/putway SQL

From OpenStreetMap Wiki
Jump to: navigation, search

One of the most complex parts of the code within amf_controller.rb is the set of SQL statements (and supporting code) to write a way to the database ('putway'). 'deleteway', to delete a way, works similarly.

Here is how it works. 'Stage' numbers refer to comments in the code.

Contents

Stage 3: read original way into memory

Stage 4: get version

Stage 5: compare new nodes against old

For each point in the array of points:

Stage 6a: delete any nodes not in modified way

Stage 6b: insert new version of route into way_nodes

Stage 7: insert new way tags

Finally

Personal tools
Namespaces
Variants
Actions
site
Toolbox