我有一张桌子叫做Places, 这张桌子上的每一个记录都有它的经度和纬度。
我想在这张桌子上搜索 以找到附近的位置 以特定的长长和拉特( 表示附近圆圈的半径为 25 KM )
我有一张桌子叫做Places, 这张桌子上的每一个记录都有它的经度和纬度。
我想在这张桌子上搜索 以找到附近的位置 以特定的长长和拉特( 表示附近圆圈的半径为 25 KM )
由于您有限制搜索的一定距离, 您的问题稍有不同, 问题在于那些想要找到最近的点( 不受限制 ) 。 我发明了两种公式, 将距离计算简化为度差。 这些公式是适合地球的, 而不是其他球体形状 :
以下显示在特定纬度周围1度的纬度周围环绕了多少公里:
LongDistanceFactor = − 0.0114 * (lat)^2 − 0.2396(lat) + 112.57
第二个显示一个特定纬度周围1度的纬度环绕了多少公里:
LatDistanceFactor = 0.0139(lat) + 110.51
所以对于给定的 25 公里左右(lat, lng) 您只需要在 lat § (25/Lat Disstantance Factor)
和 lng § (25/Long DisstantFactor)
之间找到它们的边界点。
编辑 : 我对 Lat 和 Lng 都使用 +, 目标区域将是每边50Km的正方形。 如果您坚持一个圆形区域, 您可以对第一个结果序列进行单圈计算, 实际公式为 < 坚固 > 点距离 < / 坚固 >, 省略不在您圆圈内的区域 。
I m trying to export some tables from SQL Server 2005 and then create those tables and populate them in Oracle. I have about 10 tables, varying from 4 columns up to 25. I m not using any constraints/...
In our database we have an SQL server account that has the correct roles to access some of the databases. We are now switching to windows authentication and I was wondering if we can create a NT user ...
I have been trying to execute a MS SQL Server stored procedure via JDBC today and have been unsuccessful thus far. The stored procedure has 1 input and 1 output parameter. With every combination I ...
Is it possible to use the sqlcmd command to dump table structure the way it can be done with mysqldump?
Hi I have the following SP, however when I use LINQ to SQL it generates 2 multiple recordsets. For my sanity I am trying to fathom out what it is in the stored procedure that is doing this and would ...
I want to create a table in MS SQL Server 2005 to record details of certain system operations. As you can see from the table design below, every column apart from Details is is non nullable. CREATE ...
I love the new DATE datatype in SQL Server 2008, but when I compare a DATE field to a DATETIME field on a linked server (SQL 2005, in this case), like this: DECLARE @MyDate DATE SET @MyDate = CONVERT(...
How to determine if a Transaction is active i.e. before issuing Begin Transaction I want to ensure that no previous transaction are open.. the platform is VB6, MS-SQL Server 2000 and ADO 2.8