coordinates

Select coordinates which fall within a radius of a central point?

风格不统一 提交于 2019-12-02 17:20:47
I have a database of coordinates in the schema: ID:Latitude:Longitude:name:desc I've set up my google maps application to show the markers effectively on the screen. However I need to add another feature whereby the user can view all pointers that fall within the radius from a central point. How would I write up a sql statement of the kind: Select all pointers that fall within a 10 mile radius of X & Y The SQL below should work: SELECT * FROM Table1 a WHERE ( acos(sin(a.Latitude * 0.0175) * sin(YOUR_LATITUDE_X * 0.0175) + cos(a.Latitude * 0.0175) * cos(YOUR_LATITUDE_X * 0.0175) * cos((YOUR

Convert address to coordinates swift

匆匆过客 提交于 2019-12-02 16:50:48
How can I convert a String address to CLLocation coordinates with Swift? I have no code yet, I looked for a solution but I didn't find anyone yet. Thanks. This is pretty easy. let address = "1 Infinite Loop, Cupertino, CA 95014" let geoCoder = CLGeocoder() geoCoder.geocodeAddressString(address) { (placemarks, error) in guard let placemarks = placemarks, let location = placemarks.first?.location else { // handle no location found return } // Use your location } You will also need to add and import CoreLocation framework. You can use CLGeocoder, you can convert address(string) to coordinate and

GPS coordinates: 1km square around a point

可紊 提交于 2019-12-02 16:49:28
I was hoping someone out there could provide me with an equation to calculate a 1km square (X from a.aaa to b.bbb, Y from c.ccc to c.ccc) around a given point, say lat = 53.38292839 and lon = -6.1843984 ? I'll also need 2km, 5km and 10km squares around a point. I've tried googling around to no avail... It's late at night and was hoping someone might have quick fix handy before I delve into the trigonometry... I'll be running all this in Javascript, although any language is fine. If the world were a perfect sphere, according to basic trigonometry... Degrees of latitude have the same linear

How to calculate coordinates of third point in a triangle (2D) knowing 2 points coordinates, all lenghts and all angles [closed]

◇◆丶佛笑我妖孽 提交于 2019-12-02 16:35:02
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . I have a triangle and I know the coordinates of two vertices: A=(x1,y1),B=(x2,y2) All the angles: ABC=90∘,CAB=30∘ and BCA=60∘ and all the edge lengths. How can I find the coordinates of the third vertex C=(x3,y3)? I know there are two solutions (I want both). 回答1: You know p1 and p2. You know the internal angles

How to name the coordinates (points) in Java Swing

爷,独闯天下 提交于 2019-12-02 15:50:56
问题 I'm designing an interface using java swing. There is a canvas for the user to draw shapes (circle, triangle, square, etc.). When the user draws a shape, I want to name each point in the shape alphabetically. I know how to get the coordinates but how do I name the points? 回答1: Here is one way to do it. You use Character.toString(char) and use 'A'+offset to get any char from the alphabet. See in this small demo example, which draws polygons. Single click creates vertices of your polygon Double

Python, two dimensional list and coordinates

对着背影说爱祢 提交于 2019-12-02 15:01:39
问题 I have a two dimensional list: def list(): list1 =[1,2,3,4,5] list2 =[0,0,0,0,0] list3 =[6,7,8,9,10] list=[list1,list2,list3] for i in list: print(i) list() 6 will have the coordinates (0,2), right?? I want to move 6 to (0,1) and when I do that, I also want (0,2) to become 0. How do I do that? I have no idea.. I'm a beginner at this. 回答1: Just assign directly to those two index pairs, indexing from the outer list to the inner (the last list is 2 , the middle list is 1 ), so the first element

Plotting a list of (x, y) coordinates in python matplotlib

随声附和 提交于 2019-12-02 14:05:53
I have a list of pairs (a, b) that I would like to plot with matplotlib in python as actual x-y coordinates. Currently, it is making two plots, where the index of the list gives the x-coordinate, and the first plot's y values are the a s in the pairs and the second plot's y values are the b s in the pairs. To clarify, my data looks like this: li = [(a,b), (c,d), ... , (t, u)] I want to do a one-liner that just calls plt.plot() incorrect. If I didn't require a one-liner I could trivially do: xs = [x[0] for x in li] ys = [x[1] for x in li] plt.plot(xs, ys) How can I get matplotlib to plot these

Matrix transforms; concepts and theory, are there any free resources for learning practically? [closed]

时光毁灭记忆、已成空白 提交于 2019-12-02 14:05:10
I've been having fun rendering charts and graphs from co-ordinates lately, and I'm fascinated by using matrices to transform co-ordinate spaces. I've been able to successfully scale and invert 2 dimensional co-ordinate spaces, but now my appetite is whetted. :) Where can I go for clear, informative, (free), educational material on matrices, matrix math, especially as applies to 2 and 3 dimensional space? ilya n. Original answer: I'm not sure if you will like how mathematical courses typically introduce matrices. As a programmer you might be happier with grabbing any decent 3D graphics book. It

Covering Earth with Hexagonal Map Tiles

▼魔方 西西 提交于 2019-12-02 13:56:45
Many strategy games use hexagonal tiles. One of the main advantages is that the distance between the center of any tile and all its neighboring tiles is the same. I was wondering if anyone has any thoughts on marrying a hexagonal tile system with the traditional geographic system (longitude/latitude). I think it would be interesting to cover a globe with hexagonal tiles and be able to map a geographic coordinate to a tile. Has anyone seen anything remotely close to this before? UPDATE I'm looking for a way to subdivide the surface of a sphere so that each division has the same surface area.

Store details of a binary image consisting simple polygons

帅比萌擦擦* 提交于 2019-12-02 13:25:58
This question relates to somewhat practice and experienced based process. I have an Mat binary image which consist of simple white color polygons in a black background. Actually those polygons represent an article in a newspaper page. So what I want is to store the details of the location of the article inside the newspaper page. One Mat image has only one polygon in it. So one option is to Use pure OpenCV calls to store Mat into a .xml or .yml file ( How to write a Float Mat to a file in OpenCV : accepted answer) Find the coordinates of the polygon where there are vertices and store only