latitude-longitude

How to calculate distance using latitude and longitude?

我与影子孤独终老i 提交于 2019-12-01 10:54:10
I have table having latitude and longitude Lat Longitude 40.8151 -73.0455 U 36103 40.8132 -73.0476 U 36103 So what i want is I am passing two Longitude and latitude from my page How can i find nearest place using store procedure i don't have a much hand on it so i have to ask here Tried using this one ( 3959 * acos( cos( radians(37) ) * cos( radians( @latitude ) ) * cos( radians( @longtitude ) - radians(-122) ) + sin( radians(37) ) * sin( radians( @latitude ) ) ) ) But i have to match it with the table values so how can i achieve this? SELECT ROUND(6371 * acos(cos(radians('lat')) * cos(radians

Latitude and Longitude showing as 0 in Android

▼魔方 西西 提交于 2019-12-01 09:29:29
************* TrackGPS.java ***************************** import android.app.AlertDialog; import android.app.Service; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.pm.PackageManager; import android.location.Location; import android.location.LocationListener; import android.location.LocationManager; import android.os.Bundle; import android.os.IBinder; import android.provider.Settings; import android.support.v4.app.ActivityCompat; import android.util.Log; import android.widget.Toast; /** * Created by ANQ on 8/8/2016.

Google Maps API a.lat is not a function error

流过昼夜 提交于 2019-12-01 09:24:08
I was creating a code that can coordinate data from CSV file by using a split as the separator, and will calculate the distance between two input coordinates. But the result always shows the error a.lat is not a function. I already surf the web about this particular error type and can't seem to find the correct solution, can anyone please help me with this error. Here is my coordinate example : -6.168454914420734, 106.7574467 -6.16897225004169, 106.7570443 And here is my code : <!DOCTYPE html> <html> <head> <script src="http://maps.googleapis.com/maps/api/js"></script> <script type="text

How to calculate distance using latitude and longitude?

老子叫甜甜 提交于 2019-12-01 07:26:59
问题 I have table having latitude and longitude Lat Longitude 40.8151 -73.0455 U 36103 40.8132 -73.0476 U 36103 So what i want is I am passing two Longitude and latitude from my page How can i find nearest place using store procedure i don't have a much hand on it so i have to ask here Tried using this one ( 3959 * acos( cos( radians(37) ) * cos( radians( @latitude ) ) * cos( radians( @longtitude ) - radians(-122) ) + sin( radians(37) ) * sin( radians( @latitude ) ) ) ) But i have to match it with

How can I get the latitude and longitude of “x” meter from ref latitude and longitude?

♀尐吖头ヾ 提交于 2019-12-01 07:05:11
问题 I have a distance in meters and ref latitude and longitude. Now I want latitude and longitude from the given ref point on x meters in four direction (south, north, east and west). How can I get this value? I need to write this in C#, but any pseudocode or logic guidance will be welcome. Update: I have a coordinates as references point from that I want to calculate distances of 5 meters in north direction keeping longitude as constant. So I want to calculate latitude at a distance of 5 meters

Calculating the distance between 2 points in c#

有些话、适合烂在心里 提交于 2019-12-01 05:18:08
I am trying to sort out a method to calculate the distance between 2 points in c#. This is the code I have been trying though I fear the answer I get is not correct. static void Main() { //postcode australia 2600 -> 3000 float latA = -31.997976f; float longA = 115.762877f; float latB = -31.99212f; float longB = 115.763228f; decimal distance = (DistanceBetween(latA, latB, longA, longB)); Console.WriteLine("Distance is" + distance); Console.ReadLine(); } static decimal DistanceBetween(float latA, float longA, float latB, float longB) { var RadianLatA = Math.PI * latA / 180; var RadianLatb = Math

Convert latitude/longitude to state plane coordinates

怎甘沉沦 提交于 2019-12-01 04:51:53
I've got a dataset with latitude and longitude which I'd like to convert to the state plane coordinates for Illinois East, using EPSG 2790 ( http://spatialreference.org/ref/epsg/2790/ ) or maybe ESRI 102672 ( http://spatialreference.org/ref/esri/102672/ ). This has definitely been asked before; my code is based on the answers here ( "Non Finite Transformation Detected" in spTransform in rgdal R Package and http://r-sig-geo.2731867.n2.nabble.com/Converting-State-Plane-Coordinates-td5457204.html ). But for some reason I can't get it to work: library(rgdal) library(sp) data = data.frame(long=c(41

Calculating distance using latitude longitude coordinates in kilometers with Java

荒凉一梦 提交于 2019-12-01 04:44:20
问题 I have following method that that calculates distance and returns it in miles: public static int calcDistance(float latA, float longA, float latB, float longB) { double theDistance = (Math.sin(Math.toRadians(latA)) * Math.sin(Math.toRadians(latB)) + Math.cos(Math.toRadians(latA)) * Math.cos(Math.toRadians(latB)) * Math.cos(Math.toRadians(longA - longB))); return new Double((Math.toDegrees(Math.acos(theDistance))) * 69.09).intValue(); } What needs to be changed in order for this method to

Using Matlab Google-Earth Toolbox to plot Latitude and Longitude

谁说我不能喝 提交于 2019-12-01 02:35:05
问题 I am trying to plot some waypoints using the Google-Earth toolbox. The documentation for it is pretty poor, so I figured this would be a good Stack Overflow question. I have a matrix, wypts that has pairs of latitude and longitude coordinates in decimal format (If anyone is wondering this over the State College Airport (SCE) in Pennsylvania). wypts = 40.8489 -77.8492 40.8922 -77.8492 40.9355 -77.8492 40.9788 -77.8492 41.0221 -77.8492 41.0654 -77.8492 41.1087 -77.8492 41.1154 -77.8492 The

How determine if point is within rectangle given all latitude/longitude coordinates?

倖福魔咒の 提交于 2019-12-01 00:51:03
If given x/y coordinates for all 4 corners of rectangle, and then another x/y, it's easy to determine if the point is within the rectangle if top left is 0,0. But what if the coordinates are latitude/longitude where they can be negative (please see attached). Is there a formula that can work in this case? Mathematicaly, you could use inequations to determine that. edit: When doing the example, i've noticed you put the coordinates in the inverse format (y,x) instead of (x,y). In my example I use (x,y) format, so I just inverted the order to easy my explanation. Let's say A = (-130,10) B = (-100