We are attempting to retrieve district information for a number of locations.
However the Here API returns no values.
These locations are in the state of Arunachal Pradesh and Jammu & Kashmir in India.
I tested with a number of latitude/longitudes for these states. None of them return any data.
https://reverse.geocoder.ls.hereapi.com/6.2/reversegeocode.json?prox=28.2180,94.7278&mode=retrieveAreas&apiKey=XXXXXXXXXXXXXXXXXXXXXXXXXXX
Response:
{
"Response": {
"MetaInfo": {
"Timestamp": "2020-08-05T15:11:46.711+0000"
},
"View": []
}
}
Even when I choose a location from Google Maps and use that in the API call, it still returns null.
https://reverse.geocoder.ls.hereapi.com/6.2/reversegeocode.json?prox=27.083227, 93.605954&mode=retrieveAreas&apiKey=XXXXXXXXXXXXXXXXXXXXXXXXXXX
Response:
{
"Response": {
"MetaInfo": {
"Timestamp": "2020-08-05T15:11:46.711+0000"
},
"View": []
}
}
The Geocoding and Search API v7 is recommended.
https://revgeocode.search.hereapi.com/v1/revgeocode?at=28.2180%2C94.7278&lang=en-US
{
"items": [
{
"title": "Jomlo Mobuk, Arunachal Pradesh, India",
"id": "here:cm:namedplace:22803761",
"resultType": "locality",
"localityType": "city",
"address": {
"label": "Jomlo Mobuk, Arunachal Pradesh, India",
"countryCode": "IND",
"countryName": "India",
"state": "Arunachal Pradesh",
"county": "Siang",
"city": "Jomlo Mobuk",
"postalCode": "791001"
},
"position": {
"lat": 28.22394,
"lng": 94.85208
},
"distance": 0,
"mapView": {
"west": 94.72013,
"south": 28.17345,
"east": 94.9472,
"north": 28.29374
}
}
]
}
Related
I'm experiencing this weird response from the Geocoding API where, in searching for a known address, it would return the correct geocoding result for a free-text query ("q") but return an empty result for the qualified query ("qq") even though the address details are correctly compartmentalized to each field as returned by the free-text query
https://geocode.search.hereapi.com/v1/geocode?apiKey=REMOVED&in=countryCode:AUS&q=Unit+10%2F232A+MAIN+RD++MAROOCHYDORE+4558+QLD+Australia
{
"items": [
{
"title": "Main Rd, Maroochydore QLD 4558, Australia",
"id": "here:af:street:c3mXot9HjZRObEAATNdRhC",
"resultType": "street",
"address": {
"label": "Main Rd, Maroochydore QLD 4558, Australia",
"countryCode": "AUS",
"countryName": "Australia",
"state": "Queensland",
"city": "Sunshine Coast",
"district": "Maroochydore",
"street": "Main Rd",
"postalCode": "4558"
},
"position": {
"lat": -26.65569,
"lng": 153.06295
},
"mapView": {
"west": 153.05138,
"south": -26.66196,
"east": 153.07228,
"north": -26.65418
},
"scoring": {
"queryScore": 0.77,
"fieldScore": {
"country": 1.0,
"state": 1.0,
"district": 1.0,
"streets": [
1.0
],
"postalCode": 1.0
}
}
}
]
}
https://geocode.search.hereapi.com/v1/geocode?apiKey=REMOVED&in=countryCode:AUS&qq=street=MAIN+RD;district=MAROOCHYDORE;postalCode=4558;state=QLD
{
"items": []
}
How often does this inconsistent behaviour occur and what could I implement to mitigate this?
Can you please try using below request call to check whether it is returning the correct data as you expected it to be. Below works for us.
https://geocode.search.hereapi.com/v1/geocode?apiKey=xxxxx&in=countryCode:AUS&qq=country=Australia;state=Queensland;district=MAROOCHYDORE;street=MAIN RD;postalCode=4558;
There won't be inconsistency if the query would be structured. please report if you encounter such more issues. It is advisable to go from more generic to more specifc while specify the structure in the query
I am trying to understand how exactly bounding box is working, but from my tests at the moment it seems that result is returned regardless of the bounding box limits.
I tried various approaches,but it appears that either the flow is working this way or I am missing something. In short, I have tried to put in example request:
https://developer.here.com/api-explorer/rest/geocoder/latitude-longitude-by-mapview-parameter
mapview in Boston suburban area and search text which is my home address in Bulgaria - few thousand miles away from the bounding box borders. However, I still get a result-my address Geocoded correctly. Since it is out of the bounding box I was expecting either 0 results or some exception. Or there is some parameter in the Response I can use for defining outboxing-for this case that might be the Distnace because I am too far but in addresses close to borders I am not sure if that will be fine.
My URL request:
https://geocoder.api.here.com/6.2/geocode.json?searchtext=g.k.%20Krasna%20polyana%201%2022%D0%91%2C%201373%20g.k.%20Krasna%20polyana%201%2C%20Sofia&mapview=42.3902%2C-71.1293%3B42.3312%2C-71.0228&gen=9&app_id=devportal-demo-20180625&app_code=9v2BkviRwi9Ot26kp2IysQ
The result I got:
'{
"Response": {
"MetaInfo": {
"Timestamp": "2019-08-16T16:31:38.596+0000"
},
"View": [
{
"_type": "SearchResultsViewType",
"ViewId": 0,
"Result": [
{
"Relevance": 0.88,
"Distance": 7276566.3,
"MatchLevel": "houseNumber",
"MatchQuality": {
"City": 1,
"District": 0.88,
"Street": [
0.85
],
"HouseNumber": 1,
"PostalCode": 0.56
},
"MatchType": "interpolated",
"Location": {
"LocationId": "NT_i2D3cJK.runCacYakfrAxD_yIjQ",
"LocationType": "address",
"DisplayPosition": {
"Latitude": 42.69695,
"Longitude": 23.28172
},
"NavigationPosition": [
{
"Latitude": 42.69709,
"Longitude": 23.28169
}
],
"MapView": {
"TopLeft": {
"Latitude": 42.6980742,
"Longitude": 23.2801904
},
"BottomRight": {
"Latitude": 42.6958258,
"Longitude": 23.2832496
}
},
"Address": {
"Label": "жк Красна поляна 1 22Б, 1330 София, България",
"Country": "BGR",
"County": "София-град",
"City": "София",
"District": "Красна поляна",
"Street": "жк Красна поляна 1",
"HouseNumber": "22Б",
"PostalCode": "1330",
"AdditionalData": [
{
"value": "България",
"key": "CountryName"
},
{
"value": "София-град",
"key": "CountyName"
}
]
}
}
}
]
}
]
}
}'
I am expecting some standard way to catch the results out of the bounding box. Actually, it seems that either there is no clear value to count on or I am missing something about the way it works. Thanks in advance!
I think you are looking for this one:
bbox - A type of Spatial Filter. A spatial filter limits the search for any other attributes in the request.
For your example: https://geocoder.api.here.com/6.2/geocode.json?searchtext=g.k.%20Krasna%20polyana%201%2022%D0%91%2C%201373%20g.k.%20Krasna%20polyana%201%2C%20Sofia&bbox=42.3902%2C-71.1293%3B42.3312%2C-71.0228&&app_id=yyy&app_code=xxx
I am using below code to get the address information and i am getting entire address. But i only need county for the given city and zip of USA. Please help
function getCounty()
{
$.ajax({
url: 'https://geocoder.api.here.com/6.2/geocode.json',
type: 'GET',
dataType: 'jsonp',
jsonp: 'jsoncallback',
data: {
city: 'Farmington',
postalcode: '48335',
country: 'usa',
app_id: '**************************',
app_code: '************************',
gen: '9'
},
success: function (data) {
alert(JSON.stringify(data));
}
});
}
Please try below code to access County attribute of the response.
Hope this help.
alert(data.Response.View[0].Result[0].Location.Address.County);
And please check below full JSON response for the request.
{
"Response": {
"MetaInfo": {
"Timestamp": "2019-01-09T07:08:18.912+0000"
},
"View": [
{
"_type": "SearchResultsViewType",
"ViewId": 0,
"Result": [
{
"Relevance": 1,
"MatchLevel": "postalCode",
"MatchQuality": {
"City": 1,
"PostalCode": 1
},
"Location": {
"LocationId": "NT_9usvaftBv-o9T6WyVpnWRC",
"LocationType": "area",
"DisplayPosition": {
"Latitude": 42.47427,
"Longitude": -83.40889
},
"NavigationPosition": [
{
"Latitude": 42.47427,
"Longitude": -83.40889
}
],
"MapView": {
"TopLeft": {
"Latitude": 42.48732,
"Longitude": -83.4355
},
"BottomRight": {
"Latitude": 42.43954,
"Longitude": -83.37537
}
},
"Address": {
"Label": "48335, Farmington, MI, United States",
"Country": "USA",
"State": "MI",
"County": "Oakland",
"City": "Farmington",
"PostalCode": "48335",
"AdditionalData": [
{
"value": "United States",
"key": "CountryName"
},
{
"value": "Michigan",
"key": "StateName"
},
{
"value": "Oakland",
"key": "CountyName"
},
{
"value": "N",
"key": "PostalCodeType"
}
]
}
}
}
]
}
]
}
}
I'm currently testing with the Bargain Finder Max REST API. I'm aware that there are versions of the BFM API specifically implementing alternative dates and alternative airports, but I was wondering if there was a way to combine alternative dates and alternative airports into a single request. I've tried things like
{
"OTA_AirLowFareSearchRQ": {
"AvailableFlightsOnly": true,
"POS": {
"Source": [{
"PseudoCityCode":"F9CE",
"RequestorID": {
"Type": "1",
"ID": "1",
"CompanyName": {
"Code": "TN",
"CodeContext": "Context"
}
}
}]
},
"OriginDestinationInformation": [{
"DepartureDateTime": "2018-04-07T00:00:00",
"OriginLocation": {
"LocationCode": "DTW"
},
"DestinationLocation": {
"LocationCode": "ORD"
}
}],
"TravelerInfoSummary": {
"AirTravelerAvail": [{
"PassengerTypeQuantity": [{
"Code": "ADT",
"Quantity": 1
}]
}],
"PriceRequestInformation": {
"CurrencyCode": "USD"
}
},
"TPA_Extensions": {
"IntelliSellTransaction": {
"RequestType": {
"Name": "AD1"
}
}
}
}
}
But this only returns alternate dates for DTW -> ORD, the original origin and destination airports.
I'm also trying to figure out how to get more results with the alternative date BFM API. Running the query
{
"OTA_AirLowFareSearchRQ": {
"AvailableFlightsOnly": true,
"POS": {
"Source": [{
"PseudoCityCode":"F9CE",
"RequestorID": {
"Type": "1",
"ID": "1",
"CompanyName": {
"Code": "TN",
"CodeContext": "Context"
}
}
}]
},
"OriginDestinationInformation": [{
"DepartureDateTime": "2018-04-07T00:00:00",
"OriginLocation": {
"LocationCode": "DTW"
},
"DestinationLocation": {
"LocationCode": "ORD"
}
}],
"TravelPreferences": {
"TPA_Extensions": {
"NumTrips": {
"Number": 100
}
}
},
"TravelerInfoSummary": {
"AirTravelerAvail": [{
"PassengerTypeQuantity": [{
"Code": "ADT",
"Quantity": 1
}]
}],
"PriceRequestInformation": {
"CurrencyCode": "USD"
}
},
"TPA_Extensions": {
"IntelliSellTransaction": {
"RequestType": {
"Name": "AD1"
}
}
}
}
}
But this only returns one itinerary per day.
Could anyone help me with these issues? Thanks kindly in advance!
When doing BFM you have different qualifiers that may help with searching for alternate airports, like AlternateAirportCities or SisterDestinationLocation, but these don't seem to be enabled for BFM Alternate Dates.
Instead, what you may use instead of the airport codes, is the actual city where it present. In your example you go from Detroit (DTW) to Chicago (ORD), but if you change, for example, the destination to Chicago city (CHI) you can get CHICAGO OHARE (ORD) as well as CHICAGO MIDWAY (MDW).
A few examples:
LON instead of LHR, LCY, LGW
NYC instead of JFK, LGA, EWR
PAR instead of CDG, ORY
MOW instead of DME, SVO, VKO
BUE instead of EZE, AEP
WAS instead of DCA, IAD
I am developing a website by using ASP.NET and I use Oauth feature to register users to my website. I downloaded DontNetOpenOauth from nuget packages for the Visual studio 2013.
Up to now I implemented facebook authentication. I hope to use google authentication as well. But when I go to there website it says that.
"OpenID2 for Google accounts is going away on April 20, 2015."
When I go to detail page of this warning it says
"Some applications and websites use OpenID 2.0 for authentication when you're signing in, and to access data that you've given them permission to access. Starting April 20, 2015, OpenID 2.0 will no longer work for Google Accounts.
If you've seen a warning that's brought you to this page, it means that you're using an application or website with OpenID 2.0 and may be affected by this change. For more information, we recommend you visit that application's help center, or contact its support team."
Here is the link.
https://support.google.com/accounts/answer/6135882
Honest with you guys I am not familiar with this oauth authentication process.
What is this warning message? Do I need to worry about this? Is there any changes should I need to do or any packages should I need to install?
No you don't need to worry, it just means that developers # Stackoverflow will have to change their code a little bit but it should work fine.
EDIT:
You have to change your code from OpenID to OAuth 2 use http://developers.google.com/accounts/docs/OAuth2WebServer with a minimal scope developers.google.com/+/api/oauth#login-scopes which is profile and from that profile you can determine which user is that and log them in
You don't have to save the token returned because you won't be needing it again until the next login which you will be automatically handed the new or same token by Goole
My Advice is to use the ID can be found using this document
{
"kind": "plus#person",
"etag": "\"RqKWnRU4WW46-6W3rWhLR9iFZQM/hGBwxYeYt07li9hNmxa2J7GE_0c\"",
"nickname": "GreYFoX",
"occupation": "Computer Engineer",
"skills": "iOS Developement, Android Developement",
"birthday": "0000-09-20",
"gender": "male",
"emails": [
{
"value": "##^$%#^##gmail.com",
"type": "account"
}
],
"urls": [
{
"value": "http://www.myspace.com/Shereef",
"type": "otherProfile",
"label": "Shereef"
},
{
"value": "http://Shereefz.spaces.live.com",
"type": "otherProfile",
"label": "shereefz"
},
{
"value": "http://www.plaxo.com/profile/showPublic/Shereef",
"type": "otherProfile",
"label": "shereef"
},
{
"value": "http://cid-c74ed9e76d675051.profile.live.com",
"type": "otherProfile",
"label": "#&#$%&##%^$#live.com"
},
{
"value": "http://www.plaxo.com/profile/showPublic/null",
"type": "otherProfile",
"label": "null"
},
{
"value": "http://pulse.yahoo.com/_VMZ2QYN3AWG57HS5IUW4T2KHRM",
"type": "otherProfile",
"label": "Shereef Marzouk"
},
{
"value": "http://about.me/Shereef",
"type": "otherProfile",
"label": "About.me"
},
{
"value": "http://www.youtube.com/user/Shereefz",
"type": "otherProfile",
"label": "Shereef Marzouk"
},
{
"value": "http://www.youtube.com/user/Shereefz",
"type": "otherProfile",
"label": "Shereef Marzouk"
},
{
"value": "http://www.myspace.com/Shereef",
"type": "otherProfile",
"label": "Shereef"
},
{
"value": "http://Shereefz.spaces.live.com",
"type": "otherProfile",
"label": "shereefz"
},
{
"value": "http://profiles.google.com/17F648F7-5C7D-42D4-A40F-CAC12280C712",
"type": "otherProfile",
"label": "SheefoPad"
},
{
"value": "http://www.youtube.com/user/Shereefz",
"type": "otherProfile",
"label": "Shereef Marzouk"
},
{
"value": "http://Shereefz.spaces.live.com",
"type": "otherProfile",
"label": "shereefz"
},
{
"value": "http://www.myspace.com/Shereef",
"type": "otherProfile",
"label": "Shereef"
},
{
"value": "http://profiles.google.com/17F648F7-5C7D-42D4-A40F-CAC12280C712",
"type": "otherProfile",
"label": "SheefoPad"
},
{
"value": "https://profiles.google.com/104183538590490028018/buzz",
"type": "contributor",
"label": "Buzz"
},
{
"value": "https://developers.google.com/groups/chapter/103706763079402130148/",
"type": "contributor",
"label": "GDG Alexandria (Google Developers Group Alexandria)"
},
{
"value": "http://www.shereef.net",
"type": "contributor",
"label": "Shereef"
},
{
"value": "http://shereef.net/resume",
"type": "other",
"label": "Resume"
},
{
"value": "http://shereef.net/blog",
"type": "other",
"label": "Blogger"
},
{
"value": "http://about.me/shereef",
"type": "other",
"label": "About.me"
},
{
"value": "http://pulse.yahoo.com/sheefoz",
"type": "other",
"label": "sheefoz"
},
{
"value": "http://facebook.com/Shereefz",
"type": "other",
"label": "shereefz"
},
{
"value": "http://www.linkedin.com/in/shereef",
"type": "other",
"label": "shereef"
}
],
"objectType": "person",
"id": "104183538590490028018",
"displayName": "Shereef Marzouk",
"name": {
"familyName": "Marzouk",
"givenName": "Shereef"
},
"tagline": "Senior Mobile Developer / Team lead at X Digital Group",
"braggingRights": "XDG Hero",
"aboutMe": "<span>Shereef Marzouk is an Egyptian mobile applications developer who enjoys his work very much, with many years of experience of development in mobile and general development, Shereef also loves helping people and love sharing, He also develops free-lance applications under his personal company name Tools Era (ToolsEra), Shereef is an Egyptian with his own cultural views and politic, Shereef is not your typical Egyptian nor Developer.</span>",
"relationshipStatus": "engaged",
"url": "https://plus.google.com/+ShereefMarzouk",
"image": {
"url": "https://lh3.googleusercontent.com/-P9UMptk6e5U/AAAAAAAAAAI/AAAAAAAFzp0/v3ArGL-l8Tg/photo.jpg?sz=50",
"isDefault": false
},
"organizations": [
{
"name": "Alexandria Higher Institute of Engineering and Technology",
"title": "Computer Engineering",
"type": "school",
"startDate": "2005",
"endDate": "2011",
"primary": false
},
{
"name": "English Lycee Liberity",
"title": "School",
"type": "school",
"startDate": "1994",
"endDate": "2004",
"primary": false
},
{
"name": "Sidi Gaber Language School",
"title": "K.G.",
"type": "school",
"startDate": "1992",
"endDate": "1994",
"primary": false
},
{
"name": "X Digital Group",
"title": "Senior Mobile Developer / Team Lead",
"type": "work",
"startDate": "2012",
"primary": true
},
{
"name": "X Digital Group",
"title": "Interactive Touch Screen and Mobile Core Developer",
"type": "work",
"startDate": "2012",
"endDate": "2013",
"primary": false
},
{
"name": "Health-Insights",
"title": "Android / iOS / C#.NET Developer",
"type": "work",
"startDate": "2011",
"endDate": "2012",
"primary": false
}
],
"placesLived": [
{
"value": "Alexandria, Egypt",
"primary": true
},
{
"value": "KSA"
},
{
"value": "Lybia"
},
{
"value": "Egypt"
},
{
"value": "Qatar"
}
],
"isPlusUser": true,
"language": "en",
"ageRange": {
"min": 21
},
"circledByCount": 707,
"verified": false,
"cover": {
"layout": "banner",
"coverPhoto": {
"url": "https://lh3.googleusercontent.com/-kp8ALVVOa1o/U-Bo2sjE9GI/AAAAAAAFkaA/PWKY2q2e9lY/s630-fcrop64=1,0000208effb2f94e/_MG_0344-SMILE.jpg",
"height": 626,
"width": 940
},
"coverInfo": {
"topImageOffset": -294,
"leftImageOffset": 0
}
}
}
search for "id": "104183538590490028018" in the json i pasted here
P.S. Open all links in this answer because they will benefit you.
Also remember when requesting profile to use the id as me because you won't have the logging in user profile