Comments (8)
This is not so much an incorrect classification as it is the fact that we're trying to squeeze four fields (name, admin1Name, admin2Name, country) into three (city, state, country). The "name" part is inconsistent: sometimes it's a city, sometimes it's a neighborhood. admin2Name is also similarly sometimes a county and sometimes a city.
Concatenating admin1Name and admin2Name as the "state" is what we've gone with for now, but it isn't perfect, as you've noticed. Maybe concatenating the name and admin2Name fields would make more sense since they're more "city-like"; admin1Name is generally consistent in being a state/province.
from immich.
To give an example, admin1Name
is New York (the state), admin2Name
is Kings County, and then there are a bunch of neighborhoods like Brooklyn Heights for the name
. So let's say we change it to show admin2Name
, admin1Name
and the country to get Kings County, New York, US. Now if you search for the city "Marseille", you'll get no results because it's listed as a name
and admin2Name
in this case is a department.
from immich.
I wasn't sure how Immich is doing the reverse geocoding (and I'm still not 100% sure), but I see you have downloaded the txt files from https://download.geonames.org/export/dump/readme.txt. Is name
coming from the file cities500.txt
?
First off, I only have context on how this work in the US and Mexico, so I don't know if this is how other countries geographical areas are organized.
Reading the geoNames docs, it seems like admin1Name is considered the first level division of a country, so, at least in the US and Mexico, that's always a state:
grep "US\..*" admin1CodesASCII.txt
US.AR Arkansas Arkansas 4099753
...
US.VA Virginia Virginia 6254928
As for admin2, again, in Mexico and the US, second level divisions are counties or municipalities which are not cities, while they are sometimes interchangeable and/or have the same name, using NY as an example:
grep "US\.NY\..*" admin2Codes.txt
US.NY.001 Albany County Albany County 5106841
...
US.NY.047 Kings County Kings County 6941775
What's more, all end in "County". So this doesn't seem useful for Immich, at least not within the 3 location subdivisions that Immich uses.
In cities500.txt
it seems there are any other sub-divisions, including neighborhoods, residential areas, etc.
In my examples "Brooklyn Heights" has the P tag "PPLX"
which according to geonames docs it's a "Section of a populated place". In the case of NYC, NYC has the PPL
tag, and each of the boroughs has the PPLA2
tag. (i.e.: Brooklyn, Bronx, etc.).
As for the Mexico example, "Paseos del Valle [Fraccionamiento]" is listed with "PPL"
. Then "Tlajomulco de Zuñiga" (which immic got from admin2
according to what you described) is the municipality, not the city, which would be again wrong, if it had a different name to the city. There's a "Tlajomulco de Zuñiga" entry in countries500.txt
with the tag "PPLA2"
which refers to the actual city :)
from immich.
TL;DR; For "City" it seems to me it'd be good to always exclude PPLX places, as they seem to refer to not cities, prefer to use any tags more specific than PPL, and fallback to PPL otherwise. For State admin1CodesASCII.txt
looks to be perfect. But I wonder if this would be a good generalization for other countries as well. I might be interested in contributing to improve this functionality if possible
from immich.
That's a great idea! We don't even ingest these tags into the database, much less use them. For reference, we ingest the geodata here and do the reverse geocoding here.
from immich.
cc @zackpollard, you had ideas about improving the geocoder detail level right?
from immich.
cc @zackpollard, you had ideas about improving the geocoder detail level right?
Yea, we do have a lot more detailed data available to us, however it needs a lot of sanitisation to be usable for what we want. It should offer some quite significant improvements to accuracy, especially when in built up areas though.
from immich.
As for the comments above, yea I have also noticed this behaviour previously, if there is a quick improvement we can make here with that date then I think it would be good to do it, but also yes let's check a few other countries to see if it's the same for them too.
from immich.
Related Issues (20)
- Opening bottom drawer causes reload HOT 1
- Immich labelling photo locations taken near a country border inaccurately. HOT 1
- failed with status 500: Internal Server Error HOT 3
- Failed to generate preview for Adobe ACR exported JXL picture.
- Thunmbnails and photos are not shown in web ui
- When changing thumbnail folder, it defaults back to the previous folder a few hours after changing
- Can't log into Android mobile app. HOT 1
- problem with two or more live photos (i.e. heic) that have same livePhotoCID and same owner HOT 1
- Database restore on v.1.112.1 throws error during execution HOT 5
- Immich Android App - Horizontal Layout HOT 1
- bug(mobile): image editor icon under navigation bar HOT 3
- Web Camera Model Not Being Populated in Advanced Search HOT 1
- Cannot restore postgres database - ERROR: role "postgres" already exists
- album via an external link pictures are not shown HOT 5
- External Library not finding new files HOT 6
- Improve machine learning resilience in low VRAM scenarios (CUDA)
- Web: "Expire After" dropdown options in create share link modal hidden behind scrollbar HOT 5
- Web: Shared links back navigation button navigates to wrong page
- Purchase in JPY shows wrong amount HOT 1
- Extremely long images appears "squashed" when the original is loaded on mobile app HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from immich.