简体   繁体   English

GPS坐标:一个点周围1平方公里

[英]GPS coordinates: 1km square around a point

I was hoping someone out there could provide me with an equation to calculate a 1km square (X from a.aaa to b.bbb, Y from c.ccc to c.ccc) around a given point, say lat = 53.38292839 and lon = -6.1843984 ? 我希望那里有人可以给我一个方程来计算一个给定点附近的1平方公里(从a.aaa到b.bbb的X,从c.ccc到c.ccc的Y),比如lat = 53.38292839lon = -6.1843984 I'll also need 2km, 5km and 10km squares around a point. 我还需要一个点周围2公里,5公里和10公里的方格。

I've tried googling around to no avail... It's late at night and was hoping someone might have quick fix handy before I delve into the trigonometry... 我试过谷歌搜索无济于事......这是深夜,希望有人可以快速修复方便我钻研三角函数之前......

I'll be running all this in Javascript, although any language is fine. 我将在Javascript中运行所有这些,虽然任何语言都可以。

If the world were a perfect sphere, according to basic trigonometry... 根据基本的三角学,如果世界是一个完美的球体......

Degrees of latitude have the same linear distance anywhere in the world, because all lines of latitude are the same size. 纬度在世界任何地方都具有相同的线性距离,因为所有纬度线都是相同的尺寸。 So 1 degree of latitude is equal to 1/360th of the circumference of the Earth, which is 1/360th of 40,075 km. 因此1度纬度等于地球周长的1/360,即40,075 km的1/360。

The length of a lines of longitude depends on the latitude. 经度线的长度取决于纬度。 The line of longitude at latitude l will be cos(l)*40,075 km. 纬度l的经度线为cos(l)* 40,075 km。 One degree of longitude will be 1/360th of that. 一度经度将是1/360。

So you can work backwards from that. 所以你可以从那里倒退。 Assuming you want something very close to one square kilometre, you'll want 1 * (360/40075) = 0.008983 degrees of latitude. 假设你想要一个非常接近一平方公里的东西,你需要1 *(360/40075)= 0.008983纬度。

At your example latitude of 53.38292839, the line of longitude will be cos(53.38292839)*40075 = [approx] 23903.297 km long. 在您的示例纬度53.38292839,经度线为cos(53.38292839)* 40075 = [约] 23903.297公里长。 So 1 km is 1 * (360/23903.297) = 0.015060 degrees. 所以1 km是1 *(360 / 23903.297)= 0.015060度。

In reality the Earth isn't a perfect sphere, it's fatter at the equator. 实际上,地球不是一个完美的球体,它在赤道上更加肥胖。 And the above gives a really good answer for most of the useful area of the world, but is prone to go a little odd near the poles (where rectangles in long/lat stop looking anything like rectangles on the globe). 上面给出了世界上大多数有用区域的一个非常好的答案,但是在极点附近容易变得有些奇怪(长/纬线中的矩形停止看起来像地球上的矩形)。 If you were on the equator, for example, the hypothetical line of longitude is 0 km long. 例如,如果你在赤道上,假设的经度线是0公里长。 So how you'd deal with a need to count degrees on that will depend on why you want the numbers. 那么你如何处理需要计算学位的需要将取决于你想要数字的原因。

Here is something from my notes to be used on Android with its decimal GPS. 以下是我的笔记中使用的十进制GPS在Android上使用的内容。

Lat Long: NY City 40N 47 73W 58 40.783333 73.966667 Lat Long:NY City 40N 47 73W 58 40.783333 73.966667

Wash DC 38N 53 77W 02 38.883333 77.033333 清洗DC 38N 53 77W 02 38.883333 77.033333

yields = 209 miles !! 产量= 209英里!! VERY CLOSE 很接近

Distance (miles) (x) = 69.1 (lat2-lat1) Distance(miles) (y) = 53.0 (long2 - long1) As crow flys sqrt (x2 + y2) ... duh!@ 距离(英里)(x)= 69.1(lat2-lat1)距离(英里)(y)= 53.0(long2 - long1)乌鸦飞行sqrt(x2 + y2)... duh!@

delta(LAT) / Mile = .014472 delta(LONG) / Mile = .018519 delta(LAT)/ Mile = .014472 delta(LONG)/ Mile = .018519

Using a box as approximation To find someone within 100 miles (100 north / 100 south, 100 E / 100 W) From 0,0 -14.472 / + 14.472 , -18.519 / 18.519 使用方框作为近似值找到100英里内的人(100北/ 100南,100 E / 100 W)从0,0 -14.472 / + 14.472,-18.519 / 18.519

A simpler way of generating a gps square given the centre would be to use the indirect Vincenty algorithm.The Javascript code here shows how to do it http://www.movable-type.co.uk/scripts/latlong.html . 给出中心的更简单的生成gps方形的方法是使用间接Vincenty算法。这里的Javascript代码显示了如何做到这一点http://www.movable-type.co.uk/scripts/latlong.html Creating a square using a circle isn't to hard. 使用圆形创建正方形并不难。 Squares are equal distance to each point. 正方形与每个点的距离相等。 So given a centre point, distance from the centre, change the bearing from 0 or any number depending on rotation of the square and increment by 90 degrees or PI/2 radians. 因此,给定一个中心点,距离中心的距离,根据方形的旋转将轴承从0或任何数字改变,并增加90度或PI / 2弧度。 By incrementing by 90 degrees each time and you will up with a square in circular space. 通过每次增加90度,你将在圆形空间中增加一个正方形。

I use this myself for generating GPS points around a centre point with a given distance .---. 我自己用这个来生成一个给定距离的中心点周围的GPS点.---。 --/- --0-- -/-- .---. - / - --0-- - / - .---。

TL;DR TL; DR

10 km = 0.08999 radius from a certain geopoint . 某个geopoint 10 km = 0.08999半径。 This calculation is only based on latitude values and applies only to geopoints with WGS84 projection. 此计算仅基于纬度值,仅适用于具有WGS84投影的地理点。

More details 更多细节

If you want a more accurate answer you must have to calculate it by building a function of some sort. 如果你想要一个更准确的答案,你必须通过构建某种函数来计算它。 However it still don't guarantee because people even quarrel for the degrees of error. 然而,它仍然不能保证因为人们甚至争吵的程度。 Taking altitude into account, mercator or not, etc. 考虑到海拔高度,mercator与否等等。

Caution 警告

The value above is just a rule of a thumb so don not use it for critical applications. 上面的值只是一个拇指规则,所以不要将它用于关键应用程序。

Reference 参考

GIS StackExchange, How do I calculate the bounding box for given a distance and latitude/longitude , answer by David the Australian developer GIS StackExchange, 如何计算给定距离和纬度/经度的边界框 ,由澳大利亚开发人员David回答

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM