Skip to content

feat(server): country geocoding for remote locations - #10950

Merged
zackpollard merged 12 commits into
immich-app:mainfrom
pokjay:feat/remote-location-geocoding
Jul 18, 2024
Merged

zackpollard merged 12 commits into
immich-app:mainfrom
pokjay:feat/remote-location-geocoding

Conversation

@pokjay

@pokjay pokjay commented Jul 7, 2024

Copy link
Copy Markdown
Contributor

Add country reverse geocoding in case city geocoding is null. Uses country boundaries from Natural Earth

Dependencies

base-images PR: immich-app/base-images#80

Database changes:

  1. Create new table naturalearth_countries with country polygons. Each country will have a row for each polygon.

Server changes:

  1. Load geojson file to database
  2. When city geocoding fails, fallback to geocode using country polygon

Note - this uses the current geocoding state metadata for DB import

Web UI changes:

  1. Allow showing partial location info in asset panel in cases where there is no city:
    Screenshot 2024-07-07 at 22 54 03

@danieldietzler
danieldietzler force-pushed the feat/remote-location-geocoding branch from f97d14d to 9b0e9a8 Compare July 17, 2024 20:10
@zackpollard zackpollard changed the title feat(server): Country geocoding for remote locations feat(server): country geocoding for remote locations Jul 17, 2024
@danieldietzler
danieldietzler force-pushed the feat/remote-location-geocoding branch from 203d1f3 to 9b20af2 Compare July 17, 2024 20:54
@danieldietzler
danieldietzler force-pushed the feat/remote-location-geocoding branch from 9b20af2 to 96a7dbb Compare July 17, 2024 21:15
@danieldietzler
danieldietzler force-pushed the feat/remote-location-geocoding branch from 4fa7d0d to c6920f5 Compare July 17, 2024 21:48
);
return null;

const ne_response = await this.naturalEarthCountriesRepository

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should change the above condition to return if it has a response. Then, de-indent all of this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the code. Definitely makes it clearer!

@zackpollard
zackpollard enabled auto-merge (squash) July 18, 2024 10:45
@zackpollard
zackpollard merged commit 4f89195 into immich-app:main Jul 18, 2024
@mschiff

mschiff commented Jul 23, 2024

Copy link
Copy Markdown

What needs to be done after an upgrade to 1.109 in order to make use of this for existing images?

@zackpollard

Copy link
Copy Markdown
Member

What needs to be done after an upgrade to 1.109 in order to make use of this for existing images?

Re-running the extract metadata job for all images should do it 🙂

@mschiff

mschiff commented Jul 23, 2024

Copy link
Copy Markdown

What needs to be done after an upgrade to 1.109 in order to make use of this for existing images?

Re-running the extract metadata job for all images should do it 🙂

Thanks! I think this would be worth mentioning in the changelog/release notes for such kind of change, thanks for helping! Much appreciated!

@mschiff mschiff mentioned this pull request Jul 23, 2024
2 of 3 tasks
@pokjay
pokjay deleted the feat/remote-location-geocoding branch August 3, 2024 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants