diff options
author | Paul Duncan <pabs@pablotron.org> | 2022-11-11 12:26:56 -0500 |
---|---|---|
committer | Paul Duncan <pabs@pablotron.org> | 2022-11-11 12:26:56 -0500 |
commit | 4b09c0813d2f6c3590307370c1ce5e5e271c5e7a (patch) | |
tree | 4872097dba15f53894ac8836e2a6a9d804c7b268 /content/posts/2022-11-11-census-geocoder-released.md | |
parent | e7877172a34a03d2e0ec5215256e0f446a3771d2 (diff) | |
download | pablotron.org-4b09c0813d2f6c3590307370c1ce5e5e271c5e7a.tar.bz2 pablotron.org-4b09c0813d2f6c3590307370c1ce5e5e271c5e7a.zip |
add content/posts/2022-11-11-solar-one-month.md, static/files/posts/solar-one-month
Diffstat (limited to 'content/posts/2022-11-11-census-geocoder-released.md')
-rw-r--r-- | content/posts/2022-11-11-census-geocoder-released.md | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/content/posts/2022-11-11-census-geocoder-released.md b/content/posts/2022-11-11-census-geocoder-released.md new file mode 100644 index 0000000..6369818 --- /dev/null +++ b/content/posts/2022-11-11-census-geocoder-released.md @@ -0,0 +1,55 @@ +--- +slug: census-geocoder-released +title: "Census Geocoder Released" +date: "2022-11-11T11:34:25-04:00" +draft: true +--- +A couple weeks ago I released [census-geocoder][git], a [Go][] wrapper +for the [Census Geocoding Services API][census-api]. + +### Example + +Here's an example application which geocodes the command-line argument +and then prints the normalized address from the geocoding result of each +address to standard output: + +```go +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) + } + } +} +``` + + +### Links + +* [Git repository][git] +* [Documentation][doc] + +[go]: https://go.dev/ + "Go programming language" +[git]: https://github.com/pablotron/census-geocoder + "census-geocoder git repository" +[doc]: https://pkg.go.dev/pablotron.org/census-geocoder/geocoder + "census-geocoder package documentation" +[census-api]: https://geocoding.geo.census.gov/geocoder/Geocoding_Services_API.html + "Census Geocoding Services API" |