geodata_places does not include cities500 #6486

Open
opened 2026-02-05 12:19:11 +03:00 by OVERLORD · 10 comments
Owner

Originally created by @lugaetsch on GitHub (Jul 22, 2025).

Originally assigned to: @zackpollard on GitHub.

I have searched the existing issues, both open and closed, to make sure this is not a duplicate report.

  • Yes

The bug

Hi guys!
I am a big fan of the concept behind immich. What kept me away from migrating all my photos to immich is the following:
I uploaded a couple of pictures to immich using webUI after activated reverse-geodata through the installation-wizard.
The metadata is extracted successfully using the right gelocation data (longitude/latitude) but the location regarding 'places' is not showing correctly. I figured out that immich uses geonames and fills the postgres database 'geodata_places' with information for using the right location/place regarding the geodata metadata. Digging into the database geodata_places gives me a ton of entries but I am still missing entries from certain districts. That's why I did a research and can confirm, that the cities500.txt is loaded into the database:

immich=# SELECT * FROM system_metadata;
           key            |                                                            value
--------------------------+-----------------------------------------------------------------------------------------------------------------------------
 system-flags             | {"mountChecks": {"thumbs": true, "upload": true, "backups": true, "library": true, "profile": true, "encoded-video": true}}
 version-check-state      | {"checkedAt": "2025-07-22T14:33:32.696Z", "releaseVersion": "v1.135.3"}
 system-config            | {}
 admin-onboarding         | {"isOnboarded": true}
 reverse-geocoding-state  | {"lastUpdate": "2025-05-06T11:18:33+00:00", "lastImportFileName": "cities500.txt"}

But I am still missing plenty of districts from German Cities.

The OS that Immich Server is running on

Ubuntu 24.04

Version of Immich Server

v1.135.3

Version of Immich Mobile App

none

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

#
# WARNING: To install Immich, follow our guide: https://immich.app/docs/install/docker-compose
#
# Make sure to use the docker-compose.yml of the current release:
#
# https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml
#
# The compose file on main may not be compatible with the latest release.

name: immich

services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    # extends:
    #   file: hwaccel.transcoding.yml
    #   service: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding
    volumes:
      # Do not edit the next line. If you want to change the media storage location on your system, edit the value of UPLOAD_LOCATION in the .env file
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      #- /etc/localtime:/etc/localtime:ro
    env_file:
      - .env
    ports:
      - '2283:2283'
    depends_on:
      - redis
      - database
    restart: always
    healthcheck:
      disable: false

  immich-machine-learning:
    container_name: immich_machine_learning
    # For hardware acceleration, add one of -[armnn, cuda, rocm, openvino, rknn] to the image tag.
    # Example tag: ${IMMICH_VERSION:-release}-cuda
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
    # extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/ml-hardware-acceleration
    #   file: hwaccel.ml.yml
    #   service: cpu # set to one of [armnn, cuda, rocm, openvino, openvino-wsl, rknn] for accelerated inference - use the `-wsl` version for WSL2 where applicable
    volumes:
      - model-cache:/cache
    env_file:
      - .env
    restart: always
    healthcheck:
      disable: false

  redis:
    container_name: immich_redis
    image: docker.io/valkey/valkey:8-bookworm@sha256:facc1d2c3462975c34e10fccb167bfa92b0e0dbd992fc282c29a61c3243afb11
    healthcheck:
      test: redis-cli ping || exit 1
    restart: always

  database:
    container_name: immich_postgres
    image: ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0@sha256:5f6a838e4e44c8e0e019d0ebfe3ee8952b69afc2809b2c25f7b0119641978e91
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
      POSTGRES_INITDB_ARGS: '--data-checksums'
      # Uncomment the DB_STORAGE_TYPE: 'HDD' var if your database isn't stored on SSDs
      # DB_STORAGE_TYPE: 'HDD'
    volumes:
      # Do not edit the next line. If you want to change the database storage location on your system, edit the value of DB_DATA_LOCATION in the .env file
      - ${DB_DATA_LOCATION}:/var/lib/postgresql/data
    shm_size: 128mb
    restart: always

volumes:
  model-cache:

Your .env content

# You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables

# The location where your uploaded files are stored
UPLOAD_LOCATION=./library

# The location where your database files are stored. Network shares are not supported for the database
DB_DATA_LOCATION=./postgres

# To set a timezone, uncomment the next line and change Etc/UTC to a TZ identifier from this list: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List
# TZ=Etc/UTC

# The Immich version to use. You can pin this to a specific version like "v1.71.0"
IMMICH_VERSION=release

# Connection secret for postgres. You should change it to a random password
# Please use only the characters `A-Za-z0-9`, without special characters or spaces
DB_PASSWORD=postgres

# The values below this line do not need to be changed
###################################################################################
DB_USERNAME=postgres
DB_DATABASE_NAME=immich
# Timezone
TZ=Europe/Berlin

Reproduction steps

  1. Upload photo
  2. set location/place
  3. Can't find location
  4. compose down, compose up

Relevant log output


Additional information

No response

Originally created by @lugaetsch on GitHub (Jul 22, 2025). Originally assigned to: @zackpollard on GitHub. ### I have searched the existing issues, both open and closed, to make sure this is not a duplicate report. - [x] Yes ### The bug Hi guys! I am a big fan of the concept behind immich. What kept me away from migrating all my photos to immich is the following: I uploaded a couple of pictures to immich using webUI after activated reverse-geodata through the installation-wizard. The metadata is extracted successfully using the right gelocation data (longitude/latitude) **but** the location regarding 'places' is not showing correctly. I figured out that immich uses geonames and fills the postgres database 'geodata_places' with information for using the right location/place regarding the geodata metadata. Digging into the database geodata_places gives me a ton of entries but I am still missing entries from certain districts. That's why I did a research and can confirm, that the cities500.txt is loaded into the database: ``` immich=# SELECT * FROM system_metadata; key | value --------------------------+----------------------------------------------------------------------------------------------------------------------------- system-flags | {"mountChecks": {"thumbs": true, "upload": true, "backups": true, "library": true, "profile": true, "encoded-video": true}} version-check-state | {"checkedAt": "2025-07-22T14:33:32.696Z", "releaseVersion": "v1.135.3"} system-config | {} admin-onboarding | {"isOnboarded": true} reverse-geocoding-state | {"lastUpdate": "2025-05-06T11:18:33+00:00", "lastImportFileName": "cities500.txt"} ``` But I am still missing plenty of districts from German Cities. ### The OS that Immich Server is running on Ubuntu 24.04 ### Version of Immich Server v1.135.3 ### Version of Immich Mobile App none ### Platform with the issue - [x] Server - [x] Web - [ ] Mobile ### Your docker-compose.yml content ```YAML # # WARNING: To install Immich, follow our guide: https://immich.app/docs/install/docker-compose # # Make sure to use the docker-compose.yml of the current release: # # https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml # # The compose file on main may not be compatible with the latest release. name: immich services: immich-server: container_name: immich_server image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release} # extends: # file: hwaccel.transcoding.yml # service: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding volumes: # Do not edit the next line. If you want to change the media storage location on your system, edit the value of UPLOAD_LOCATION in the .env file - ${UPLOAD_LOCATION}:/usr/src/app/upload #- /etc/localtime:/etc/localtime:ro env_file: - .env ports: - '2283:2283' depends_on: - redis - database restart: always healthcheck: disable: false immich-machine-learning: container_name: immich_machine_learning # For hardware acceleration, add one of -[armnn, cuda, rocm, openvino, rknn] to the image tag. # Example tag: ${IMMICH_VERSION:-release}-cuda image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release} # extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/ml-hardware-acceleration # file: hwaccel.ml.yml # service: cpu # set to one of [armnn, cuda, rocm, openvino, openvino-wsl, rknn] for accelerated inference - use the `-wsl` version for WSL2 where applicable volumes: - model-cache:/cache env_file: - .env restart: always healthcheck: disable: false redis: container_name: immich_redis image: docker.io/valkey/valkey:8-bookworm@sha256:facc1d2c3462975c34e10fccb167bfa92b0e0dbd992fc282c29a61c3243afb11 healthcheck: test: redis-cli ping || exit 1 restart: always database: container_name: immich_postgres image: ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0@sha256:5f6a838e4e44c8e0e019d0ebfe3ee8952b69afc2809b2c25f7b0119641978e91 environment: POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_USER: ${DB_USERNAME} POSTGRES_DB: ${DB_DATABASE_NAME} POSTGRES_INITDB_ARGS: '--data-checksums' # Uncomment the DB_STORAGE_TYPE: 'HDD' var if your database isn't stored on SSDs # DB_STORAGE_TYPE: 'HDD' volumes: # Do not edit the next line. If you want to change the database storage location on your system, edit the value of DB_DATA_LOCATION in the .env file - ${DB_DATA_LOCATION}:/var/lib/postgresql/data shm_size: 128mb restart: always volumes: model-cache: ``` ### Your .env content ```Shell # You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables # The location where your uploaded files are stored UPLOAD_LOCATION=./library # The location where your database files are stored. Network shares are not supported for the database DB_DATA_LOCATION=./postgres # To set a timezone, uncomment the next line and change Etc/UTC to a TZ identifier from this list: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List # TZ=Etc/UTC # The Immich version to use. You can pin this to a specific version like "v1.71.0" IMMICH_VERSION=release # Connection secret for postgres. You should change it to a random password # Please use only the characters `A-Za-z0-9`, without special characters or spaces DB_PASSWORD=postgres # The values below this line do not need to be changed ################################################################################### DB_USERNAME=postgres DB_DATABASE_NAME=immich # Timezone TZ=Europe/Berlin ``` ### Reproduction steps 1. Upload photo 2. set location/place 3. Can't find location 4. compose down, compose up ### Relevant log output ```shell ``` ### Additional information _No response_
OVERLORD added the 🗄️server label 2026-02-05 12:19:11 +03:00
Author
Owner

@zackpollard commented on GitHub (Jul 22, 2025):

You can check GeoNames and see if the districts you are referring to 1.) have population numbers associated with them and 2.) that number is higher than 500. If either of these things aren't true, they won't be included in the data that we import into Immich. You can however correct these through their website and we will import the new data whenever a new release happens. Please do make sure any information you add to geonames dataset is correct however.

@zackpollard commented on GitHub (Jul 22, 2025): You can check [GeoNames](https://www.geonames.org/) and see if the districts you are referring to 1.) have population numbers associated with them and 2.) that number is higher than 500. If either of these things aren't true, they won't be included in the data that we import into Immich. You can however correct these through their website and we will import the new data whenever a new release happens. Please do make sure any information you add to geonames dataset is correct however.
Author
Owner

@lugaetsch commented on GitHub (Jul 22, 2025):

@zackpollard Thanks for the Fast reply, the desired place is in the cities500.txt and referring to geonames one of the district i dont see in the database and in webUI has 40906 Population…

@lugaetsch commented on GitHub (Jul 22, 2025): @zackpollard Thanks for the Fast reply, the desired place is in the cities500.txt and referring to geonames one of the district i dont see in the database and in webUI has 40906 Population…
Author
Owner

@zackpollard commented on GitHub (Jul 22, 2025):

@zackpollard Thanks for the Fast reply, the desired place is in the cities500.txt and referring to geonames one of the district i dont see in the database and in webUI has 40906 Population…

Can you let me know what place this is? Then I can take a look

@zackpollard commented on GitHub (Jul 22, 2025): > [@zackpollard](https://github.com/zackpollard) Thanks for the Fast reply, the desired place is in the cities500.txt and referring to geonames one of the district i dont see in the database and in webUI has 40906 Population… Can you let me know what place this is? Then I can take a look
Author
Owner

@lugaetsch commented on GitHub (Jul 22, 2025):

Of course! You may take any district in Hamburg for example. Take this as one of a section in a district https://www.geonames.org/2862606/niendorf.html

@lugaetsch commented on GitHub (Jul 22, 2025): Of course! You may take any district in Hamburg for example. Take this as one of a section in a district https://www.geonames.org/2862606/niendorf.html
Author
Owner

@Saschl commented on GitHub (Jul 23, 2025):

The place is marked as PPLX, and immich seems to skip over those (https://github.com/immich-app/immich/blob/main/server/src/repositories/map.repository.ts#L279). I noticed that in the past as well, but in my case I changed it in geonames as it seemed wrong to me

@Saschl commented on GitHub (Jul 23, 2025): The place is marked as PPLX, and immich seems to skip over those (https://github.com/immich-app/immich/blob/main/server/src/repositories/map.repository.ts#L279). I noticed that in the past as well, but in my case I changed it in geonames as it seemed wrong to me
Author
Owner

@lugaetsch commented on GitHub (Jul 23, 2025):

The place is marked as PPLX, and immich seems to skip over those (https://github.com/immich-app/immich/blob/main/server/src/repositories/map.repository.ts#L279). I noticed that in the past as well, but in my case I changed it in geonames as it seemed wrong to me

I see, but how comes I find it in the cities500.txt which is consumed at the initial deployment?
Furthermore this https://www.geonames.org/11669485/eimsbuettel.html should be found at least as an administrative unit, shouldn‘t it?

@lugaetsch commented on GitHub (Jul 23, 2025): > The place is marked as PPLX, and immich seems to skip over those (https://github.com/immich-app/immich/blob/main/server/src/repositories/map.repository.ts#L279). I noticed that in the past as well, but in my case I changed it in geonames as it seemed wrong to me I see, but how comes I find it in the cities500.txt which is consumed at the initial deployment? Furthermore this https://www.geonames.org/11669485/eimsbuettel.html should be found at least as an administrative unit, shouldn‘t it?
Author
Owner

@skatsubo commented on GitHub (Jul 23, 2025):

Furthermore this https://www.geonames.org/11669485/eimsbuettel.html should be found at least as an administrative unit, shouldn‘t it?

Somehow Eimsbuettel is PPLX in the immich docker image 🤷

docker compose exec immich-server grep -i Eimsbu /build/geodata/cities500.txt 

2911293	Eimsbüttel	Eimsbuettel	Ajmsbitel,<...>	53.57416	9.95679	P	PPLX	DE		04	00	02000	02000000	269118		16	Europe/Berlin	2023-03-06
@skatsubo commented on GitHub (Jul 23, 2025): > Furthermore this https://www.geonames.org/11669485/eimsbuettel.html should be found at least as an administrative unit, shouldn‘t it? Somehow Eimsbuettel is PPLX in the immich docker image 🤷 ```sh docker compose exec immich-server grep -i Eimsbu /build/geodata/cities500.txt 2911293 Eimsbüttel Eimsbuettel Ajmsbitel,<...> 53.57416 9.95679 P PPLX DE 04 00 02000 02000000 269118 16 Europe/Berlin 2023-03-06 ```
Author
Owner

@zackpollard commented on GitHub (Jul 23, 2025):

PPLX is considered a subsection of a populated place, which I guess a district does fall into. I would need to take a look deeper into this to understand the implications if we removed the filter of PPLX from the import process.

@zackpollard commented on GitHub (Jul 23, 2025): PPLX is considered a subsection of a populated place, which I guess a district does fall into. I would need to take a look deeper into this to understand the implications if we removed the filter of PPLX from the import process.
Author
Owner

@MasterSmurf commented on GitHub (Aug 15, 2025):

I’ve also noticed that photos taken in (german) cities, within a widely populated districts are not displayed — instead, the neighboring village is.

@MasterSmurf commented on GitHub (Aug 15, 2025): I’ve also noticed that photos taken in (german) cities, within a widely populated districts are not displayed — instead, the neighboring village is.
Author
Owner

@justspacedog commented on GitHub (Jan 29, 2026):

I have the same issue. At first, I thought that perhaps the GPS coordinates are used to generate an address, which is then used to look up the textual location. This would make some sense, since the exact same street name exists in a neighboring town and navigation systems or the postal service are often confused by this.

However, even if that were the case, both addresses belong to the same city, which also has a larger population than the town Immich is selecting.

Attached is a screenshot from Google Maps showing the location of the image, the location of the place with the identical address, the city both locations belong to (including the boundary that defines it), and the city Immich is using. The city chosen by Immich lies outside the boundary and has a smaller population, but is geographically closer to both locations.

Image

@justspacedog commented on GitHub (Jan 29, 2026): I have the same issue. At first, I thought that perhaps the GPS coordinates are used to generate an address, which is then used to look up the textual location. This would make some sense, since the exact same street name exists in a neighboring town and navigation systems or the postal service are often confused by this. However, even if that were the case, both addresses belong to the same city, which also has a larger population than the town Immich is selecting. Attached is a screenshot from Google Maps showing the location of the image, the location of the place with the identical address, the city both locations belong to (including the boundary that defines it), and the city Immich is using. The city chosen by Immich lies outside the boundary and has a smaller population, but is geographically closer to both locations. ![Image](https://github.com/user-attachments/assets/7307d4bd-26ab-4d1a-9c31-ff4f04432666)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#6486