Author Topic: "City" again  (Read 1535 times)

Offline Hayo Baan

  • Uber Member
  • ******
  • Posts: 2478
  • Professional Photographer & Software Developer
    • View Profile
    • Hayo Baan - Photography
Re: "City" again
« Reply #15 on: April 23, 2019, 11:54:15 PM »
You can absolutely change the formats (this is done in the dialog of the second screenshot). However, there it already is set up to display the zero. I had a look at my PM and there too, I get no leading 0 (just never noticed), so this is a PM thing after all.

@Kirk, it seems for the delimiter you do follow the system preferences (e.g. a dot in Germany, a slash in the Netherlands), but not for the leading zero. This was “wrong” in PM5 already, but perhaps this can be changed (with low priority) to fully follow system preferences.
Hayo Baan - Photography
Web: www.hayobaan.nl

Offline pablogg

  • Camera Bits Staff
  • Member
  • *****
  • Posts: 66
    • View Profile
Re: "City" again
« Reply #16 on: April 26, 2019, 04:07:03 PM »
Note: updated post due to previous entry having incorrect gps location

But it can't find for exampel the "city" for this coordinate: latitude: N52°21.651' longitude: E12°56.990'in Germany. But it finds the "state". And now "Don't overwrite" works. "Deutschland" stays unchanged. So it might not be a bug. And now my trial time is over. I hope I wasn't to confusing. Bottom line: Everything seems to work like it should. Thanks!

-John
With regard to Reverse Geocode not finding the city, the problem is that the Nominatim database is not returning the city directly as a 'city' key. We have recently discovered that some of the places use suburb names and towns instead of city names in the database. For this example using latitude: N52°21.651' longitude: E12°56.990, Nominatim is returning:
Quote
pl_dat={:place_id=>7893022, :partition=>3, :osm_type=>"N", :osm_id=>915253714, :class=>"highway", :type=>"bus_stop", :admin_level=>15, :housenumber=>nil, :street=>nil, :isin=>nil, :postcode=>nil, :country_code=>nil, :parent_place_id=>116129239, :linked_place_id=>nil, :rank_address=>30, :rank_search=>30, :importance=>0.0, :indexed_status=>0, :indexed_date=>2019-04-22 06:33:11 -0700, :wikipedia=>nil, :calculated_country_code=>"de", :langaddress=>"Riegelspitze, Berliner Chaussee, Petzow, Werder (Havel), Potsdam-Mittelmark, Brandenburg, 14542, Germany", :placename=>"Riegelspitze", :ref=>"Riegelspitze", :lat=>52.3607442, :lon=>12.9494694, :address=>{"bus_stop"=>"Riegelspitze", "location"=>"Riegelspitze", "road"=>"Berliner Chaussee", "city_district"=>"Petzow", "town"=>"Werder (Havel)", "county"=>"Potsdam-Mittelmark", "state"=>"Brandenburg", "postcode"=>"14542", "country"=>"Germany", "country_code"=>"de"}, :addresstype=>"highway"}
F
In this case, do we use "city_district", or "town" given that the "city" key is missing?
Its easy enough for us to assign the city key based on available data (ie if city empty, then check town else suburb else city_limits, ...). Just need to figure out the priority order of city key mapping
Appreciate the feedback

Offline Hayo Baan

  • Uber Member
  • ******
  • Posts: 2478
  • Professional Photographer & Software Developer
    • View Profile
    • Hayo Baan - Photography
Re: "City" again
« Reply #17 on: April 26, 2019, 04:25:47 PM »
Hi Pablo, looking at the map and the info both apple maps and google maps are giving for that location, I'd go for the town part (i.e., Werder in this case).
Hayo Baan - Photography
Web: www.hayobaan.nl

Offline pablogg

  • Camera Bits Staff
  • Member
  • *****
  • Posts: 66
    • View Profile
Re: "City" again
« Reply #18 on: April 26, 2019, 04:38:43 PM »
Thanks Hayo.

Offline pablogg

  • Camera Bits Staff
  • Member
  • *****
  • Posts: 66
    • View Profile
Re: "City" again
« Reply #19 on: April 26, 2019, 07:16:29 PM »
Note to all:
We have just updated the Reverse Geo server to be a bit smarter in how it decides how to populate the "City" field. Hopefully it resolves your issues regarding incorrect "city" field. If not, please post the location that is still causing you issues.

You will need to clear the PM geo cache files in order to see the benefit of this change (should work with any PM version).
For mac, quit PM and delete following files from ~/Library/Preferences/com.camerabits.PhotoMechanic
Windows: <your home>/AppData/Roaming/Camera Bits, Inc/Photo Mechanic
GeocodeCache.db
GPSCoordinates
« Last Edit: April 27, 2019, 09:20:48 AM by pablogg »

Offline Hayo Baan

  • Uber Member
  • ******
  • Posts: 2478
  • Professional Photographer & Software Developer
    • View Profile
    • Hayo Baan - Photography
Re: "City" again
« Reply #20 on: April 27, 2019, 03:26:39 AM »
I've just tried some reported problematic locations (also from other posts) and as far as I can tell now, reverse geocoding provides the output that is expected now. Excellent!

Note: In my case ~/Library/Preferences/com.camerabits.PhotoMechanic/GPSCoordinates was an (empty) directory. Also note that after deletion of the GeocodeCache.db-journal file, it has not yet come back, is that correct?

Update: there is a GeocodeCache.db file now though, guess that replaces the GeocodeCache.db-journal file?
« Last Edit: April 27, 2019, 04:52:22 AM by Hayo Baan »
Hayo Baan - Photography
Web: www.hayobaan.nl

Offline Luiz Muzzi

  • Hero Member
  • *****
  • Posts: 685
    • View Profile
    • Luiz Muzzi Photography
Re: "City" again
« Reply #21 on: April 27, 2019, 05:55:31 AM »
Note to all:
We have just updated the Reverse Geo server to be a bit smarter in how it decides how to populate the "City" field. Hopefully it resolves your issues regarding incorrect "city" field. If not, please post the location that is still causing you issues.

You will need to clear the PM geo cache files in order to see the benefit of this change (should work with any PM version).
For mac, quit PM and delete following files from ~/Library/Preferences/com.camerabits.PhotoMechanic
GeocodeCache.db-journal
GPSCoordinates

I'll get back to you on which files to delete on Windows.

Hi,
I looked into my mac library and there are no such files in my com.camerabits.PhotoMechanic (even though I have used Reverve Geocode).
Regards,
- Luiz Muzzi

Offline pablogg

  • Camera Bits Staff
  • Member
  • *****
  • Posts: 66
    • View Profile
Re: "City" again
« Reply #22 on: April 27, 2019, 09:24:38 AM »
I believe GeocodeCache.db will get created/referenced whenever you "apply" a Reverse Geocode to an image.
I have updated the path descriptions to note the correct name for the database as well as path where it can be found on Windows.
Please let us know if you find any inconsistencies in the future. Thanks.

You will need to clear the PM geo cache files in order to see the benefit of this change (should work with any PM version).
For mac, quit PM and delete following files from ~/Library/Preferences/com.camerabits.PhotoMechanic
Windows: <your home>/AppData/Roaming/Camera Bits, Inc/Photo Mechanic
GeocodeCache.db
GPSCoordinates

Offline JS

  • Full Member
  • ***
  • Posts: 178
    • View Profile
Re: "City" again
« Reply #23 on: April 27, 2019, 03:44:17 PM »
Sorry, didn't understand most of the writing here. But "Werder/Havel" would be right, espacially the 2.coordinates I sent are right in the center of the town. Houdah Geo would give me the same.

Offline JS

  • Full Member
  • ***
  • Posts: 178
    • View Profile
Re: "City" again
« Reply #24 on: April 27, 2019, 03:47:01 PM »
"country_code"=>"de" should be "DEU"

Offline Hayo Baan

  • Uber Member
  • ******
  • Posts: 2478
  • Professional Photographer & Software Developer
    • View Profile
    • Hayo Baan - Photography
Re: "City" again
« Reply #25 on: April 28, 2019, 01:10:58 AM »
"country_code"=>"de" should be "DEU"
Hmm, for me all country codes are three letters when performing reverse geocoding. Not so for you?
Hayo Baan - Photography
Web: www.hayobaan.nl

Offline JS

  • Full Member
  • ***
  • Posts: 178
    • View Profile
Re: "City" again
« Reply #26 on: April 28, 2019, 11:34:18 PM »
Yes, but pabloggs Nominatim says:de. Maybe it's just a typo.

Offline Hayo Baan

  • Uber Member
  • ******
  • Posts: 2478
  • Professional Photographer & Software Developer
    • View Profile
    • Hayo Baan - Photography
Re: "City" again
« Reply #27 on: April 28, 2019, 11:37:31 PM »
Yes, but pabloggs Nominatim says:de. Maybe it's just a typo.

Ah right, that was direct from the Nominatim source. There indeed it is just two letters. In PM, however, they've always used three letter (all uppercase) codes, so when the reverse geocoding was developed it was decided to translate these two letter codes to the usual PM three letter codes (blame me for that ;)).
Hayo Baan - Photography
Web: www.hayobaan.nl

Offline JS

  • Full Member
  • ***
  • Posts: 178
    • View Profile
Re: "City" again
« Reply #28 on: April 29, 2019, 02:14:37 PM »
I do. Thank You.

-John