google-geocoder

Google Geocoding service returns Error 400 Bad Request

别说谁变了你拦得住时间么 提交于 2019-12-05 00:44:50
I've been trying to get a json response from google's geocoding service. I'm using PHP. I was trying with fopen, then I read in another stackoverflow question that I should use file_get_contents, but didn't worked too. Then I keep searching and found someone in another forum who said I would a better solution if I use CURL so I changed my code and is not working. In all cases I received an "Error 400: Bad Request. Your client has issued a malformed or illegal request." My code is this: $jsonUrl = "http://maps.googleapis.com/maps/api/geocode/json?address=" . $cityName . "&sensor=false";

JS Geocoder cannot assign Global Variable for Google Maps Variable

倾然丶 夕夏残阳落幕 提交于 2019-12-04 19:11:56
i have variable array 2 dimentional: var locations = new Array(3); for (var i = 0; i < 3; i++) { locations[i] = ['1', '2', '3']; } and i have array with name Place inside data = ["Terogong, Indonesia", "Blok M, Indonesia", "Cipinang, Indonesia"] when i use Geocoder to search Lat and Lang , then its fill Locations[] with name place, Lat and Lang: for (var i = 0; i < data.length-1; i++) { var c = data[i]; geocoder.geocode( { 'address': data[i] + ", indonesia"}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { //alert("location : " + results[0].geometry.location.lat() +

How do I access a JSONObject subfield?

旧城冷巷雨未停 提交于 2019-12-04 18:23:43
问题 I feel dumb but I've been looking around for this for a while. I'm working with the google geocoder API and I need a bit of help with the json responses. Here is a JSONObject that I have: { "viewport": { "southwest": { "lng": -78.9233749802915, "lat": 36.00696951970851 }, "northeast": { "lng": -78.92067701970849, "lat": 36.0096674802915 } }, "location_type": "ROOFTOP", "location": { "lng": -78.922026, "lat": 36.0083185 } } How do I pull the "location" subfields out into their own variables? I

Google geocode API returns inconclusive results

試著忘記壹切 提交于 2019-12-04 11:57:13
For some addresses that I attempt to geocode, google returns inappropriately inconclusive results. The following is an example, but it is not an isolated incident. The first returned result is the exact match, however google flags it as a "partial_match": Street address: 16160 Frederick Rd City: Gaithersburg State: MD Zip code: 20877 Link: http://maps.googleapis.com/maps/api/geocode/json?sensor=false&address=16160%20Frederick%20Rd,+Gaithersburg,+MD,+20877 My issue here is in determining which is the correct match. In this case, the "partial match" flag is not useful because it is set to "true"

is there any way to get city name for Google Place picker android

依然范特西╮ 提交于 2019-12-04 09:48:28
I am trying to get city name from Google place picker. is there any way that we can get city name using place picker API. i know we can not simply get it from API by placing place.getCity(); Below is my code. protected void onActivityResult(int requestCode, int resultCode, Intent data) { if(requestCode == REQUEST_PLACE_PICKER){ if(resultCode==RESULT_OK){ Place place = PlacePicker.getPlace(data,this); final CharSequence name = place.getName(); final CharSequence address = place.getAddress(); final CharSequence phone = place.getPhoneNumber(); final String placeId = place.getId(); final LatLng

Google Geocoding — parsing address_components that may return differently

混江龙づ霸主 提交于 2019-12-04 09:38:45
问题 I'm using Google Maps V3 api. I am submitting an address search to return the proper geocoded result including the address, name of establishment, and lat/lngs. My problem is that the response from the geocoder can be formatted differently. It always follows the same structure, but some responses use different keys for the address_components data structure. For Example, some searches result in: establishment -> location name street_number -> address street number route -> the street name

google maps over query limit

▼魔方 西西 提交于 2019-12-04 02:32:23
问题 I know that similar questions have been posted but I have not found and answer in any of them as it relates to my particular issue. I have a javascript that uses google maps to place customer zipcodes on a map. The problem I am have is similar to what others have already posted – I get a “over query limit” error. I have tried different setups using setTimeOut to try to send google the data within the allowable time intervals but I can’t get it to work. Here is my action: function initialize()

How to get only City, State, Country from lat, long in android

一笑奈何 提交于 2019-12-03 22:52:17
I have the below code to convert lat, long to human readable address. Now iam getting full details including street name. How can i get only city, state, country? I don't want anything more details. Please help me. Geocoder geoCoder = new Geocoder(getBaseContext(), Locale.getDefault()); try { List<Address> addresses = geoCoder.getFromLocation(latitude, longitude, 1); String add = ""; if (addresses.size() > 0) { for (int i=0; i<addresses.get(0).getMaxAddressLineIndex();i++) add += addresses.get(0).getAddressLine(i) + "\n"; } showToastMessage(add); } catch (IOException e1) { e1.printStackTrace()

Google geocoding API - search in just one country

情到浓时终转凉″ 提交于 2019-12-03 16:27:30
I am looking for geocodes with the google geocode-API: http://maps.googleapis.com/maps/api/geocode/json?address=london%c2+UK&sensor=false The problem is, that the input isn't very accurate (specially the street) and sometimes google mixes things up and ignores UK, because the street has a perfect match (as street and city) somewhere else. e.g. US. Now i cannot solve this issue (input data), but I am wondering if there is a parameter, which forces google to search in UK and return no result instead of a completly wrong result. jmm You can add component filters in the url to constraint results.

How do I access a JSONObject subfield?

倾然丶 夕夏残阳落幕 提交于 2019-12-03 12:05:31
I feel dumb but I've been looking around for this for a while. I'm working with the google geocoder API and I need a bit of help with the json responses. Here is a JSONObject that I have: { "viewport": { "southwest": { "lng": -78.9233749802915, "lat": 36.00696951970851 }, "northeast": { "lng": -78.92067701970849, "lat": 36.0096674802915 } }, "location_type": "ROOFTOP", "location": { "lng": -78.922026, "lat": 36.0083185 } } How do I pull the "location" subfields out into their own variables? I tried jsonObjectVariable.getString("location"); and jsonObjectVariable.getDouble() etc. but it's not