PsiPhiTheta / GoogleMaps-2-AppleMaps

This Shortcut script automatically extracts in bulk the Saved Places .json data from Google data export and adds the places (with a prompt) in Apple Maps. Intended for use on macOS primary.
The Unlicense
7 stars 0 forks source link

Location not found error #2

Open lpossamai opened 2 years ago

lpossamai commented 2 years ago

Hi. I'm running on MacOS and I got the following error:

Screen Shot 2022-01-06 at 10 53 49 PM

The sample code is:

{
  "features" : [ {
    "geometry" : {
      "coordinates" : [ -39.032342643937355, 177.415385746459 ],
      "type" : "Point"
    },
    "properties" : {
      "address" : "9 Apple Orchard Way, Sunnyvale, New Zealand",
      "name" : "Home"
    },
    "type" : "Feature"
  }, {
    "geometry" : {
      "coordinates" : [ -39.03311495921526, 177.41647176701403 ],
      "type" : "Point"
    },
    "properties" : {
      "address" : "41 Queen Street, Wairoa 4108, New Zealand",
      "name" : "Test"
    },
    "type" : "Feature"
  } ],
  "type" : "FeatureCollection"
}
PsiPhiTheta commented 2 years ago

Looks like you didn't respect the input format. The provided sample is:

{ "type" : "FeatureCollection", "features" : [ { "geometry" : { "coordinates" : [ -0.1241152, 51.5294724 ], "type" : "Point" }, "properties" : { "Google Maps URL" : "http://maps.google.com/?cid=2933403827321182931", "Location" : { "Address" : "10th Floor, 10 Argyle St, London WC1H 8EG, United Kingdom", "Business Name" : "Decimo", "Country Code" : "GB", "Geo Coordinates" : { "Latitude" : "51.5294724", "Longitude" : "-0.1241152" } }, "Published" : "2021-12-08T22:10:49Z", "Title" : "Decimo", "Updated" : "2021-12-08T22:10:49Z" }, "type" : "Feature" }, { "geometry" : { "coordinates" : [ 9.3659809, 42.3820985 ], "type" : "Point" }, "properties" : { "Google Maps URL" : "http://maps.google.com/?q=42.382098,9.365981", "Location" : { "Geo Coordinates" : { "Latitude" : "42.3820985", "Longitude" : "9.3659809" } }, "Published" : "2018-08-06T08:52:28Z", "Title" : "42.382098,9.365981", "Updated" : "2021-12-05T12:10:02Z" }, "type" : "Feature" } ] }

You need to keep FeatureCollection (from original Google export)

lpossamai commented 2 years ago

Looks like you didn't respect the input format. The provided sample is:

{ "type" : "FeatureCollection", "features" : [ { "geometry" : { "coordinates" : [ -0.1241152, 51.5294724 ], "type" : "Point" }, "properties" : { "Google Maps URL" : "http://maps.google.com/?cid=2933403827321182931", "Location" : { "Address" : "10th Floor, 10 Argyle St, London WC1H 8EG, United Kingdom", "Business Name" : "Decimo", "Country Code" : "GB", "Geo Coordinates" : { "Latitude" : "51.5294724", "Longitude" : "-0.1241152" } }, "Published" : "2021-12-08T22:10:49Z", "Title" : "Decimo", "Updated" : "2021-12-08T22:10:49Z" }, "type" : "Feature" }, { "geometry" : { "coordinates" : [ 9.3659809, 42.3820985 ], "type" : "Point" }, "properties" : { "Google Maps URL" : "http://maps.google.com/?q=42.382098,9.365981", "Location" : { "Geo Coordinates" : { "Latitude" : "42.3820985", "Longitude" : "9.3659809" } }, "Published" : "2018-08-06T08:52:28Z", "Title" : "42.382098,9.365981", "Updated" : "2021-12-05T12:10:02Z" }, "type" : "Feature" } ] }

You need to keep FeatureCollection (from original Google export)

Well, I just copied and pasted to be honest. The file I'm using from the Google Takeout export is Labelled places.json.

jorisw commented 1 month ago

OP is correct. The Shortcut is outdated and needs to be fixed to process today's Google Takeout export JSON structure:

{
  "type": "FeatureCollection",
  "features": [
    {
      "geometry": {
        "coordinates": [-58.4352456, -34.5979346],
        "type": "Point"
      },
      "properties": {
        "date": "2023-11-21T23:34:02Z",
        "google_maps_url": "http://maps.google.com/?cid=14985669197013317193",
        "location": {
          "address": "Aguirre 489, C1414ASI Cdad. Autónoma de Buenos Aires, Argentina",
          "name": "Centro Cultural Musicleta"
        }
      },
      "type": "Feature"
    },
    ...

I would try to post a fix PR but the Shortcut isn't part of the repo.

jorisw commented 1 month ago

Fixed in this version.

Google Maps to Apple Maps Migration v3.0.shortcut.zip

Changes:

* Unfortunately there's no shortcut to add the favorite for you, so this manual step will always be part of it

MoSlim33 commented 1 month ago

Not working for me Jorisw

"Conversion Error

Get Dictionary Value failed because Shortcuts couldn’t convert from Text to Dictionary."

Screen Shot 13 Aug 2024 at 12 10:46 Screen Shot 13 Aug 2024 at 12 10:34

jorisw commented 1 month ago

Find the Place it added last, in the JSON file, and remove the next one. Sometimes it chokes on one of them for some reason. i.o.w. one of these

    {
      "geometry": {
        "coordinates": [-58.4352456, -34.5979346],
        "type": "Point"
      },
      "properties": {
        "date": "2023-11-21T23:34:02Z",
        "google_maps_url": "http://maps.google.com/?cid=14985669197013317193",
        "location": {
          "address": "Aguirre 489, C1414ASI Cdad. Autónoma de Buenos Aires, Argentina",
          "name": "Centro Cultural Musicleta"
        }
      },
      "type": "Feature"
    },
MoSlim33 commented 1 month ago

Hi. it didn't add any places. It failed on first try.

Here's how the JSON file begins. I have no idea what to delete. I'm not a programmer.

{ "type": "FeatureCollection", "features": [ { "geometry": { "coordinates": [ 153.5068408, -28.1631687 ], "type": "Point" }, "properties": { "date": "2024-03-09T09:21:47Z", "google_maps_url": "http://maps.google.com/?cid=1081606475368919152", "location": { "address": "Eastern Ave, Bilinga QLD 4225, Australia", "country_code": "AU", "name": "Gold Coast Airport" } }, "type": "Feature" }, { "geometry": { "coordinates": [ 153.3671008, -28.0063039 ], "type": "Point" },

juanmalagon commented 5 days ago

Find the Place it added last, in the JSON file, and remove the next one. Sometimes it chokes on one of them for some reason. i.o.w. one of these

    {
      "geometry": {
        "coordinates": [-58.4352456, -34.5979346],
        "type": "Point"
      },
      "properties": {
        "date": "2023-11-21T23:34:02Z",
        "google_maps_url": "http://maps.google.com/?cid=14985669197013317193",
        "location": {
          "address": "Aguirre 489, C1414ASI Cdad. Autónoma de Buenos Aires, Argentina",
          "name": "Centro Cultural Musicleta"
        }
      },
      "type": "Feature"
    },

It fails with non-ASCII characters, like in "address": "Hövelstraße 8, 44137 Dortmund, Germany", or whenever the address starts with a number, "address": "44137 Dortmund, Germany", Besides that, it works like a charm 😃