• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

nuket/google-sheets-geocoding-macro: Geocode from addresses to latitude / longit ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

nuket/google-sheets-geocoding-macro

开源软件地址(OpenSource Url):

https://github.com/nuket/google-sheets-geocoding-macro

开源编程语言(OpenSource Language):

JavaScript 100.0%

开源软件介绍(OpenSource Introduction):

Google Sheets Geocoding Macro

How It Works

Geocode from addresses to latitude / longitude, and vice versa using Google Sheets.

Test Sheet

Try the script out on a Test Sheet with sample address data. You can enter your own address data and geocode it in the rows below.

You must be logged into a Google Account before the Geocode menu will appear.

Any data you enter will be automatically deleted every Sunday at 4AM CEST, this isn't for long term storage.

Multicolumn Addresses → Latitude, Longitude

Now it supports geocoding using address data spread across multiple columns.

The way this works is: You select a set of columns containing the data, and the geocoding process puts the latitude, longitude data in the rightmost two columns. It will overwrite any data in those two columns.

Some care is needed, as it will concatenate all columns except the rightmost two columns to create the address string.

Multicolumn Address Geocoding

Latitude, Longitude → Nearest Address

It also supports reverse geocoding.

Simply select the latitude, longitude columns and it will place the nearest address data in the rightmost column. It will overwrite any data in that column.

Less care is needed, as it will automatically use the leftmost two columns as the latitude, longitude pair.

Reverse Geocoding

Latitude, Longitude → Address Components

It now supports reverse geocoding and splitting the address components into different columns.

See the Reverse To Components tab in the Test Sheet.

Reverse Geocoding to Address Components

Map Cells

It now supports mapping the Latitude, Longitude pairs in the Mapping tab.

Mapping Coordinates

Adding It To Your Own Sheet

Step 1. Create or Open a Google Sheet and add addresses to it.

open google sheet

Step 2. Tools -> Script Editor

edit the script

Step 3. Copy this script code into the Code.gs editor, replacing everything.

use geocoding script code

Step 4. Save

save code

Step 5. Reload Sheet

reload sheet

Step 6. Run Geocode, Click Through Warnings

run geocode, click through warnings

That's it.

Troubleshooting

  • I don't see the Geocode menu!

    You must be logged into a Google Account before the Geocode menu will appear. Anonymous / not logged-in users will not work, Incognito Mode will not work.

  • It gives me a bunch of warnings when I run it the first time.

    If you're using the Test Sheet, this means that the script will have access to the data you are entering. Don't enter anything you wouldn't want me to see, because as the owner of the shared Sheet, I see the data that gets put into it.

    If you've added the script to your own sheet, this means that the script will have access to the data you are entering. Since you're the owner of your Sheet, this isn't an issue. You can always audit the script by reading the source code in this repository.

  • It returns latitude / longitude data using "," instead of "." separators.

    There's not much I can do about the return formats, but a user reported that adding the following array formula to the latitude / longitude columns changes the separators for them: =ARRAYFORMULA(SUBSTITUTE(C2:C;",";".")).

    Make sure you specify the correct columns.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap