|
| 1 | +--- |
| 2 | +sidebar position: 2 |
| 3 | +--- |
| 4 | + |
| 5 | + |
| 6 | +### mapillary.config.api.entities |
| 7 | + |
| 8 | +This module contains the class implementation of the Entities API endpoints |
| 9 | +as string, for the entity API endpoint aspect of the API v4 of Mapillary. |
| 10 | + |
| 11 | +For more information, please check out [https://www.mapillary.com/developer/api-documentation/](https://www.mapillary.com/developer/api-documentation/). |
| 12 | + |
| 13 | + |
| 14 | +* Copyright: (c) 2021 Facebook |
| 15 | + |
| 16 | + |
| 17 | +* License: MIT LICENSE |
| 18 | + |
| 19 | + |
| 20 | +### class mapillary.config.api.entities.Entities() |
| 21 | +Bases: `object` |
| 22 | + |
| 23 | +Each API call requires specifying the fields of the Entity you’re interested in explicitly. |
| 24 | +A sample image by ID request which returns the id and a computed geometry could look as |
| 25 | +below. For each entity available fields are listed in the relevant sections. All IDs are |
| 26 | +unique and the underlying metadata for each entity is accessible at |
| 27 | +[https://graph.mapillary.com/:id?fields=A,B,C](https://graph.mapillary.com/:id?fields=A,B,C). The responses are uniform and always return |
| 28 | +a single object, unless otherwise stated (collection endpoints). All collection endpoint |
| 29 | +metadata are wrapped in a {“data”: [ {…}, …]} JSON object. |
| 30 | + |
| 31 | +Usage: |
| 32 | + |
| 33 | +``` |
| 34 | +$ GET 'https://graph.mapillary.com/$IMAGE_ID?access_token=TOKEN&fields=id,computed_geometry' |
| 35 | +... { |
| 36 | +... "id": "$IMAGE_ID", |
| 37 | +... "computed_geometry": { |
| 38 | +... "type": "Point", |
| 39 | +... "coordinates": [0, 0] |
| 40 | +... } |
| 41 | +... } |
| 42 | +``` |
| 43 | + |
| 44 | + |
| 45 | +#### static get_detection_with_image_id(image_id: str, fields: list) |
| 46 | +Represent an object detected in a single image. For convenience |
| 47 | +this version of the API serves detections as collections. They can be |
| 48 | +requested as a collection on the resource (e.g. image) they contribute |
| 49 | +or belong to. |
| 50 | + |
| 51 | +Usage: |
| 52 | + |
| 53 | +``` |
| 54 | +>>> 'https://graph.mapillary.com/:image_id/detections' |
| 55 | +>>> # detections in the image with ID image_id |
| 56 | +``` |
| 57 | + |
| 58 | +Fields: |
| 59 | + |
| 60 | +``` |
| 61 | +1. created_at - timestamp, when was this detection created |
| 62 | +2. geometry - string, base64 encoded polygon |
| 63 | +3. image - object, image the detection belongs to |
| 64 | +4. value - string, what kind of object the detection represents |
| 65 | +``` |
| 66 | + |
| 67 | + |
| 68 | +#### static get_detection_with_image_id_fields() |
| 69 | +Gets list of possible detections for image ids |
| 70 | + |
| 71 | + |
| 72 | +* **Returns** |
| 73 | + |
| 74 | + Possible detection parameters |
| 75 | + |
| 76 | + |
| 77 | + |
| 78 | +* **Return type** |
| 79 | + |
| 80 | + list |
| 81 | + |
| 82 | + |
| 83 | + |
| 84 | +#### static get_detection_with_map_feature_id(map_feature_id: str, fields: list) |
| 85 | +Represent an object detected in a single image. For convenience |
| 86 | +this version of the API serves detections as collections. They can be |
| 87 | +requested as a collection on the resource (e.g. map feature) they |
| 88 | +contribute or belong to. |
| 89 | + |
| 90 | +Usage: |
| 91 | + |
| 92 | +``` |
| 93 | +>>> 'https://graph.mapillary.com/:map_feature_id/detections' |
| 94 | +>>> # detections in the image with ID map_feature_id |
| 95 | +``` |
| 96 | + |
| 97 | +Fields: |
| 98 | + |
| 99 | +``` |
| 100 | +1. created_at - timestamp, when was this detection created |
| 101 | +2. geometry - string, base64 encoded polygon |
| 102 | +3. image - object, image the detection belongs to |
| 103 | +4. value - string, what kind of object the detection represents |
| 104 | +``` |
| 105 | + |
| 106 | + |
| 107 | +#### static get_detection_with_map_feature_id_fields() |
| 108 | +Gets list of possible field parameters for map features |
| 109 | + |
| 110 | + |
| 111 | +* **Returns** |
| 112 | + |
| 113 | + Map feature detection fields |
| 114 | + |
| 115 | + |
| 116 | + |
| 117 | +* **Return type** |
| 118 | + |
| 119 | + list |
| 120 | + |
| 121 | + |
| 122 | + |
| 123 | +#### static get_image(image_id: str, fields: list) |
| 124 | +Represents the metadata of the image on the Mapillary platform with |
| 125 | +the following properties. |
| 126 | + |
| 127 | +Usage: |
| 128 | + |
| 129 | +``` |
| 130 | +>>> 'https://graph.mapillary.com/:image_id' # endpoint |
| 131 | +``` |
| 132 | + |
| 133 | +Fields: |
| 134 | + |
| 135 | +``` |
| 136 | +1. altitude - float, original altitude from Exif |
| 137 | +2. atomic_scale - float, scale of the SfM reconstruction around the image |
| 138 | +3. camera_parameters - array of float, intrinsic camera parameters |
| 139 | +4. camera_type - enum, type of camera projection (perspective, fisheye, or spherical) |
| 140 | +5. captured_at - timestamp, capture time |
| 141 | +6. compass_angle - float, original compass angle of the image |
| 142 | +7. computed_altitude - float, altitude after running image processing |
| 143 | +8. computed_compass_angle - float, compass angle after running image processing |
| 144 | +9. computed_geometry - GeoJSON Point, location after running image processing |
| 145 | +10. computed_rotation - enum, corrected orientation of the image |
| 146 | +11. exif_orientation - enum, orientation of the camera as given by the exif tag |
| 147 | + (see: https://sylvana.net/jpegcrop/exif_orientation.html) |
| 148 | +12. geometry - GeoJSON Point geometry |
| 149 | +13. height - int, height of the original image uploaded |
| 150 | +14. thumb_256_url - string, URL to the 256px wide thumbnail |
| 151 | +15. thumb_1024_url - string, URL to the 1024px wide thumbnail |
| 152 | +16. thumb_2048_url - string, URL to the 2048px wide thumbnail |
| 153 | +17. merge_cc - int, id of the connected component of images that were aligned together |
| 154 | +18. mesh - { id: string, url: string } - URL to the mesh |
| 155 | +19. quality_score - float, how good the image is (experimental) |
| 156 | +20. sequence - string, ID of the sequence |
| 157 | +21. sfm_cluster - { id: string, url: string } - URL to the point cloud |
| 158 | +22. width - int, width of the original image uploaded |
| 159 | +``` |
| 160 | + |
| 161 | + |
| 162 | +#### static get_image_fields() |
| 163 | +Gets list of possible image fields |
| 164 | + |
| 165 | + |
| 166 | +* **Returns** |
| 167 | + |
| 168 | + Image field list |
| 169 | + |
| 170 | + |
| 171 | + |
| 172 | +* **Return type** |
| 173 | + |
| 174 | + list |
| 175 | + |
| 176 | + |
| 177 | + |
| 178 | +#### static get_map_feature(map_feature_id: str, fields: list) |
| 179 | +These are objects with a location which have been derived from |
| 180 | +multiple detections in multiple images. |
| 181 | + |
| 182 | +Usage: |
| 183 | + |
| 184 | +``` |
| 185 | +>>> 'https://graph.mapillary.com/:map_feature_id' # endpoint |
| 186 | +``` |
| 187 | + |
| 188 | +Fields: |
| 189 | + |
| 190 | +``` |
| 191 | +1. first_seen_at - timestamp, timestamp of the least recent detection |
| 192 | + contributing to this feature |
| 193 | +2. last_seen_at - timestamp, timestamp of the most recent detection |
| 194 | + contributing to this feature |
| 195 | +3. object_value - string, what kind of map feature it is |
| 196 | +4. object_type - string, either a traffic_sign or point |
| 197 | +5. geometry - GeoJSON Point geometry |
| 198 | +6. images - list of IDs, which images this map feature was derived from |
| 199 | +``` |
| 200 | + |
| 201 | + |
| 202 | +#### static get_map_feature_fields() |
| 203 | +Gets map feature fields |
| 204 | + |
| 205 | + |
| 206 | +* **Returns** |
| 207 | + |
| 208 | + Possible map feature fields |
| 209 | + |
| 210 | + |
| 211 | + |
| 212 | +* **Return type** |
| 213 | + |
| 214 | + list |
| 215 | + |
| 216 | + |
| 217 | + |
| 218 | +#### static get_organization_id(organization_id: str, fields: list) |
| 219 | +Represents an organization which can own the imagery if users |
| 220 | +upload to it |
| 221 | + |
| 222 | +Usage: |
| 223 | + |
| 224 | +``` |
| 225 | +>>> 'https://graph.mapillary.com/:organization_id' # endpoint |
| 226 | +``` |
| 227 | + |
| 228 | +Fields: |
| 229 | + |
| 230 | +``` |
| 231 | +1. slug - short name, used in URLs |
| 232 | +2. name - nice name |
| 233 | +3. description - public description of the organization |
| 234 | +``` |
| 235 | + |
| 236 | + |
| 237 | +#### static get_organization_id_fields() |
| 238 | +Gets list of possible organization id fields |
| 239 | + |
| 240 | + |
| 241 | +* **Returns** |
| 242 | + |
| 243 | + Possible organization fields |
| 244 | + |
| 245 | + |
| 246 | + |
| 247 | +* **Return type** |
| 248 | + |
| 249 | + list |
| 250 | + |
| 251 | + |
| 252 | + |
| 253 | +#### static get_sequence(sequence_id: str) |
| 254 | +Represents a sequence of Image IDs ordered by capture time |
| 255 | + |
| 256 | +Usage: |
| 257 | + |
| 258 | +``` |
| 259 | +>>> 'https://graph.mapillary.com/image_ids?sequence_id=XXX' |
| 260 | +>>> # endpoint |
| 261 | +``` |
| 262 | + |
| 263 | +Fields: |
| 264 | + |
| 265 | +``` |
| 266 | +1. id - ID of the image belonging to the sequence |
| 267 | +``` |
0 commit comments