Author Topic: Appending field data with variables  (Read 2874 times)

Offline Jamie

  • Newcomer
  • *
  • Posts: 16
    • View Profile
Appending field data with variables
« on: October 25, 2020, 03:19:38 AM »
Greetings,

I am trying to set up an ingest process that relies on GPS data to set location.  Everything is working quite well, but I have one instance that involves iteratively using information in a metadata field. (So my question isn't about the GPS data per se.)

Via the GPS-Reverse Geocode functionality, I load country, state, city & location.  In my local woods ("Kottenforst"), where I photograph a lot, many locations are named such as "Hirschweiher" (Deer Pond) or a street/path name. These names appear correctly. I would like to pre-pend the name of the woods to that location. GPS-Reverse Geocode gives location "Hirschweiher".  I want, however, "Kottenforst-Hirschweiher".  (Kottenforst doesn't belong in the city, which is "Bonn".)

So, starting from the point of having already loaded the location via GPS-RG (i.e. Location reads "Hirschweiher"), I tried creating an additional template with the location field "Kottenforst-{location}" (and the Geocode globe turned off) to be run subsequently.  This gives as output "Kottenforst-Kottenforst-{location}". So, the algorithm isn't using the original data, but the template entry (and quasi doubled).  If I run it with the Geocode globe on, I get "Hirschweiher".

Any way to make this work?  (Hotcodes?)

(I see that I can use search and replace for this, but since I'll have a list of different locations, that's not convenient.)

Thanks in advance.

Cheers,
Jamie

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25020
    • View Profile
    • Camera Bits, Inc.
Re: Appending field data with variables
« Reply #1 on: October 25, 2020, 10:15:40 AM »
Jamie,

I am trying to set up an ingest process that relies on GPS data to set location.  Everything is working quite well, but I have one instance that involves iteratively using information in a metadata field. (So my question isn't about the GPS data per se.)

Via the GPS-Reverse Geocode functionality, I load country, state, city & location.  In my local woods ("Kottenforst"), where I photograph a lot, many locations are named such as "Hirschweiher" (Deer Pond) or a street/path name. These names appear correctly. I would like to pre-pend the name of the woods to that location. GPS-Reverse Geocode gives location "Hirschweiher".  I want, however, "Kottenforst-Hirschweiher".  (Kottenforst doesn't belong in the city, which is "Bonn".)

So, starting from the point of having already loaded the location via GPS-RG (i.e. Location reads "Hirschweiher"), I tried creating an additional template with the location field "Kottenforst-{location}" (and the Geocode globe turned off) to be run subsequently.  This gives as output "Kottenforst-Kottenforst-{location}". So, the algorithm isn't using the original data, but the template entry (and quasi doubled).  If I run it with the Geocode globe on, I get "Hirschweiher".

Any way to make this work?  (Hotcodes?)

Using a variable inside the field that it represents does not produce good results.  I can't think of a solution that would work in a single pass.  Multiple pass solution: You could use the {location} variable in another field (say Edit Status), and then on the second pass use the variable for that field in the location field: Kottenforst-{status} which should repair the Location field.  Then in the last pass, clear out the Edit Status field (unless you don't mind it having the partial name there.)

Now, you could get fancier and use Code Replacement if you know what all of the locations would evaluate to when Reverse Geocoding produces it.  You'd then have something like:

Hirschweiher[tab]Kottenforst-Hirschweiher
another location[tab]corrected location
...

Then you could fix all of your images in four passes instead of using four passes multiple times for groups of images.  You would still have pass #1 to get the Reverse Geocoded location set, pass #2 to copy the location to Edit Status, pass #3 to use code replacement to fix the Location field, and pass #4 to clear the Edit Status (optional)

If you decide to go the Code Replacement route, you'd use \{status}\ in the Location field to cause 'Hirschweiher' in the Edit Status field to become transformed to 'Kottenforst-Hirschweiher' in the Location field.  This translation would occur for all of the codes/replacements that you set up in advance.

HTH,

-Kirk

Offline Jamie

  • Newcomer
  • *
  • Posts: 16
    • View Profile
Re: Appending field data with variables
« Reply #2 on: October 25, 2020, 03:50:52 PM »
Hi Kirk,

okay, I should be able to get one of your suggestions to work.  I'll give it a try tomorrow and let you know how it turns out.

Thanks!

Cheers
Jamie

Offline Jamie

  • Newcomer
  • *
  • Posts: 16
    • View Profile
Re: Appending field data with variables
« Reply #3 on: November 01, 2020, 12:16:34 PM »
Hi Kirk,

finally got to this today. 

I got it to work with just 3 passes as follows:
1. Reverse Geolocate to {locationtaken}, as it takes the RG-data directly.
2. Load {locationtaken} to Location
3. Clear out Location Taken

So far, all of the locations are coming through without the need for code replacements, but I anticipate some messy ones. So, that may become necessary.

Thanks for your help.

Cheers,
James