loc2country

Lat/lon to country

  • 所有者: soorajb/loc2country
  • 平台:
  • 許可證:
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

Loc2Country

Location coordinates (lat/lon) to ISO alpha-3 country code. Responds in microseconds.

Manual

Input format: latitude, longitude

Output format: 3-letter-ISO-country-code, time-taken-to-respond-in-nanos

HowTo

  1. Run start.sh
  2. This will start a TCP server (localhost:3333) by default.
  3. Connect to the server by using telnet. (eg: "telnet localhost 3333")
  4. Input lat and lon seperated by comma, returns 3 letter country code and time taken to respond in nanoseconds.

Compiling

To compile, run:

go build src/server.go

To compile for a Linux machine from Mac, run (with correct architecture):

env GOOS=linux GOARCH=amd64 go build src/server.go

Testing

To test, run:

go test

Example

Starting the server:

$ sh start.sh 
2016/08/18 23:30:07 Creating server with address localhost:3333
2016/08/18 23:30:07 Loading data..
2016/08/18 23:30:13 Loading complete.
2016/08/18 23:30:13 Total Entries: 5235316
2016/08/18 23:30:13 Boot time: 5 seconds
$ telnet 127.0.0.1 3333
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
12,77
IND,17176

Data

The world boundaries were generated using QGIS, converted to a set of ~350 million geohashes at precision level 6 and then reduced (compressed) to a set of ~5 million geohashes using georaptor.

Contributors

Sooraj B - @soorajb

Ashwin Nair - @ashwin711

Harikrishnan Shaji - @har777

License

MIT License

主要指標

概覽
名稱與所有者soorajb/loc2country
主編程語言Go
編程語言Shell (語言數: 2)
平台
許可證
所有者活动
創建於2018-07-20 11:46:26
推送於2018-07-22 07:39:52
最后一次提交2018-07-22 13:09:45
發布數0
用户参与
星數260
關注者數7
派生數12
提交數3
已啟用問題?
問題數1
打開的問題數1
拉請求數0
打開的拉請求數0
關閉的拉請求數0
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?