You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2020/10/06 07:47:03 UTC

[GitHub] [druid] SWH12 removed a comment on issue #9847: When using Spatial filters, what is the unit of radius

SWH12 removed a comment on issue #9847:
URL: https://github.com/apache/druid/issues/9847#issuecomment-704094601


   > I made one workaround like this:
   > 
   > ```sql
   > SELECT
   > MyDataRows,
   > FROM "Datasource"
   > WHERE
   > (POWER(DataLatitude-52.1, 2) + POWER( (DataLongitude-5.1)*COS(RADIANS(52.1)),2)) < POWER(5/68, 2)
   > ```
   > 
   > I am searching around Lat =52.1 and Lon = 5.1 with a radius of 5(km) and I assume that 1 degree is 68 km length at my latititude.
   > 
   > The result will be all rows that have a DataLatitude and DataLongitude within that radius.
   > 
   > This is based on
   > https://jonisalonen.com/2014/computing-distance-between-coordinates-can-be-simple-and-fast/ (the SQL part)
   > and the table at the following page to get the 1 degree is 68 km (the contstant at the end of the formula):
   > https://en.wikipedia.org/wiki/Longitude#Length_of_a_degree_of_longitude
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org