<p>So as I was pondering weak and weary at work, I came up with an idea. I won't get into details since it hinges (mostly) on one thing that I'm uncertain of.</p>
<p>Which brings me to ask this question: how (if at all) can I get the geo coordinates of a machine (laptop), using golang? Approximate with error up to 50 meters or so would be acceptable but I'd like it to get it as close as possible.</p>
<p>Anyway to do this that's clear cut or am I going to need to do a little hoop jumping?</p>
<hr/>**评论:**<br/><br/>kpurdon: <pre><p>Could use <a href="http://dev.maxmind.com/geoip/geoip2/geolite2/" rel="nofollow">http://dev.maxmind.com/geoip/geoip2/geolite2/</a> w/ the device ip, but the accuracy is usually not great. If the device has a gps you'll have to see about accessing that data (that'll be different per os). Not a ton specific to go, just interacting with system apis or data. </p></pre>tywkeene: <pre><p>That would totally work, but I'm trying to get at least up to a household a machine might be in. Maybe cross reference this with ssid's in range? </p>
<p>Have you heard about any other possible way to get location data relatively accurate? This is the only part of this idea I'm entirely at a loss for ideas with.</p>
<p>This may be harder than I thought. I appreciate the hint though. Cheers, gopher.</p></pre>twisted1919: <pre><p>Using something like geoip will get you the location of the provider, won't tell you where the guy having that ip actually is, so it is not accurate. I think that if you need accuracy, the only way is to ask for the location via javascript. </p></pre>daniels0xff: <pre><p>Not to mention VPNs. Best way would be using GPS module if possible.</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
0 回复
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传