-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Filter Mapillary images by organzation_id
- Loading branch information
1 parent
64e1547
commit 8729b4f
Showing
4 changed files
with
105 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/** | ||
* Mapillary GraphQueryCreator which allow filtering by organisation_id. | ||
*/ | ||
export default class MapillaryGraphQueryCreator { | ||
/** | ||
* @param {string} organizationId The id of the organization to get images from. | ||
*/ | ||
constructor(organizationId) { | ||
this.organizationId = organizationId; | ||
|
||
this.imagesPath = 'images'; | ||
this.sequencePath = 'image_ids'; | ||
this._imageTilesPath = 'tiles'; | ||
|
||
this.coreFields = ['computed_geometry', 'geometry', 'sequence']; | ||
this.idFields = ['id']; | ||
this.spatialFields = [ | ||
'altitude', | ||
'atomic_scale', | ||
'camera_parameters', | ||
'camera_type', | ||
'captured_at', | ||
'compass_angle', | ||
'computed_altitude', | ||
'computed_compass_angle', | ||
'computed_rotation', | ||
'creator', | ||
'exif_orientation', | ||
'height', | ||
'merge_cc', | ||
'mesh', | ||
'organization', | ||
'quality_score', | ||
'sfm_cluster', | ||
'thumb_1024_url', | ||
'thumb_2048_url', | ||
'width', | ||
]; | ||
this.imageTileFields = ['url', 'z', 'x', 'y']; | ||
} | ||
|
||
images(imageIds, fields) { | ||
return `image_ids=${imageIds.join(',')}&fields=${fields.join(',')}`; | ||
} | ||
|
||
imagesS2(cellId, fields) { | ||
return `organization_id=${this.organizationId}&s2=${cellId}&fields=${fields.join(',')}`; | ||
} | ||
|
||
imageTiles(z, fields) { | ||
return `z=${z}&fields=${fields.join(',')}`; | ||
} | ||
|
||
imageTilesPath(imageId) { | ||
return `${imageId}/${this._imageTilesPath}`; | ||
} | ||
|
||
sequence(sequenceId) { | ||
return `sequence_id=${sequenceId}`; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters