Can I use react-native-maps for distance calculation between two coordinates? - react-native

I am using react-native-maps but I wanna know if its possible to measure the distance between two coordinates (in road not air distance).
I know I can use Haversien package but this calculates the air distance.

The google maps distance matrix service could be used for this purpose. The service "computes travel distance and journey duration between multiple origins and destinations using a given mode of travel". Here is a link to the documentation https://developers.google.com/maps/documentation/javascript/distancematrix.

Related

Calculate driving distance between origin and destination using longitude and latitude natively in BigQuery?

I would like to calculate driving distance between two points writing SQL in Google BigQuery. I understand there is a method to calculate linear distance or "bird" miles using the following function: ROUND(ST_DISTANCE(ST_GEOGPOINT(C.LONGITUDE, C.LATITUDE), ST_GEOGPOINT(B.LNG_NBR, B.LAT_NBR))/1609.34,2) AS LINEAR_DIST_MILES
However, I am interested in driving distance instead of a linear distance. Is there a way to do this natively in Google BigQuery without needing to hit a Google Map API? I've also explored some solutions in R but that requires a Google Maps API key.
You would need two parts
good roads datasets
routing algorithms
BigQuery public datasets includes OpenStreetMaps, which is a reasonable dataset of roads (and other types of information) in most areas. There is also TIGER (bigquery-public-data.geo_us_roads) dataset which is US-specific.
Carto provides a sets of UDFs that can be used for routing. They've published an article how to connect things together:
https://carto.com/blog/how-to-do-route-optimization-at-scale-with-carto-bigquery/

How can I get an approximate upper body volume from the Kinect skeleton?

I want to do a fitting room app using the Kinect. Since I need to measure the player clothing size (S, M, L, XL) I must get the player's upper body "approximation" mass only using its skeleton (not using depth data). I don't need a very precise calculation.
Examine the length of the bones by calculating the distance between the relevant upper-body joints:
SHOULDER_LEFT
SHOULDER_CENTER
SHOULDER_RIGHT
SPINE
HIP_LEFT
HIP_CENTER
HIP_RIGHT
For example, two of the most relevant features to calculate are likely related to the user's height - the distance between SHOULDER_CENTER and SPINE joints, and the distance between SPINE and HIP_CENTER joints.
I suggest using Kinect Studio to store recordings of users and classify each recording according to the user's clothing size. With this data, you should be able to iterate on an algorithm (assuming it's feasible to approximate this accurately enough using only the skeleton data).
(As a side note, to do this more accurately, you'll probably need the depth data and 3D scanning. For example, there is an existing company called Styku that has a related Kinect product that does 3D body scanning.)

Need help in solving Vehicle Routing in a production environment

I am working on a problem for my startup where I have to assign locations to delivery trucks based on an optimal route from a distribution center.
I am using ortools right now but I am working with gps coordinates unlike given example which is using a grid structure.
Right now I've figured out a way to calculate distance between coordinates and modified their demo python code but as far as I know there is no way to define gps coordinates as home depot and I am struggling there to get optimal routes from my home depot.
Any help would be appreciated.
Thank You
Actually, by providing a Distance callback function (cf. https://developers.google.com/optimization/routing/tsp/vehicle_routing#distance_callback) you can provide whatever you want as distance function...
Thus, you could see 2D location as an id (e.g. GPS location of your addresses) then create a distance callback which calculate the shortest distance between two locations using road etc... (e.g. you can use the GMap Direction API)
For the depot, it's just a node like others (i.e. has a location), then you can set this node as the depot in the RoutingModel Ctor...
note: You should create a Distance cost matrix first then use it as a look up table to return distance in constant time during iteration cf example in the doc

Using SQL spacial data queries to calculate distance from two different projections

So, I've got some data that has longitude and latitude. I don't know what projection those are from. I've got some latitude and longitude I'll be fetching from Google maps API, which uses a projection with SRID of 3857.
If I just assume the data is from the same projection, and it turns out they're not, how far off could my distances be?
For instance, if they're from a 3-d projection (say 4326), but I just put them into a Geometry column with SRID 3857, and we're in the Northern Hemisphere, (Great Lakes area, but also other parts of the US), is there a way I can figure out how far off that would be?
EPSG:3857 uses meters as units, while EPSG:4326 uses degrees. If you try to plot them on the same map without reprojecting one or the other, they will be very far off (many orders of magnitude) from each other.
You said you'll be fetching lat-lng from the Google Maps API, using a EPSG:3857 as a projection, but latitude and longitude coordinates are not projected by definition, although they may use a different datum. I can't find official Google documentation, but consensus seems to be that Google Maps API uses WGS84, same as EPSG:4326, so lat-lngs you pull from google maps API will probably fit exactly on top of others from EPSG:4326.
See http://spatialreference.org/ref/epsg/4326/ and http://spatialreference.org/ref/sr-org/7483/ and https://gis.stackexchange.com/questions/34276/whats-the-difference-between-epsg4326-and-epsg900913

Calculate user parameters using Microsoft kinect

I want to get the following information of a user that is captured using a Microsoft Kinect using a WPF application.
Shoulder width
Height
Waist width
Hip width
Arm length
Bust size
I couldn't find any standard way of doing this except calculating the x,y co-ordinates of the user. Is there any very efficient and accurate way of doing this?
You can follow the article # http://www.codeproject.com/Articles/380152/Kinect-for-Windows-Find-user-height-accurately
The easiest way to accomplish this task is using the Pythagorean theorem to compute the distance between two skeleton joints.
To get the shoulder width, you would use the joints JointType.ShoulderLeft and JointType.ShoulderRight. The get the length of the left arm, you would add the distance between JointType.ShoulderLeft and JointType.ElbowLeft to the distance between JointType.ElbowLeft and JointType.WristLeft.
Please note that the joint names above are from the Kinect for Windows SDK. On its own, OpenKinect does not provide a method for skeleton tracking, since it's specialized on accessing the device only. A popular alternative to the Kinect for Windows SDK is OpenNI.