earthdistance

PostgreSQL: How to get all points in certain radius

时光怂恿深爱的人放手 提交于 2020-01-02 12:26:12
问题 I'm using Postgresql 9.3 and iv'e installed cube and earthdistance extensions. I'm trying to follow this tutorial, so i have a simple events table with 4 fields: id, name, lat, lng. Now i'm trying to run this query, to get all events within 1 km radius: SELECT events.id, events.name FROM events WHERE earth_box(31.789225, 34.789612, 1000) @> ll_to_earth(events.lat, events.lng); but i keep getting this error: 20:59:34 Kernel error: ERROR: function earth_box(numeric, numeric, integer) does not

Convert latitude and longitude to ECEF coordinates system

让人想犯罪 __ 提交于 2019-12-30 18:07:50
问题 I am studying pArk Apple sample code, and how it is works. anyone knows how convert the latitude and longitude to ECEF coordinates, and Covert ECEF to ENU coordinates centered at given lat, lon functions are work? I just want to understand what is going on in this function! thanks. void latLonToEcef(double lat, double lon, double alt, double *x, double *y, double *z) { double clat = cos(lat * DEGREES_TO_RADIANS); double slat = sin(lat * DEGREES_TO_RADIANS); double clon = cos(lon * DEGREES_TO

PostgreSQL: How to get all points in certain radius

拥有回忆 提交于 2019-12-06 04:30:52
I'm using Postgresql 9.3 and iv'e installed cube and earthdistance extensions. I'm trying to follow this tutorial , so i have a simple events table with 4 fields: id, name, lat, lng. Now i'm trying to run this query, to get all events within 1 km radius: SELECT events.id, events.name FROM events WHERE earth_box(31.789225, 34.789612, 1000) @> ll_to_earth(events.lat, events.lng); but i keep getting this error: 20:59:34 Kernel error: ERROR: function earth_box(numeric, numeric, integer) does not exist HINT: No function matches the given name and argument types. You might need to add explicit type

Convert latitude and longitude to ECEF coordinates system

谁都会走 提交于 2019-12-01 16:56:51
I am studying pArk Apple sample code, and how it is works. anyone knows how convert the latitude and longitude to ECEF coordinates, and Covert ECEF to ENU coordinates centered at given lat, lon functions are work? I just want to understand what is going on in this function! thanks. void latLonToEcef(double lat, double lon, double alt, double *x, double *y, double *z) { double clat = cos(lat * DEGREES_TO_RADIANS); double slat = sin(lat * DEGREES_TO_RADIANS); double clon = cos(lon * DEGREES_TO_RADIANS); double slon = sin(lon * DEGREES_TO_RADIANS); double N = WGS84_A / sqrt(1.0 - WGS84_E * WGS84

Custom Database Type in ActiveRecord

浪子不回头ぞ 提交于 2019-11-30 02:15:56
问题 I am using Rails 3.1.1 with PostgreSQL 9.1 and the earthdistance module. To be able to calculate the distance between different locations properly, I have setup a column with the earth type in my branches table. The problem I am experiencing now is that my Rails application that uses this table does not understand the earth type and thus I am getting this in my db/schema.rb : # Could not dump table "branches" because of following StandardError # Unknown type 'earth' for column 'location' This

How to compute “EMD” for 2 numpy arrays i.e “histogram” using opencv?

帅比萌擦擦* 提交于 2019-11-28 23:31:06
Since I'm new to opencv, I don't know how to use the cv.CalcEMD2 function with numpy arrays. I have two arrays: a=[1,2,3,4,5] b=[1,2,3,4] How can I transfer numpy array to CVhistogram and from Cvhistogram to the function parameter signature ? I would like anyone who answers the question to explain any used opencv functions through the provided solution. "EMD" == earth mover's distance . Update:- also ,It will be helpful if anyone can tell me how to set the cv.CalcEMD2 parameter i.e "signature" using numpy array!! Note:- * For those who may be interested in this question ,This answer needs more

How to compute “EMD” for 2 numpy arrays i.e “histogram” using opencv?

老子叫甜甜 提交于 2019-11-27 15:00:48
问题 Since I'm new to opencv, I don't know how to use the cv.CalcEMD2 function with numpy arrays. I have two arrays: a=[1,2,3,4,5] b=[1,2,3,4] How can I transfer numpy array to CVhistogram and from Cvhistogram to the function parameter signature ? I would like anyone who answers the question to explain any used opencv functions through the provided solution. "EMD" == earth mover's distance. Update:- also ,It will be helpful if anyone can tell me how to set the cv.CalcEMD2 parameter i.e "signature"