geocoding

Show closest result of a Geocoder on map

穿精又带淫゛_ 提交于 2019-12-24 14:08:01
问题 I've been stuck on the problem. i'm searching for Tesco stores in this geocoder. Is there anyway way of getting only the closest result of the geo.getFromLocationName? private void setUpMap() throws IOException { Geocoder geo = new Geocoder(getApplicationContext(), Locale.getDefault()); List<Address> addressList= geo.getFromLocationName("Tesco",1); Address add = addressList.get(0); String locality = add.getLocality(); double lat = addressList.get(0).getLatitude(); double lng = addressList.get

Java function that accepts address and returns longitude and latitude coordinates

浪子不回头ぞ 提交于 2019-12-24 13:25:07
问题 I am looking for a simple java function that can accept an address and return the longitude and latitude coordinates for that address. Based on my research this is what i found thus far: I am abit unsure how to implements this. I am not sure what order i will need to call the different methods. E.g. would i have to do this? : String address = 'Some Place, Venezuela'; Geocoder geo = new Geocoder(); String url = geo.encode(address); String encodeUrl = geo.urlEncode(url); GLatLng latLng = geo

Google Geocoding - custom marker does not appear

无人久伴 提交于 2019-12-24 13:10:15
问题 I am trying to use the Google Maps API with Geo-coding. The marker's appear in the needed location but only red icon appear, as if the function ignores the icon parameter. Note, I have the same code without Geo-coding and the marker icon's appear as they should, the issue exists only with Geo-coding. Here the code: <!DOCTYPE html> <html> <head> <title>Simple Map</title> <meta name="viewport" content="initial-scale=1.0, user-scalable=no"> <meta charset="utf-8"> <style> html, body, #map-canvas

Google Maps API Key Error

我是研究僧i 提交于 2019-12-24 11:44:17
问题 I'm trying to connect my PHP script to the google maps API using CURL it connects fine but when i pass the API key it says that it is not valid, below is some of the code I'm using to get stats... <?php $url = 'https://maps.google.com/maps/api/geocode/json?address={ADDRESS}&sensor=false&key={MY_KEY}'; $cURL = curl_init(); curl_setopt($cURL, CURLOPT_URL, $url); curl_setopt($cURL, CURLOPT_HTTPGET, true); curl_setopt($cURL, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($cURL, CURLOPT_HTTPHEADER,

Google Batch Geocoding API

痴心易碎 提交于 2019-12-24 10:46:35
问题 I am using Google Geocoding API to conduct both forward and reverse geocoding work in my projects. While this API is only working for a single address or a single pair of geo coordinates per request, not for batch processing. I know I can copy and paste lines of addresses up to 250 to the Batch Geo Website to process, but it would be so limited and ineffectively to me if I did that. Initially, I called REST API by PHP curl in my codes, while for batch data I have no idea how to handle and I

For Loop with Google Geocoding - High Error Rate - iPhone

久未见 提交于 2019-12-24 10:13:02
问题 I am using the below code to fetch location information via Geocoding and then add a map pin to a Google Map View. The code uses a For loop to cycle through each place in my database. The problem is that the code fails to return location info for about 50% of the places when run. These failed items are saved in the failedLoad array as per the code below. Can anyone suggest why this is ? Also since these failed items are saved in the "failedLoad" array, is there a way I could use this array to

How to convert an address string to an address dictionary

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-24 04:01:14
问题 I extract addresses from text using OSX data detectors. This gives me address strings like “ 1 Infinite Loop, Cupertino, CA ”. In order to put such addresses into the OSX address book, I have to convert them to a dictionary with keys like " Street ", " City ", " Country " etc. I know that there is a function that does the reverse: ABCreateStringWithAddressDictionary(...) , but I need it the other way. The only way I know this can be done (and is, of course, total overkill) is to send the

Why do I get “map.set_center is not a function”?

a 夏天 提交于 2019-12-24 03:44:15
问题 This code have been working until I updated last night. The code works perfectly on my localhost, but I get an error on my test server. The error message (from Firebug) is "map.set_center is not a function" . So why is this not working on my server any more? function googleMapInit() { if (jQuery('#map_canvas').length > 0) { var currentLocation = jQuery('#geomap_ddlCity :selected').text() + ', ' + jQuery('#geomap_ddlCountry :selected').text(); var options = {zoom: 14, mapTypeId: google.maps

Google Geocoding, Asynchronous Javascript, not working [duplicate]

霸气de小男生 提交于 2019-12-24 00:44:21
问题 This question already has answers here : How to return value from an asynchronous callback function? [duplicate] (3 answers) Closed 5 years ago . I have a function, in an external .js file which is supposed to take address string and then return latitude and longitude. It returns nothing. Can someone help please? I also would like to ask; in javascript, when you call an async function from within another function; does the async function terminate as soon as the outside function terminates?

improving query times a sql ip lookup database

霸气de小男生 提交于 2019-12-23 17:17:26
问题 I have a table in sql server 2005 which holds an ip range and the corresponding info (country / city / etc). There are approximately 3 million rows and it currently takes just over half a second to return a record based on the query below. DECLARE @ip BIGINT SELECT @ip=3561360969 SELECT TOP 1 id, ipfrom, ipto, countrycode, countryname,region,city FROM tbl_ip WHERE ipfrom <= @ip and @ip <= ipto Can anyone offer any suggestions to improve the query time as the system I'm building needs to