coordinates

Power BI - Find closest location based on Lat/Lng

♀尐吖头ヾ 提交于 2019-12-01 22:36:32
问题 I am new to Power BI and DAX, so I hope you can help me. I have two tables without any relationship: Table A contains lat/lng and date of tracked positions. Table B contains lat/lng and names of all stadiums. I want to find the closest stadium near the tracked position. Also if possible I want to validate, if the position was in a specific radius of that stadium. Any help greatly appreciated. 回答1: Here's one possible approach: First, calculate the minimal distance using the Haversine function

How to find the nearest points to given coordinates with MATLAB?

孤街醉人 提交于 2019-12-01 22:26:07
问题 I need to solve a minimization problem with Matlab and I'm wondering which is the easiest solution. All the potential solutions that I've been thinking in require lot of programming effort. Suppose that I have a lat/long coordinate point (A,B), what I need is to search for the nearest point to this one in a map of lat/lon coordinates. In particular, the latitude and longitude arrays are two matrices of 2030x1354 elements (1km distance) and the idea is to find the unique indexes in those

Power BI - Find closest location based on Lat/Lng

瘦欲@ 提交于 2019-12-01 21:37:01
I am new to Power BI and DAX, so I hope you can help me. I have two tables without any relationship: Table A contains lat/lng and date of tracked positions. Table B contains lat/lng and names of all stadiums. I want to find the closest stadium near the tracked position. Also if possible I want to validate, if the position was in a specific radius of that stadium. Any help greatly appreciated. Here's one possible approach: First, calculate the minimal distance using the Haversine function. Add this as a calculated column to your Tracked table. Nearest = MINX(Stadiums, ROUND(2 * 3959 * ASIN(SQRT

How to get an array of coordinates that make up a circle in canvas?

会有一股神秘感。 提交于 2019-12-01 21:15:55
So, if this is the code I'm using to draw a circle on my canvas: ctx.beginPath(); ctx.arc(centerX, centerY, radius, 0, 2 * Math.PI, false); ctx.lineWidth = 3; ctx.strokeStyle = "black"; ctx.stroke(); ... how could I get an array of coordinates of the points that make up this circle so I can save them in a database and load on canvas later using the context.moveTo() and context.lineTo() methods to connect the dots, drawing the same circle? I guess I'm asking if it's possible to draw this kind of circle using not .arc() method but by connecting dots with lines, if I only know my center

Matching degree-based geographical coordinates with a regular expression

此生再无相见时 提交于 2019-12-01 20:41:13
I'd like to be able to identify patterns of the form 28°44'30"N., 33°12'36"E. Here's what I have so far: use utf8; qr{ (?: \d{1,3} \s* ° \s* \d{1,2} \s* ' \s* \d{1,2} \s* " \s* [ENSW] \s* \.? \s* ,? \s* ){2} }x; Needless to say, this doesn't match. Does it have anything to do with the extended characters (namely the degree symbol)? Or am I just screwing this up big time? I'd also appreciate directions to CPAN , if you know of something there that will solve my problem. I've looked at Regex::Common and Geo::Formatter , but none of these do what I want. Any ideas? Update It turns out that I

How to get the LatLngBounds of a Circle in Google maps given its center and radius?

♀尐吖头ヾ 提交于 2019-12-01 17:42:39
How can I get the Northeast and Southwest coordinates of a Circle with a given center and radius? I can't find any solution anywhere. Currently, the Circle object doesn't have getLatLngBounds() nor getBounds() methods unlike before. You can use the SphericalUtil.computeOffset method from the Google Maps Android API Utility Library . To use it you need to the following dependency to your build.gradle : dependencies { compile 'com.google.maps.android:android-maps-utils:0.4+' } Then, you can calculate the northeast and southwest coordinates of your circle doing: double radius = 104.52; LatLng

How to get the LatLngBounds of a Circle in Google maps given its center and radius?

偶尔善良 提交于 2019-12-01 17:24:37
问题 How can I get the Northeast and Southwest coordinates of a Circle with a given center and radius? I can't find any solution anywhere. Currently, the Circle object doesn't have getLatLngBounds() nor getBounds() methods unlike before. 回答1: You can use the SphericalUtil.computeOffset method from the Google Maps Android API Utility Library. To use it you need to the following dependency to your build.gradle : dependencies { compile 'com.google.maps.android:android-maps-utils:0.4+' } Then, you can

How to get cardinal mouse direction from mouse coordinates

故事扮演 提交于 2019-12-01 17:23:35
is it possible to get the mouse direction (Left, Right, Up, Down) based on mouse last position and current position? I have written the code to calculate the angle between two vectors but I am not sure if it is right. Can someone please point me to the right direction? public enum Direction { Left = 0, Right = 1, Down = 2, Up = 3 } private int lastX; private int lastY; private Direction direction; private void Form1_MouseDown(object sender, MouseEventArgs e) { lastX = e.X; lastY = e.Y; } private void Form1_MouseMove(object sender, MouseEventArgs e) { double angle = GetAngleBetweenVectors(lastX

Create buffer and count points in R

醉酒当歌 提交于 2019-12-01 14:57:13
I asked this question previously but did not get a response, so I'll try and do a better job this time around! I want to analyze spatial density of gas station points using R. I need to create a buffer (let's say 1,000m) around the gas stations and count the number of gas stations within the buffer. I'll then need to play around with buffer distances to see what's a reasonable buffer to see something interesting. I won't post the entire shape file because it's fairly messy, but this is what the data look like: all <- readShapePoints("sbc_gas.shp") all.df <- as(all, "data.frame") head(all)

How do I get the mouse coordinates using mousedown in d3?

社会主义新天地 提交于 2019-12-01 14:28:55
I am trying to create a graph in D3 where you can draw a square to zoom in. Right now, I am trying to get the mousedown function to work. I need to be able to click anywhere in the graph and get the coordinates. This is what I have now: svg.on("mousedown", mousedown) function mousedown() { console.log(event.clientX); } I know this is not correct, but I can't seem to find how I can access the mouse's coordinates. firstly, you need to set up the click event properly. svg.on('mousedown', function() { console.log(d3.event); } ); in your case: svg.on('mousedown', mousedown); function mousedown() {