Skip to content

bigfunctions > reverse_geocode

reverse_geocode

Call or Deploy reverse_geocode ?

✅ You can call this reverse_geocode bigfunction directly from your Google Cloud Project (no install required).

  • This reverse_geocode function is deployed in bigfunctions GCP project in 39 datasets for all of the 39 BigQuery regions. You need to use the dataset in the same region as your datasets (otherwise you may have a function not found error).
  • Function is public, so it can be called by anyone. Just copy / paste examples below in your BigQuery console. It just works!
  • You may prefer to deploy the BigFunction in your own project if you want to build and manage your own catalog of functions. This is particularly useful if you want to create private functions (for example calling your internal APIs). Discover the framework

Public BigFunctions Datasets:

Region Dataset
eu bigfunctions.eu
us bigfunctions.us
europe-west1 bigfunctions.europe_west1
asia-east1 bigfunctions.asia_east1
... ...

Description

Signature

reverse_geocode(latitude, longitude)

Description

Get address details at latitude, longitude using Google Maps

Examples

select bigfunctions.eu.reverse_geocode(48.86988770000001, 2.3079341)
select bigfunctions.us.reverse_geocode(48.86988770000001, 2.3079341)
select bigfunctions.europe_west1.reverse_geocode(48.86988770000001, 2.3079341)
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| address_details                                                                                                                                                                                                                                                                                                                                                 |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| {
    "address_components": [...],
    "formatted_address": "1 Av. des Champs-Élysées, 75008 Paris, France",
    "geometry": {
        "location": {
            "lat": 48.86988770000001,
            "lng": 2.3079341
        },
        ...
    },
    "place_id": "ChIJ6499V8Rv5kcR5f9dbz3OeBI",
    "plus_code": {...},
    "types": ["street_address"]
}
 |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

Need help using reverse_geocode?

The community can help! Engage the conversation on Slack

For professional suppport, don't hesitate to chat with us.

Found a bug using reverse_geocode?

If the function does not work as expected, please

  • report a bug so that it can be improved.
  • or open the discussion with the community on Slack.

For professional suppport, don't hesitate to chat with us.

Use cases

A delivery company has a database of orders with latitude and longitude coordinates of delivery locations. They want to enrich this data with more detailed address information for reporting, analysis, and customer service purposes.

They can use the reverse_geocode function to get the full address details for each delivery location. For example, if they have a delivery location with latitude 48.86988770000001 and longitude 2.3079341, they can use the following query in BigQuery:

SELECT order_id, bigfunctions.eu.reverse_geocode(latitude, longitude) AS address_details
FROM `orders_table`

This will add a new column address_details to the orders_table containing the full address information for each order, including the formatted address, address components, place ID, and more. This information can then be used to:

  • Improve reporting: Generate reports on deliveries by city, postal code, or other administrative area.
  • Enhance analysis: Analyze delivery patterns and optimize routes based on address details.
  • Improve customer service: Provide customer service representatives with accurate address information to resolve delivery issues.
  • Data validation: Verify the accuracy of the provided latitude and longitude coordinates.
  • Geocoding database cleanup: Identify and correct inaccurate or incomplete address information in their database.

Another use case could be for a real estate company that wants to analyze property values based on location details derived from latitude/longitude data. Or, a ride-sharing service might use this function to provide drivers with more detailed pickup/dropoff location information.

Spread the word

BigFunctions is fully open-source. Help make it a success by spreading the word!

Share on Add a on