Potlatch 1/Point array

From OpenStreetMap Wiki
Revision as of 22:24, 4 April 2011 by Richard (talk | contribs) (moved Potlatch/Point array to Potlatch 1/Point array: P2 now the default editor)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Potlatch treats a way as an ordered list of points. This ordered list is stored within Potlatch (both the SWF client and the Ruby AMF server script) as an array. Each element of the array represents one point.

A point 'p', in turn, comprises the following:

  • p[0]=x co-ordinate (projected)
  • p[1]=y co-ordinate (projected)
  • p[2]=node ID
  • p[3]=not currently used
  • p[4]=hash of node keys/values

So to get the node ID of the fourth element (i.e. subscript 3) in a way, you would use the following ActionScript:

  • way.path[3][2]