Author Topic: reverse Geocode and templates  (Read 5297 times)

Offline carlseibert

  • Full Member
  • ***
  • Posts: 161
    • View Profile
reverse Geocode and templates
« on: April 17, 2019, 03:37:41 PM »
If you make a template with reverse geocode "globes" active and apply it in the single picture IPTC editor you don't get any geocode output.

If you apply the same template from the Stationery Pad, now Template tool, indeed, the resolved location information is applied in the chosen fields. Seems like a bug to me.

Photo Mechanic Version 6.0, build 2818 (66ae7fc)  on a Mac.

...and, like others, I have noticed a lot of photos not resolving a city. Sometimes, the city is ambiguous - a county pocket or a government reservation or something - but other times the location in question is most certainly in a specific city. Dunno what the issue might be there.



Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24731
    • View Profile
    • Camera Bits, Inc.
Re: reverse Geocode and templates
« Reply #1 on: April 17, 2019, 03:59:21 PM »
If you make a template with reverse geocode "globes" active and apply it in the single picture IPTC editor you don't get any geocode output.

When you say 'make a template', are you loading a Stationery Pad file?

If you don't OK the dialog or choose one of the Save & -> or Save & <- options but just close the dialog, nothing will be saved.

If you'd like to see what you'll get without saving anything, hold down the Modifier key (Shift on Windows, Option on macOS) and the OK button will change to "Eval", clicking Eval will perform the lookup and set the fields to the data that the server found.

...and, like others, I have noticed a lot of photos not resolving a city. Sometimes, the city is ambiguous - a county pocket or a government reservation or something - but other times the location in question is most certainly in a specific city. Dunno what the issue might be there.

Sample coordinates would be helpful, please share them.

Thanks,

-Kirk

Offline carlseibert

  • Full Member
  • ***
  • Posts: 161
    • View Profile
Re: reverse Geocode and templates
« Reply #2 on: April 17, 2019, 04:57:35 PM »
Steps I followed were to make a template in the Stationery Pad, then save it with the Snapshot button.

Then, in the IPTC Editor, I called the snapshot. All the data in the template loaded except the "globes" which would indicate active reverse geocoding. Upon OKing in the IPTC editor nothing happened.

If, with the template active in the Stationery Pad, I click "Apply Metadata Template" in the IPTC editor the template is loaded and the resolved geocode information is displayed in one go. (No need to "OK".)

Quote
If you'd like to see what you'll get without saving anything, hold down the Modifier key (Shift on Windows, Option on macOS) and the OK button will change to "Eval", clicking Eval will perform the lookup and set the fields to the data that the server found.

This is way cool.

Try these coordinates. They're right in the center of a municipality but no city is displayed:

+26° 10' 17.09", -80° 7' 48.53"

And these come from a place where the city is ambiguous (or at least I don't know what it is)

+26° 5' 19.95", -80° 6' 56.65"






Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24731
    • View Profile
    • Camera Bits, Inc.
Re: reverse Geocode and templates
« Reply #3 on: April 17, 2019, 06:45:52 PM »
Carl,

Steps I followed were to make a template in the Stationery Pad, then save it with the Snapshot button.

Then, in the IPTC Editor, I called the snapshot. All the data in the template loaded except the "globes" which would indicate active reverse geocoding. Upon OKing in the IPTC editor nothing happened.

If, with the template active in the Stationery Pad, I click "Apply Metadata Template" in the IPTC editor the template is loaded and the resolved geocode information is displayed in one go. (No need to "OK".)

Quote
If you'd like to see what you'll get without saving anything, hold down the Modifier key (Shift on Windows, Option on macOS) and the OK button will change to "Eval", clicking Eval will perform the lookup and set the fields to the data that the server found.

This is way cool.

Try these coordinates. They're right in the center of a municipality but no city is displayed:

+26° 10' 17.09", -80° 7' 48.53"

The server does indeed have no city for that place, but has instead a 'suburb':

<reversegeocode timestamp="Wed, 17 Apr 19 18:41:25 -0700" attribution="Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright" querystring="format=xml&lat=26.171414&lon=-80.130147">
<result place_id="191385026" osm_type="way" osm_id="534823810" ref="Northeast 35th Street" lat="26.1714101" lon="-80.1304238">
Northeast 35th Street, Oakland Park, Broward County, Florida, 33334, USA
</result>
<addressparts>
<road>Northeast 35th Street</road>
<suburb>Oakland Park</suburb>
<county>Broward County</county>
<state>Florida</state>
<postcode>33334</postcode>
<country>USA</country>
<country_code>us</country_code>
</addressparts>
</reversegeocode>

And these come from a place where the city is ambiguous (or at least I don't know what it is)

+26° 5' 19.95", -80° 6' 56.65"

<reversegeocode timestamp="Wed, 17 Apr 19 18:45:09 -0700" attribution="Data © OpenStreetMap contributors, ODbL 1.0. http://www.openstreetmap.org/copyright" querystring="format=xml&lat=26.088875&lon=-80.115736">
<result place_id="102469617" osm_type="way" osm_id="108059864" ref="Cruise Terminal 22 & 24" lat="26.088891" lon="-80.1156563335552">
Cruise Terminal 22 & 24, Eller Drive, Hollywood, Broward County, Florida, 33019, USA
</result>
<addressparts>
<building>Cruise Terminal 22 & 24</building>
<road>Eller Drive</road>
<suburb>Hollywood</suburb>
<county>Broward County</county>
<state>Florida</state>
<postcode>33019</postcode>
<country>USA</country>
<country_code>us</country_code>
</addressparts>
</reversegeocode>

Offline Hayo Baan

  • Uber Member
  • ******
  • Posts: 2552
  • Professional Photographer & Software Developer
    • View Profile
    • Hayo Baan - Photography
Re: reverse Geocode and templates
« Reply #4 on: April 18, 2019, 02:14:50 AM »
Interesting. Strange that there is no city data, but there is the more detailed suburb data… I guess this is an OpenStreetMap data issue.

I'm not sure how this can be handled consistently by PM in all cases, but perhaps PM could use <suburb> instead of <city> if <city> is empty (and, if both are present, perhaps <city>, <suburb>).
Hayo Baan - Photography
Web: www.hayobaan.nl

Offline carlseibert

  • Full Member
  • ***
  • Posts: 161
    • View Profile
Re: reverse Geocode and templates
« Reply #5 on: April 18, 2019, 09:13:45 AM »
Interesting indeed.

Oakland Park is an incorporated city. South Florida is kind of like Los Angeles. It's one city (or two or three, depending on how you look at it) but it's made up of about 100 municipalities, or cities. A few have several hundred thousand residents and some are only tiny neighborhoods, but they're all for-real cities.

I just looked up Port Everglades. Its website says it occupies land in three incorporated cities -Fort Lauderdale, Hollywood, and Dania Beach - as well as unincorporated county. It is quite possible that the spot where that photo was made is really in the city of Hollywood.

In this case, it would seem that your data provider is using "suburb" synonymously with "city". But would it be safe to do as Hayo Baan suggests and go ahead and fill the City field with whichever value they return?

Actually, I think that might not be too bad. County pockets and actual suburbs are a gray area (forgive the pun). In most places, common practice is to use the city in the postal address as the "city" for navigating and publishing purposes. I suspect you'll find a lot of organizations whose style enshrines doing just that. IIRC, our style at the Sun Sentinel was to say "near [whatever city]". But that doesn't work at all from a DAM perspective, so in photo metadata, we used the postal city. You can't be 100% right all the time regardless, so I would say go for it. Far easier for the photographer to have to correct the occasional out-of-style city name than to have to manual resolve many missing entries.

In the US anyway. Other countries mileage may vary.

It's really strange that your map provider is having this problem. Country and regional records are usually really precise about municipal boundaries because they have all kinds of legal and tax significance. I remember way back in the day using census records as the absolute authority on the spelling of city names to build the cities pulldown for all of our copies of Photo Mechanic. My copy of Photo Mechanic still has that same list :-)




Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 24731
    • View Profile
    • Camera Bits, Inc.
Re: reverse Geocode and templates
« Reply #6 on: April 18, 2019, 09:51:17 AM »
We use Nominatim/OpenStreetMap, an open source map system: https://www.openstreetmap.org

They accept user contributions/corrections and the map data improves over time.

-Kirk

Offline carlseibert

  • Full Member
  • ***
  • Posts: 161
    • View Profile
Re: reverse Geocode and templates
« Reply #7 on: April 18, 2019, 02:10:15 PM »
Ahah!

From their wiki I see this: "Use place=suburb to identify a major area in a place=town or place=city with a distinct and recognised local name and identity. Suburbs may have uncertain boundaries, may overlap with other suburbs, and are often best mapped using a node."

at https://wiki.openstreetmap.org/wiki/Tag:place%3Dsuburb

Which suggests a certain level of subjectivity, which certainly isn't the case on the ground in South Florida or southern California. And their maps are maintained by volunteers, which suggests that maybe their contributors might not fully understand the local geopolitical specifics. (Was that non-judgemental enough?)  After all, how many people know that the Inglewood neighborhood in Los Angeles (home of Randy's donuts) is an incorporated city but that the Buckhead neighborhood in Atlanta is just a neighborhood? I'll bet their database is chock full of suburb <-> city errors.

If I'm reading this correctly, a legit "suburb" within a city should be tagged with the city tag and then the suburb tag. Which would mean that a suburb without an enclosing city is probably actually a stand-alone municipality. Which would be a city for DAM or IPTC purposes.

The IPTC standard isn't very helpful (or constraining, depending on how you look at it). It defines a city circularly, like so: "Name of the city of the location shown in the image. This element is at the third level of a top- down geographical hierarchy." In the extended standard, there's no definition for "city" at all. It's just a part of the Location Shown or Location Created structure.

So, I would say you're free to take some liberty here and that Hayo Bann just nailed it......

... use the city tag if it exists and the subrub one if city doesn't exist.

Actually, I would apply the same logic to town and village tags. Check out below.

More from the OSM wiki:

"Use the place=city tag to identify the largest settlement or settlements within a territory, including national, state and provincial capitals, and other major conurbations."

and

"Use place=town to identify an important urban centre that is larger than a place=village, smaller than a place=city, and not a place=suburb. Towns normally have a good range of shops and facilities which are used by people from nearby villages."

and for both towns and cities we have versions of:

"Some mappers map cities with an area instead of using a node. Cities often do not have a verifiable outline though and different interpretations of the meaning of areas representing populated places exist - more details can be found on the place key page. This method also looses the information on the city center which is important for data users, in particular for routing. Data users should not expect the area geometries of cities to have a particular meaning."

and

"Populated places (in particular place=city, place=town, place=village, place=hamlet and place=isolated_dwelling) are usually mapped as nodes since in most cases they have a well defined centre but not a verifiable outline."

Which may be true in some countries, but in the US, cities, towns, and villages are legal entities that most certainly do have very specific, legal and verifiable outlines.