rudokemper / google-maps-places-to-organic-maps

Generate GPX and KMZ files from your Google Maps saved places to import as bookmarks in Organic Maps (or elsewhere)
https://rudokemper.github.io/google-maps-places-to-organic-maps/
Mozilla Public License 2.0
35 stars 1 forks source link

Some places coming out as being located on null island #2

Open MoralCode opened 5 hours ago

MoralCode commented 5 hours ago

context: null island is a location in the ocean off the african coast where the lat/long is 0,0.

i just exported my saved places and about 4/6 of them are being set to null island.

I checked the source data and it seems like the place in the geojson where the coordinates are stored is indeed providing coordinates of 0,0, however, theres a google maps URL field that contains more plausible coordinates.

from the geoJSON:

 {
      "geometry": {
        "coordinates": [
          0,
          0
        ],
        "type": "Point"
      },
      "properties": {
        "date": "2024-05-28T18:42:08Z",
        "google_maps_url": "http://maps.google.com/?q=42.30039043516156,-71.12115081399679",
        "Comment": "No location information is available for this saved place"
      },
      "type": "Feature"
    },

Would it be helpful to include detection for these null coordinates and replacing them with the coordinates from the url?

rudokemper commented 5 hours ago

I noticed that in my own GeoJSON too; seems like an artifact from Google's export code. And yes, that's a great suggestion to detect null coords and retrieve it from the URL instead! (If someone actually bookmarked null island, the coords from the URL would be the same anyway.)

Do you want to contribute that? Or I can handle it later, not at my computer this weekend.

MoralCode commented 4 hours ago

im a good way there already :P apparrently the URLs can contain addresses (typically happens when the address isnt a business, otherwise google would have grabbed the coordinates already).

So yeah ill probably use https://nominatim.openstreetmap.org to look up coords for the addresses I find too