latitude-longitude

Display Latitude and longitude on a webserver

巧了我就是萌 提交于 2019-12-25 18:24:55
问题 I have been trying to display the gps coordinated to a web server since several days but havent come to any conclusion yet. What i am trying to do is to get the latitudes and longitudes of a person and then display them on the webserver. I got a php server and mysql database. There is no error but There is nothing displayed on the url public class UseGps extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super

Lat-Lon Point is in rectangle defined by two other Lat-Lon points

…衆ロ難τιáo~ 提交于 2019-12-25 14:48:24
问题 I would like to determine if a certain point is contained within a 'rectangle'. The 'rectangle' will be made up of latitude/longitude coordinates (given northWest and southEast coordinate points)... so basically here are the parameters: public boolean hasPoint(LatLon northWest, LatLon southEast, LatLon point) {} The LatLon class just has: double latitude; double longitude; I have no idea how to start this... any help will be appreciated. 回答1: Assuming this LatLon class just has an x and y

How to find the nearest distance between two different data frames

人盡茶涼 提交于 2019-12-25 11:03:04
问题 I am trying to find the nearest distance of locations in dataset 1 to dataset 2. Both data sets are different sizes. Ive looked into using the Haversine function but I'm unsure what I need to do after. 回答1: Since you have not provided a sample of your data, I am going to use the oregon.tract data set from the UScensus2000tract library as a reproducible example. Here is a solution based on fast data.table that I get from this other answer here. # load libraries library(data.table) library

How to find the nearest distance between two different data frames

情到浓时终转凉″ 提交于 2019-12-25 11:01:17
问题 I am trying to find the nearest distance of locations in dataset 1 to dataset 2. Both data sets are different sizes. Ive looked into using the Haversine function but I'm unsure what I need to do after. 回答1: Since you have not provided a sample of your data, I am going to use the oregon.tract data set from the UScensus2000tract library as a reproducible example. Here is a solution based on fast data.table that I get from this other answer here. # load libraries library(data.table) library

Plot Sphere with custom gridlines in R

浪子不回头ぞ 提交于 2019-12-25 00:08:49
问题 I would like to plot a sphere in R with the gridlines on the surface corresponding to the equal area gridding of the sphere using the arcos transformation. I have been experimenting with the R packakge rgl and got some help from : Plot points on a sphere in R Which plots the gridlines with equal lat long spacing. I have the below function which returns a data frame of points that are the cross over points of the grid lines I want, but not sure how to proceed. plot_sphere <- function(theta_num

Direction based off of 2 Lat,Long points

不问归期 提交于 2019-12-24 07:07:00
问题 I am looking for a function that will allow me to send 2 Lat, Longs. 1 Lat, long is my base and the second is what I want to determine if it is N,S,E, or West. Or would I have to go NW,N,NE,EN,E,ES,SE,S,SW,WS,W,WN? Either way does anyone have something like this in C#? 回答1: First you can calculate the Great Circle Bearing θ = atan2( sin(Δλ).cos(φ2), cos(φ1).sin(φ2) − sin(φ1).cos(φ2).cos(Δλ) ) JavaScript (easily convertable to C#): var y = Math.sin(dLon) * Math.cos(lat2); var x = Math.cos(lat1

Does it have impact on performance when using DECIMAL(17,13) for both Latitude and Longitude data in MySQL?

社会主义新天地 提交于 2019-12-24 06:41:18
问题 I have done research on Google and read some answers on Stack Overflow. DECIMAL is a good choice for storing latitude and longitude data. But people have different opinions about the numbers of digit before and after the decimal point. Latitude range can be max 2 digits (-90 and 90) and longitude range can be max 3 digits (-180 and 180). The numbers of digit after the decimal point that I get from a Restful API is 12 digits. Thus the database columns can be as following. lat DECIMAL(14, 12)

MySql How to convert varchar (latitude, longitude) to Decimal fields?

☆樱花仙子☆ 提交于 2019-12-24 01:19:40
问题 In mysql I have a varchar containing latitude and longitude provided by Google maps. I need to be able to query based on a bounding box value, but have no need for the geo features now available. I'm trying to populate 2 new Decimal fields with the Decimal values found in the varchar. Here is the query that I'm trying to use, but the result are all rounded values in the new fields. Sample data: '45.390746926938185, -122.75535710155964', '45.416444621636415, -122.63058006763458' Create Table:

Not gettting accurate location in some android phones

允我心安 提交于 2019-12-23 22:03:58
问题 I have used below code. It work fine but in some devices like Redme,Asus not getting accurate location.It shown me too far from my current location aprox 20 km away.Not getting where is problem somebody have idea please share there ideas.Thanks in advance. public class Currentlocation extends Service implements LocationListener { private final Context mContext; // flag for GPS status boolean isGPSEnabled = false; // flag for network status boolean isNetworkEnabled = false; // flag for GPS

Find if given lat-long lies in any of the polygon in MongoDB

别说谁变了你拦得住时间么 提交于 2019-12-23 21:19:48
问题 I want to know if I get a lat-long of a user and want to check if he lies in any of the polygon that is stored in my db (MongoDB). How can this be achieved using mongoDB. For instance my db will have 10 polygons stored as GeoJson objects. I get a lat-long and want to check if this lat-long lies in any of the 10 polygons in my DB. Can this be achieved in MongoDB? 回答1: I dont think your particular case can be achieved in MongoDB. MongoDB does have polygon calculations with the $polygon operator