Mapping Google building Id's to Open Street Map building id's

1.3k views Asked by At

I'm working on a mapping project that involves using Tangram (an awesome webgl mapping library) to visualize buildings on a map. The Tangram buildings come from Open Street Maps, and use OSM id's:

enter image description here

As fortune would have it though, my data comes from Google's Location API, which has its own id system. Using a request like:

curl https://maps.googleapis.com/maps/api/geocode/json?address=Timble-Bridge,%20Yorkshire%20Britain&key=API_KEY_HERE

one gets back (note at the bottom the place id hash):

{
  "results": [
    {
      "address_components": [
        {
          "long_name": "59",
          "short_name": "59",
          "types": [
            "street_number"
          ]
        },
        {
          "long_name": "Long Lane",
          "short_name": "Long Ln",
          "types": [
            "route"
          ]
        },
        {
          "long_name": "London",
          "short_name": "London",
          "types": [
            "postal_town"
          ]
        },
        {
          "long_name": "Greater London",
          "short_name": "Greater London",
          "types": [
            "administrative_area_level_2",
            "political"
          ]
        },
        {
          "long_name": "England",
          "short_name": "England",
          "types": [
            "administrative_area_level_1",
            "political"
          ]
        },
        {
          "long_name": "United Kingdom",
          "short_name": "GB",
          "types": [
            "country",
            "political"
          ]
        },
        {
          "long_name": "EC1A 9EJ",
          "short_name": "EC1A 9EJ",
          "types": [
            "postal_code"
          ]
        }
      ],
      "formatted_address": "59 Long Ln, London EC1A 9EJ, UK",
      "geometry": {
        "location": {
          "lat": 51.5192377,
          "lng": -0.0998815
        },
        "location_type": "ROOFTOP",
        "viewport": {
          "northeast": {
            "lat": 51.52058668029149,
            "lng": -0.09853251970849797
          },
          "southwest": {
            "lat": 51.51788871970849,
            "lng": -0.101230480291502
          }
        }
      },
      "partial_match": true,
      "place_id": "ChIJ5UYg9FMbdkgRBOslATQK-ok",
      "types": [
        "cafe",
        "establishment",
        "food",
        "point_of_interest"
      ]
    }
  ],
  "status": "OK"
}

I'm now wondering if there's any extant database that maps OSM id's to Google location id's. If anyone knows of any such service, or any higher order mapping one can use to deterministically map OSM and Google id's to a higher-order identification service, I'd be very grateful for any insight you can offer.

1

There are 1 answers

3
scai On BEST ANSWER

No, such a database doesn't exist and it can't exist.

Such a mapping would require that:

  • Both data sets are open. OSM is open but Google's data isn't.
  • Buildings are mapped in a similar way. This is not always the case. A building in Google may consist of several buildings in OSM, and vice versa.
  • IDs are stable. I don't know about Google's IDs but IDs in OSM can change.