geolocation

Android geopoint from location/locality

送分小仙女□ 提交于 2020-01-02 06:34:10
问题 I have seen numerous examples of getting location name from Geocoder and then get addresses by getFromLocation() but how can I get geoPoint for a location by name. User enters a city name and I turn them into a geopoint and show on map. Is there a way in Android or google API's. I dont mean current location but any location by giving its name. Basically I want it to allow user to get weather update for remote cities.I am able to do so for current location by getting current locality. 回答1: Try

how to send data to server in android [duplicate]

*爱你&永不变心* 提交于 2020-01-02 05:15:43
问题 This question already has answers here : How to send a data to a web server from Android (3 answers) Closed 3 years ago . I want to send latitude and longitude cyclically in my app. This is the function which get this parameters using GPS private void showLocation(Location location) { String latitude = "Latitude: "; String longitude = "Longitude: "; if (location != null) { latitude += location.getLatitude(); longitude += location.getLongitude(); } } I was looking methods in the web, I found

how to send data to server in android [duplicate]

邮差的信 提交于 2020-01-02 05:15:10
问题 This question already has answers here : How to send a data to a web server from Android (3 answers) Closed 3 years ago . I want to send latitude and longitude cyclically in my app. This is the function which get this parameters using GPS private void showLocation(Location location) { String latitude = "Latitude: "; String longitude = "Longitude: "; if (location != null) { latitude += location.getLatitude(); longitude += location.getLongitude(); } } I was looking methods in the web, I found

Earth Latitude & Longitude to Latitude & Longitude on a 3D sphere

流过昼夜 提交于 2020-01-01 19:07:20
问题 I have never done this sort of thing before,but what I am doing is making a 3D sphere (which has earth like texture) like shape where I want to plot locations onto it using the latitude and longitude from google maps of specific locations.Now I am wondering , my sphere radius is obviously smaller than earths radius, would this still effect the position of the latitude and longitude values to xyz given the following formula: tx = radiusOfSphere * cos(latitude) * cos(longitude); ty =

Find all nearby customers within a given distance using longitude and latitude

别说谁变了你拦得住时间么 提交于 2020-01-01 16:53:32
问题 I have a db contain customers longitude and latitude, I have a search form in which the user will enter log/lat and distance dropdown contain 50miles, 100miles,.... and when the user click search I want to write a linq query to get all customers from the db which are in this distance radius. How to make this using C# and linq? Update: I found this https://stackoverflow.com/a/1654365/20126 but this gives a square not radius 回答1: A little modification of my answer to a similar question: //

How to randomly select a point on the surface of the Earth?

主宰稳场 提交于 2020-01-01 16:50:34
问题 As the title says, how to randomly select a coordinate on the surface of the Earth without bias? The simple solution of doing rand(-90,90),rand(-180,180) will favor polar regions over equatorial regions. 回答1: It sounds like you're looking for a uniform random distribution on a sphere. In spherical coordinates: θ = 2π * rand(0,1) Φ = arccos(1 - 2*rand(0,1)) 回答2: Archimedes proved a nifty theorem that the area of a region on a sphere is equal to the area of the horizontal projection of that

How to calculate distance between 2 coordinates below a certain threshold in R?

旧街凉风 提交于 2020-01-01 12:26:07
问题 I have 44,000 US Zip codes and it's corresponding centroid lat/long in R. This is from the package 'zipcode' in R. I need to calculate the distance between each zipcode and keep those distances that are less than 5 miles. The problem is to calculate all distances between the zipcodes I have to create a vector of size 44,000x44,0000 which I can't due to space issues. I checked through the posts in R, the closest to my requirement is one that spits out the minimum distance between 2 datasets

Meteor.js reactive html5 geolocation position.coords

此生再无相见时 提交于 2020-01-01 09:43:36
问题 I'm a meteor.js nuub, but I did spend quite a bit of time trying to figure this one out. I'm trying to reactively update my UI based on the HTML5 geolocation API callback passed into getCurrentPosition. However, the UI is not updating with my current code. Can you offer suggestions and/or a solution? Here are the details: Basics: meteor server is running, serving other data to/from mongo via collections successfully I have a main page (main.html): <head> <title>Geolocation</title> </head>

Allowing location access inside UIWebView

こ雲淡風輕ζ 提交于 2020-01-01 09:30:32
问题 I have a webview based application and when I access http://maps.google.com, my webview is not passing the location as Safari does. I know CLLocationManager is needed, but do I get a callback when a webpage (maps.google.com) wants access to my device location? How do I respond back with the coordinates to the webpage from my WebView? 回答1: The webview will start monitoring the location automatically, however since iOS 8 location access requires the NSLocationWhenInUseUsageDescription

getFromLocationName error, Service not available. Have been working, stopped

喜你入骨 提交于 2020-01-01 09:21:43
问题 In my app I am using the getFromLocationName, and it has been working in the app until recently, now all of a sudden I am getting is "Service not available". The exception says: Geocoder.getFromLocationName(Geocoder.java:178) This is the code I am using: Geocoder coder = new Geocoder(this); List<Address> address = null; try { address = coder.getFromLocationName(navAddr,5); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } To be honest I do not know if has