Convert table of lats/longs to cities

I’ve got a Numbers document with a bunch of latitudes and longitudes that I want to assign city names to. I know I can do this one-by-one with Shortcuts, but I’m wondering if there’s a way to call a shortcut as a Numbers function to populate a new column. Or any other ways y’all would suggest I solve this.

There are a few options, but the simplest might be to copy the list of latitude and longitude cells, and the. process the clipboard. The cells should be converted to tab separation between columns and newlines between rows.

Then in Shortcuts, process the clipboard line by line, pulling out the values and build a new variable where you append a tab followed by the city. When done, copy the variable to the clipboard.

Now you should be able to paste into your Numbers spreadsheet and the results will follow the cell layout with a third column as the city.

Hope that helps.

I had a feeling that would be it. I’m working on that right now and having a hard time getting Shortcuts to recognize “lat,long” as the location data type.

I think that’s fine for me, but getting a city out of a location seems bit buggy to me right now. I worked around it and this clunky example seems to work, utilising a step from the Actions helper app for Shortcuts, and a cheat of finding a place nearby and using the address of that rather than the original location

Maybe it’ll help?

Huh. The step after “get last item from split text” shows up as “unknown action” for me. Otherwise, this seems to make sense.

That would happen if you don’t have the app I mentioned above installed.

I can potentially modify it to match, and ditch the step for the app you don’t have if you let me know how you approached getting town/city from the coordinates.

Ah right. Got it. Works now. Thanks so much.