Giter Site home page Giter Site logo

jdvan / excel-geocoder Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tdowd/excel-geocoder

0.0 1.0 0.0 199 KB

A VBA application for geocoding and reverse geocoding in Excel. Supports both Google's free and enterprise for business geocoder (Maps API for Work).

License: MIT License

Visual Basic 100.00%

excel-geocoder's Introduction

excel-geocoder

A VBA application for geocoding and reverse geocoding in Excel. Supports both Google's free and enterprise for business geocoder (Maps API for Work).

Background

GIS and geospatial data science applications will usually require geocoding of locations or reverse geocoding of latitude/longitude at some point in the analysis. While most of this analysis is frequently done in something a little more involved than Excel (python, arcGIS, ESRI, etc.), sometimes I have found that doing something quick with a dataset in Excel can be more efficient than working with a SQL DB or creating a python script.

This project was influenced by a blog post by josephglover. josephglover's module on accessing the free Google geocoder was the foundation which I used to make the reverse geocoder and to add flexibility to use Google's Maps API for Work Enterprise geocoder.

Prerequisites

  • Enable developer tab in Excel. Instructions from MSFT can be found here.
  • Within the VB IDE, add "Microsoft XML, v6.0" as a Reference. Can be found within Tools - References.

Installation

  • Import the .bas file into your project.
  • To use Google's Maps API for Work geocoder, view the code in the VB IDE and change the gintType constant equal to 1 and insert your Google Client ID and Google Secret Key into the gstrClientID and gstrKey constants respectively.
  • To use Google's API Premium Plan, change the gintType constant equal to 2 and insert your API key into the gstrKey constant.
  • To use Google's Free Geocoding API, change the gintType constant equal to 0.
  • Note that as of late Summer/early Fall 2018, Google's Free Geocoding API now also requires a key. More information can be found here and here. Still set your gintType to 0 and insert your new API key into the gstrKey constant and you should still be able to geocode in Excel.

Usage

  • =AddressGeocode(address)
    • Takes in the address of the location we want to geocode and returns the first latitude, longitude pair from the geocoder.
  • =ReverseGeocode(lat,long)
    • Takes in a latitude, longitude pair and returns the first formatted address from the geocoder.

TODO

  • Clean up code around key management as a result of Google's 2018 key management changes
  • Test cases
  • Functionality for Bing Maps, Data Science Toolkit, etc.
  • Fix for forcing too many requests at one time

excel-geocoder's People

Contributors

tdowd avatar zek19 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.