Add CLI and listeners to reverse geocode pictures' coordinates#1310
Merged
Add CLI and listeners to reverse geocode pictures' coordinates#1310
Conversation
Collaborator
Author
|
/backport to stable25 |
40ba055 to
3d80638
Compare
9bc8195 to
03a153d
Compare
3d80638 to
af2731c
Compare
03a153d to
bfaaab6
Compare
6bb4679 to
01ee346
Compare
2d310e1 to
0063898
Compare
0063898 to
b852838
Compare
artonge
commented
Oct 24, 2022
|
|
||
| use OC\Metadata\FileMetadata; | ||
|
|
||
| class PhotosFile { |
Collaborator
Author
There was a problem hiding this comment.
Review hint: extracted from AlbumFile so it can be shared with LocationFile
309b238 to
ece1721
Compare
artonge
commented
Feb 2, 2023
| private int $size; | ||
| private int $mtime; | ||
| private string $etag; | ||
| class AlbumFile extends PhotosFile { |
Collaborator
Author
There was a problem hiding this comment.
Review hint: extracted to PhotosFile so it can be shared with LocationFile
artonge
commented
Feb 13, 2023
520924d to
42dc0a5
Compare
artonge
commented
Feb 14, 2023
artonge
commented
Feb 14, 2023
artonge
commented
Feb 14, 2023
3fecbd9 to
4d4f6fd
Compare
artonge
commented
Feb 21, 2023
419dcc9 to
5f5fc2f
Compare
artonge
commented
Feb 21, 2023
ArtificialOwl
approved these changes
Feb 22, 2023
artonge
commented
Feb 22, 2023
5db737a to
24dda33
Compare
The location data is stored inside `oc_files_metadata`.
- `occ photos:update-1000-cities` to update the cities1000 file.
- `occ photos:map-media-to-location`to map picture coordinates to a location
- `ReverseGeoCoderService` download the necessary files and build the `KDTree`
- `UpdateReverseGeocodingFilesCommand` command to allow to manually create the needed reverse geocoding files
- `MediaLocationManager` to manager the location mappings
- `MapMediaToLocationCommand` command to manually trigger location data mapping. Useful for pre-existing pictures.
- `LocationManagerNodeEventListener` to react to node, user and share events.
- `MapMediaToLocationJob` to reduce the load in event listeners
```php
┌─────────────────────┐
┌────────────►│MapMediaToLocationJob│
│ └─────────┬───────────┘
│ │
┌────────────────────────┴───────┐ │
│LocationManagerNodeEventListener├──┐ ▼
└────────────────────────────────┘ │ ┌────────────────────┐ ┌──────────────┐
├─►│MediaLocationManager├────►│LocationMapper│
┌─────────────────────────┐ │ └─────────┬──────────┘ └──────────────┘
│MapMediaToLocationCommand├─────────┘ │
└─────────────────────────┘ │
▼
┌──────────────────────────────────┐ ┌──────────────────────┐
│UpdateReverseGeocodingFilesCommand├──►│ReverseGeoCoderService│
└──────────────────────────────────┘ └──────────────────────┘
```
Signed-off-by: Louis Chemineau <louis@chmn.me>
24dda33 to
d94f30c
Compare
1 task
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add commands and listeners to generate location data of files:
The location data is stored inside
oc_files_metadata.Added commands
occ photos:update-1000-citiesto update the cities1000 file.occ photos:map-media-to-locationto map picture coordinates to a locationArchitecture
ReverseGeoCoderServicedownload the necessary files and build theKDTreeUpdateReverseGeocodingFilesCommandcommand to allow to manually create the needed reverse geocoding filesMediaLocationManagerto manager the location mappingsMapMediaToLocationCommandcommand to manually trigger location data mapping. Useful for pre-existing pictures.LocationManagerNodeEventListenerto react to node, user and share events.MapMediaToLocationJobto reduce the load in event listeners┌─────────────────────┐ ┌────────────►│MapMediaToLocationJob│ │ └─────────┬───────────┘ │ │ ┌────────────────────────┴───────┐ │ │LocationManagerNodeEventListener├──┐ ▼ └────────────────────────────────┘ │ ┌────────────────────┐ ┌──────────────┐ ├─►│MediaLocationManager├────►│LocationMapper│ ┌─────────────────────────┐ │ └─────────┬──────────┘ └──────────────┘ │MapMediaToLocationCommand├─────────┘ │ └─────────────────────────┘ │ ▼ ┌──────────────────────────────────┐ ┌──────────────────────┐ │UpdateReverseGeocodingFilesCommand├──►│ReverseGeoCoderService│ └──────────────────────────────────┘ └──────────────────────┘