Red Gregory

View Original

Collect Maps In Notion: Automatically Find Latitude And Longitude

The Database In Action: Saving Maps

ConfigurE The Database In Notion

There are four properties in my maps database. Before connecting to the Save to Notion form, this database needs to be made:

  • Latitude: formula

  • Longitude: formula

  • Parent Location: formula

  • link: url

Find The Latitude And Longitude From A Google Maps URL

These formulas rely on just one other property. That is a link property with the google maps url. It is called “link.”

Latitude: Formula property

if(not empty(prop("Place")), if(toNumber(replace(replace(replace(replace(prop("link"), ".*/@", ""), "/data=.*", ""), "(,[^,]*)$", ""), ",.*", "")) < 0, replace(replace(replace(replace(replace(prop("link"), ".*/@", ""), "/data=.*", ""), "(,[^,]*)$", ""), ",.*", ""), "-", "") + "º S", replace(replace(replace(replace(prop("link"), ".*/@", ""), "/data=.*", ""), "(,[^,]*)$", ""), ",.*", "") + "º N"), "")

Longitude: Formula property

if(not empty(prop("Place")), if(toNumber(replace(replace(replace(replace(prop("link"), ".*/@", ""), "/data=.*", ""), "(,[^,]*)$", ""), ".*,", "")) < 0, replace(replace(replace(replace(replace(prop("link"), ".*/@", ""), "/data=.*", ""), "(,[^,]*)$", ""), ".*,", ""), "-", "") + "º W", replace(replace(replace(replace(prop("link"), ".*/@", ""), "/data=.*", ""), "(,[^,]*)$", ""), ".*,", "") + "º E"), "")

Find Parent Location From A Google Maps URL

This formula will tell me what country or region a particular city resides.

Parent Location: Formula property

replaceAll(replace(replaceAll(replaceAll(replace(replace(replace(prop("link"), "/@.*", ""), ".*place/", ""), ".*?,+", ""), "[0-9]", ""), ",", ""), ".*?[+]", ""), "[+]", " ")

Configure Save To Notion Form

I'm using Save to Notion extension to collect maps from Google Maps. How my form is configured in the extension is shown below:

  • Step 1: Locate Add to: Find your database to collect maps

  • Step 2: Check off Clip Page Content. This will save a map embed to the body of the page

Extra Tip: The latitude and longitude, of course, are approximate. Moving the map in the browser before saving with your cursor will alter these coordinates.

See this content in the original post

View Example Inside Notion

Further Reading

See this gallery in the original post