Trees | Indices | Help |
|
---|
|
object --+ | list --+ | point.Points --+ | Way
Since: 0.9.0
|
|||
new list |
|
||
str
|
|
||
str
|
|
||
ET.Element |
|
||
Inherited from Inherited from Inherited from |
|
|||
Node |
|
|
|||
ident Way's unique indentifier |
|||
tags Tags associated with the way |
|||
timestamp The date and time a way was logged |
|||
user User who logged the way |
|||
visible Whether the way is visible |
|
|||
Inherited from |
|
|
Self-documenting string representation >>> Way(0, (0, 1, 2)) Way(0, [0, 1, 2], False, None, None, None) >>> Way(0, (0, 1, 2), True, "jnrowe", Timestamp(2008, 1, 25)) Way(0, [0, 1, 2], True, 'jnrowe', Timestamp(2008, 1, 25, 0, 0), None) >>> Way(0, (0, 1, 2), tags={"key": "value"}) Way(0, [0, 1, 2], False, None, None, {'key': 'value'})
|
Pretty printed location string >>> print(Way(0, (0, 1, 2))) Way 0 (nodes: 0, 1, 2) >>> print(Way(0, (0, 1, 2), True, "jnrowe", ... Timestamp(2008, 1, 25))) Way 0 (nodes: 0, 1, 2) [visible, user: jnrowe, timestamp: 2008-01-25T00:00:00+00:00] >>> print(Way(0, (0, 1, 2), tags={"key": "value"})) Way 0 (nodes: 0, 1, 2) [key: value] >>> nodes = [ ... Node(0, 52.015749, -0.221765, True, "jnrowe", ... Timestamp(2008, 1, 25, 12, 52, 11), None), ... Node(1, 52.015761, -0.221767, True, None, ... Timestamp(2008, 1, 25, 12, 53, 14), ... {"created_by": "hand", "highway": "crossing"}), ... Node(2, 52.015754, -0.221766, True, "jnrowe", ... Timestamp(2008, 1, 25, 12, 52, 30), ... {"amenity": "pub"}), ... ] >>> print(Way(0, (0, 1, 2), tags={"key": "value"}).__str__(nodes)) Way 0 [key: value] Node 0 (52°00'56"N, 000°13'18"W) [visible, user: jnrowe, timestamp: 2008-01-25T12:52:11+00:00] Node 1 (52°00'56"N, 000°13'18"W) [visible, timestamp: 2008-01-25T12:53:14+00:00, highway: crossing, created_by: hand] Node 2 (52°00'56"N, 000°13'18"W) [visible, user: jnrowe, timestamp: 2008-01-25T12:52:30+00:00, amenity: pub]
|
Generate a OSM way element subtree >>> ET.tostring(Way(0, (0, 1, 2)).toosm()) '<way id="0" visible="false"><nd ref="0" /><nd ref="1" /><nd ref="2" /></way>' >>> ET.tostring(Way(0, (0, 1, 2), True, "jnrowe", Timestamp(2008, 1, 25)).toosm()) '<way id="0" timestamp="2008-01-25T00:00:00+00:00" user="jnrowe" visible="true"><nd ref="0" /><nd ref="1" /><nd ref="2" /></way>' >>> ET.tostring(Way(0, (0, 1, 2), tags={"key": "value"}).toosm()) '<way id="0" visible="false"><tag k="key" v="value" /><nd ref="0" /><nd ref="1" /><nd ref="2" /></way>'
|
|
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Tue May 20 12:41:34 2008 | http://epydoc.sourceforge.net |