census-geocoder

command module
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2022 License: MIT Imports: 4 Imported by: 0

README

census-geocoder

Go wrapper for [Census Geocoding Services API][].

Installation

go get https://pablotron.org/census-geocoder

Example

Minimal tool which geocodes command-line arguments and prints the normalized address from the results to standard output:

package main

import (
  "fmt"
  "log"
  "os"
  "pablotron.org/census-geocoder/geocoder"
)

func main() {
  for _, arg := range(os.Args[1:]) {
    // get address matches
    matches, err := geocoder.Locations(arg)
    if err != nil {
      log.Fatal(err)
    }

    // print matches
    for _, match := range(matches) {
      fmt.Println(match)
    }
  }
}

This example is also available in the Git repository as main.go.

Documentation

See https://pkg.go.dev/pablotron.org/census-geocoder/geocoder

Documentation

Overview

minimal address geocoder

Directories

Path Synopsis
Census geocoder.
Census geocoder.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL