You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/user_manual/02-Extracting-Object-Data.md
+20-3Lines changed: 20 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,8 @@ Finally, there is a type for changesets, which contains information about
14
14
edits in the OSM database. It can only appear in special changeset files
15
15
and explained in more detail [below](#changeset).
16
16
17
-
The FileProcessor may return any of these objects, when iterating over a file.
17
+
When iterating over a file, then the FileProcessor may return any of these
18
+
objects.
18
19
Therefore, a script will usually first need to determine the type of object
19
20
received. There are a couple of ways to do this.
20
21
@@ -83,7 +84,7 @@ You can simply test for this object type:
83
84
## Reading object tags
84
85
85
86
Every object has a list of properties, the tags. They can be accessed through
86
-
the `tags` property, which provides a simple dictionary-like view of the tags.
87
+
the `tags` property. It provides a simple dictionary-like view of the tags.
87
88
You can use the bracket notation to access a specific tag or use the more
88
89
explicit `get()` function. Just like for Python dictionaries, an access by
89
90
bracket raises a `ValueError` when the key you are looking for does not exist,
@@ -140,7 +141,23 @@ list into a Python dictionary:
140
141
## Other common meta information
141
142
142
143
Next to the tags, every OSM object also carries some meta information
143
-
describing its ID, version and information regarding the editor.
144
+
which all can be accessed through read-only properties.
145
+
146
+
The most important meta information is the object's ID in the `id` property.
147
+
This is the ID used when object reference each other.
148
+
149
+
The other meta information mostly relates when and by whom it was edited.
150
+
The following table gives a quick overview over the properties:
151
+
152
+
| Property | Description |
153
+
|-----------|--------------------------|
154
+
| version | Version of the object. A newly created object starts with version 1. |
155
+
| deleted | A boolean property saying if the object should be used or ignored. Only relevant for [change](08-Working-With-Change-Files.md) and [history](09-Working-With-History-Files.md) files. |
156
+
| changeset | The ID of the change set this object was created with. A change set contains a set of edits that have been uploaded by an editor in a single session. |
157
+
| timestamp | UTC time at which the object was created, or more precisely, added into the database. |
158
+
| uid | The ID of the user who created this version of the object. User IDs are univocal and prepetual. |
159
+
| user | The name of the user who created this version of the object. This is the name the user had when the object was created. User names may be changed over time. The same name in different objects doesn't necessarily mean that the change was made by the same user. |
0 commit comments