coordinates

Cities/Province/Cantons list with coords?

五迷三道 提交于 2020-01-05 02:31:09
问题 where can I get a list of that? I need the coords of the distrits and cantons of Costa Rica, is there a place to get those? thanks in advance 回答1: geonames.org is a public database of all cities/towns with a population over 1000. The data for each city includes geo coordinates and administrative division, which I believe would be your districts, provinces or cantons. 回答2: Check out the Costa Rica link here - it may suit your needs. I found it with this search: http://www.bing.com/search?q=

Check if coordinates is within a specific distance from other coordinates

試著忘記壹切 提交于 2020-01-04 17:54:32
问题 Ok, so I have a target on certain coordinates, and some 'persons' on other coordinates, and I want to check if the persons coordinates is within a 2km (2000m) distance from the target coordinates. The code below is just to illustrate what I want more clear, and the question is of course how could this be done? I would really appreciate a solution to this one, thanks! $person0 = Array('56.34342', '49.324523'); $person1 = Array('57.49544', '47.421524'); $person2 = Array('56.74612', '48.722323')

Calculate distance between two coordinates on a globe

﹥>﹥吖頭↗ 提交于 2020-01-04 01:36:15
问题 I get two coordinate pairs in the form 90°0′0″N 0°0′0″E as string and want to calculate the distance between those points on a sphere with radius R=6371km. I found two formulas on the internet here, the "haversine" and the "spherical law of cosines", but they don't seem to work. For a 90° angle which should return 2*pi*R / 4 , the haversine operates correct but the cosines fail and return 0. A different point with more random coordinates returns false values with both algorithms: the

Unprecise rendering of huge WPF visuals - any solutions?

左心房为你撑大大i 提交于 2020-01-03 17:19:32
问题 When rendering huge visuals in WPF, the visual gets distorted and more distorted with increasing coordinates. I assume that it has something to do with the floating point data types used in the render pipeline, but I'm not completely sure. Either way, I'm searching for a practical solution to solve the problem. To demonstrate what I'm talking about, I created a sample application which just contains a custom control embedded in a ScrollViewer that draws a sine curve. You can see here that the

Show converted mouse coordinates of an element with javascript

左心房为你撑大大i 提交于 2020-01-03 03:24:28
问题 I'd like to show a mouse tooltip like this: with a coordinate system relative to its image. Whenever the mouse is hovered over one of the 75x75 cells, the position is displayed in text. I can only show the mouse's raw coordinates, but can't figure out the math to display it like it is in the picture. I'm open to HTML5 implementations as well. 回答1: Here’s how to convert mouse coordinates to cell coordinates and display a tooltip This math calculates which 75x75 cell your mouse is inside: var

Mapping google maps coordinate from a javascript variable

巧了我就是萌 提交于 2020-01-03 03:13:11
问题 I can successfully generate a google map with the code below: var myLatlng = new google.maps.LatLng(37.77493, -122.419415); var myOptions = { zoom: 15, center: myLatlng, mapTypeId: google.maps.MapTypeId.ROADMAP } var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); However when I try to do it with the block of code below (storing the coordinate in a variable). The map comes up as all blue, with or with out the replace function. var coordinate = "37.77493,-122

Getting new position of a line after rotation

穿精又带淫゛_ 提交于 2020-01-02 05:06:06
问题 I need to find out new coordinates of line after rotation using RotateTransform method on a line. For example, after this line: line.RenderTransform = new RotateTransform(25, 0, 0); line.X1 and the three other properties don't change. I have found some solution for shapes like rectangular, but it doesn't work for line. Line has different way how to treat with it. EDIT: Thanks for your help H.B. The second way is exactly what I've been looking for. SOLUTION: Line line = new Line(); line.X1 =

How to convert a rotated NetCDF back to a normal lat/lon grid?

妖精的绣舞 提交于 2020-01-02 04:57:07
问题 I have a NetCDF file with rotated coordinates. I need to convert it to normal lat/lon coordinates (-180 to 180 for lon and -90 to 90 for lat). library(ncdf4) nc_open('dat.nf') For the dimensions, it shows: [1] " 5 variables (excluding dimension variables):" [1] " double time_bnds[bnds,time] " [1] " double lon[rlon,rlat] " [1] " long_name: longitude" [1] " units: degrees_east" [1] " double lat[rlon,rlat] " [1] " long_name: latitude" [1] " units: degrees_north" [1] " char rotated_pole[] " [1] "

Ruby two dimensional array: finding an object's coordinates

时光怂恿深爱的人放手 提交于 2020-01-01 15:55:54
问题 Assume, I have a two dimensional array A , and it's stated that somewhere inside it there's an object my_element . What's the quickest way to find out its coordinates? I am using Ruby 1.8.6. 回答1: This is one way. I'm not sure it's the quickest, though. class Array def coordinates(element) each_with_index do |subarray, i| j = subarray.index(element) return i, j if j end nil end end array = [ [1, 2, 3], [4, 5, 6], [7, 8, 9] ] array.coordinates(3) # => [0, 2] array.coordinates(9) # => [2, 2]

Convert unknown Hex digits to a Longitude and Latitude

╄→гoц情女王★ 提交于 2020-01-01 15:11:34
问题 F3 c8 42 14 - latitude //05.13637° should be nearby this coordinate 5d a4 40 b2 - longitude //100.47629° should be nearby this coordinate this is the hex data i get from GPS device, how to convert to readable coordinate? i don't have any manual document.please help.thanks 22 00 08 00 c3 80 00 20 00 dc f3 c8 42 14 5d a4 40 b2 74 5d 34 4e 52 30 39 47 30 35 31 36 34 00 00 00 this is my full bytes i received,but the engineer told me that F3 c8 42 14 is latitude and 5d a4 40 b2 is longitude 回答1: I