Skip to content

zhuoqyin/rgeogo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rgeogo

GoDoc

  • a reverse geocoding lib in go.

It is highly recommended to fork the repo and modify the data structure to fit your use case. Also the data files provided are not guranteed to be accurate. You are recommended to find better data sources on your own.

Install

go get github.com/zhuoqyin/rgeogo

Format of data files

This lib includes 2 data files under data folder that covers US and Canada zip/postal codes. The accuracy is NOT guranteed. You should always use any data sources of your choice.

To feed in the data:

  • name the file as COUNTRY.csv
  • fields of the csv: postal code, lat, lon, city, region
  • put all the data files in a folder
  • pass the path to the folder to rgeogo.Setup(path)

Sample Use Case

import (
	"fmt"
	"github.com/zhuoqyin/rgeogo"
) 

func main() {
	rgeogo.Setup("/PATH/TO/DATA/FOLDER")

	fmt.Println(rgeogo.RGeocode(LAT, LON, 8))
}

About

a reverse geocoding lib in go

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages