geolocation

Python module for getting latitude and longitude from the name of a US city?

五迷三道 提交于 2020-01-01 08:14:10
问题 I am looking for a python module which can take in the name of the city as the input and return the latitude and longitude of the input. 回答1: Have a look at geopy. In the "getting started" documentation it shows: >>> from geopy import geocoders >>> gn = geocoders.GeoNames() >>> print gn.geocode("Cleveland, OH 44106") (u'Cleveland, OH, US', (41.4994954, -81.6954088)) >>> gn.geocode("Cleveland, OH", exactly_one=False)[0] (u'Cleveland, OH, US', (41.4994954, -81.6954088)) 回答2: An example: from

Converting lat/long to JTS?

吃可爱长大的小学妹 提交于 2020-01-01 07:59:34
问题 I am trying to integrate hibernate spatial with JPA for Geo searches. I have been referencing the tutorial on the official site (I am not associated with hibernatespatial). The tutorial, unfortunately, does not cover how to create a Point instance from a latitude/longitude pair. I'm attempting to do this here, but I am still not sure if this is this the right way to convert a latitude/longitude pair to a JTS Point instance: import com.vividsolutions.jts.geom.Coordinate; import com

How To Deny Access To File But Allow Server

点点圈 提交于 2020-01-01 06:29:04
问题 I have a web application that has a configuration folder that houses multiple XML files that are configuration settings for multiple "portals" as you will. I need IIS to have access to them so the "portal" loads (sql connection strings, master page paths) but I want to deny any outside access (url browsing). Here's an example below: http://www.mywebsite/virtualdirectory/configurationdirectory/configfile.xml I need to restrict access to this file if you're browsing to it but still allow the

Get longtitude latitude combination based on distance and degree

感情迁移 提交于 2020-01-01 03:42:07
问题 I am trying to get geo combinations of a grid which is covered a certain area (My city). The grid is 500m * 500m. So I wanna enter starting long/latitude combination,distance (500m), degree (90 or 270) and get the next long/latitude combination. I am so unaware of mathematical formulas, and hard to find a solution. I had found some php functions that return distance in between two long/latitude combinations. http://www.zipcodeworld.com/samples/distance.php.html http://www.phpro.org/tutorials

Appcelerator Titanium Android background location service

廉价感情. 提交于 2020-01-01 03:37:07
问题 I am trying to make an app , where if the user enters a particular region, he will get an alert. And that will work even if the app is in background. I found Ti.App.iOS.backgroundService to do that for iphone but how to start the background service in android and how to present local notification kind thing when particular latitude and longitude is found. so basically my questions are :- background location service in android android equivalent for localnotification 回答1: For background geo on

Apache Cordova geolocation.watchPosition() times out on iOS when standing still

泄露秘密 提交于 2020-01-01 03:36:09
问题 When utilizing Apache Cordova's cordova-plugin-geolocation, specifically with watchPosition() I am encountering difficulties on at least iOS 8.1.3 through 8.3. What is happening is that when a user is moving, the coordinates work just fine and are continuously updating. However when the user stops for a few moments (say the timeout that is set), a timeout error is thrown. The second the user moves again the coordinates are working. We cannot increase the timeout too much for fear that users

Send user's geolocation to server every minute

我怕爱的太早我们不能终老 提交于 2020-01-01 03:34:05
问题 I'm trying to write a application that sends user's geolocation to MYSQL database every minute or so. This is the code I have right now, but it's not working. How do i need to change this to make it work? JS: <!DOCTYPE html> <html> <head> <script src="js/jquery.js"></script> </head> <body> <script> setInterval ( "onPositionUpdate()", 10000 ); function onPositionUpdate(position) { var lat = position.coords.latitude; var lng = position.coords.longitude; jQuery.ajax({ type: "POST", url: "myURL

Find the State given Latitude and Longitude Coordinates

笑着哭i 提交于 2020-01-01 03:31:08
问题 I have a set of 900 Latitude and Longitude Coordinates-- I need a relatively simple method for finding the 'State' referred to by these coordinates. If it helps, the data is in excel. 回答1: Google provide a Geocoding service. Part of this is reverse geocoding which converts geographic coordinates into a human-readable address including States. This Demo illustrates what can be done. There are limits to what you can do with this service. 回答2: Try to use the average values as provided here. With

compute geo distance in elasticsearch

落爺英雄遲暮 提交于 2020-01-01 03:13:13
问题 i am using a geo_distance filter with tire in my query and it works fine: search.filter :geo_distance, :distance => "#{request.distance}km", :location => "#{request.lat},#{request.lng}" i expected that the result would somehow include the computed distance to the geo-location that i used for my filter. is there a way to tell elasticsearch to include that in the response, so that i don't have to calculate it in ruby for every result? == UPDATE == i found the answer in a google group: search

Get a user's State with Geolocation

大兔子大兔子 提交于 2020-01-01 01:35:28
问题 What's the most efficient way to get a United States user's State? Is HTML5 Geolocation an option without needing to involve google maps? 回答1: Here's a couple of examples in JavaScript and JSON (with the help of jQuery) using both the IP lookup method (with the help of IPinfoDB) and the Geolocation API method (with the help of Google Maps API and YQL). In both examples I'm retrieving the region and country but there are several values you can choose from. Be aware these examples don't do any