latitude-longitude

SQL Server: Error converting data type varchar to float

限于喜欢 提交于 2019-12-02 12:22:06
I have the following SELECT statement to calculate RADIANS and COS . SELECT COS(RADIANS(latitude)) as Lat FROM tbl_geometry; But I'm getting an error: Error converting data type varchar to float. My attempts: Attempt #1 : select Cos(convert(float, (Radians(convert(float, latitude))))) as Lat from tbl_geometry; Attempt #2 . select Cos(Radians(convert(float, latitude))) as Lat from tbl_geometry; Both attempts result in the same error. Note : column Latitude is of type varchar . Use try_convert() to find the invalid data: select latitude from tbl_geometry where try_convert(float, latitude) is

Calculating number of points within a certain radius [duplicate]

江枫思渺然 提交于 2019-12-02 12:10:15
This question already has an answer here: find locations within certain lat/lon distance in r 4 answers Given a data frame with latitudes and longitudes I want to add a column that simply contains the count of other points (of the same data frame) that are within a certain radius e.g. within 10 km of that specific point. Example data: set.seed(1) radius<-10 lat<-runif(10,-90,90) long<-runif(10,-180,180) id<-1:10 dat<-cbind(id,lat,long) id lat long [1,] 1 -42.20844 -105.8491530 [2,] 2 -23.01770 -116.4395691 [3,] 3 13.11361 67.3282248 [4,] 4 73.47740 -41.7226614 [5,] 5 -53.69725 97.1429112 [6,]

Listing number of obervations by location

我怕爱的太早我们不能终老 提交于 2019-12-02 11:58:19
Need help here. I am trying to create a new column that will list the number of restaurants with in 200 meters of a restaurant using latitude and longitude. I couldn't find anything on stackoverflow, and I am no R ninja. Any help would be appreciated! head() business_id restaurantType full_address open city 1 --5jkZ3-nUPZxUvtcbr8Uw Greek 1336 N Scottsdale Rd\nScottsdale, AZ 85257 1 Scottsdale 2 --BlvDO_RG2yElKu9XA1_g Sushi Bars 14870 N Northsight Blvd\nSte 103\nScottsdale, AZ 85260 1 Scottsdale 3 -_Ke8q969OAwEE_-U0qUjw Beer, Wine & Spirits 18555 N 59th Ave\nGlendale, AZ 85308 0 Glendale 4 -

Tableau tooltip incorrect when toggling through quick filter

不问归期 提交于 2019-12-02 08:53:52
问题 Link to workbook on public tableau I created calculated value to determine grade for business, and this is colormap (in tab Grade per Location) And when I hover over datapoints on map (tab Map), it displays correct Grade, i.e. D for Shish Boom Bah Car Wash But as soon as I select any location from a drop-down, all grades are A Tot_Avg is calculated like this: { EXCLUDE [Location (Loc)] : AVG([Rating]) } Avg_Rating like this: AVG([Rating]) And here are the conditions for receiving an A: IF

twitter4j geo streaming latitude/longitude for Hongkong

混江龙づ霸主 提交于 2019-12-02 08:20:10
I'm trying to capture tweets using twitter4j's streaming methods from the area of Hongkong. However not matter what latitude or longitude coordinates I choose to do so (from http://www.latlong.net/convert-address-to-lat-long.html ) I always get invalid latitude/longitude error. Latitude/longitude are not valid: 22.27, 114.17, 22.35, 114.21 The code I use is otherwise working fine: TwitterStream twitterStream = new TwitterStreamFactory(cb.build()).getInstance(); FilterQuery fq = new FilterQuery(); fq.locations( new double[][]{ new double[]{ 22.274286d, 114.166875d}, new double[]{22.351943d, 114

Tableau tooltip incorrect when toggling through quick filter

倾然丶 夕夏残阳落幕 提交于 2019-12-02 06:58:25
Link to workbook on public tableau I created calculated value to determine grade for business, and this is colormap (in tab Grade per Location ) And when I hover over datapoints on map (tab Map ), it displays correct Grade, i.e. D for Shish Boom Bah Car Wash But as soon as I select any location from a drop-down, all grades are A Tot_Avg is calculated like this: { EXCLUDE [Location (Loc)] : AVG([Rating]) } Avg_Rating like this: AVG([Rating]) And here are the conditions for receiving an A: IF [Avg_Rating] > ATTR([Tot_Avg]) - (.10 * ATTR([Tot_Avg])) THEN "A" How to troubleshoot? I think your

How to get latitude and longitude using a background service in android?

為{幸葍}努か 提交于 2019-12-02 03:48:04
问题 I want to get the latitude and longitude of the user using a background service.I am using the following code to get the latitude and longitude in android. public class MyService extends Service { private static final String TAG = "BOOMBOOMTESTGPS"; private LocationManager mLocationManager = null; private static final int LOCATION_INTERVAL = 10; private static final float LOCATION_DISTANCE = 0; Handler mHandler = new Handler(); public SharedPreferences pref; GoogleApiClient mGoogleApiClient =

Geting Speed From GPS on Android Calculating Distance And Time

混江龙づ霸主 提交于 2019-12-02 01:25:55
问题 I have been trying to get speed by the help of GPS. I would like to get Gps datas(latitude-longitude-speed) when my telephone fell down. When telephone fell down, gps datas are obtained and sent to my server. For this aim, I used threads. Each thread get gps datas and send to server them. My problem is speed value. I got speed calculating distance between two location and time (speed = distance / time) Thread makes : @Override public void run() { Looper.prepare(); float distance = 0.0f; float

Geting Speed From GPS on Android Calculating Distance And Time

我的梦境 提交于 2019-12-01 21:16:38
I have been trying to get speed by the help of GPS. I would like to get Gps datas(latitude-longitude-speed) when my telephone fell down. When telephone fell down, gps datas are obtained and sent to my server. For this aim, I used threads. Each thread get gps datas and send to server them. My problem is speed value. I got speed calculating distance between two location and time (speed = distance / time) Thread makes : @Override public void run() { Looper.prepare(); float distance = 0.0f; float[] results = new float[1]; Long longValue = new Long(11); double firstLatitude; double firstLongitude;

How do I convert ECI coordinates to longitude latitude and altitude to display on a Map?

怎甘沉沦 提交于 2019-12-01 14:50:49
问题 I would like to be more specific about what I want to do. I get coordinates in ECI and I need to get the latitude and longitude from this. How can I do? I was searching but I could'nt find anything about it. Thanks again. (I'm doing a small program in java that shows the position of a satellite in a given time. So, I used the NORAD SGP algorithm, and I have the position (x,y,z) and velocity(Vx,Vy,Vz). But the coordinates system used by this algorithm is the ECI, according what I read. Now I