I am working with HERE geocoder and found that when using strictlanguagemode=true the values returned in AlternativeAttributes are always displaying the same "Key", mixing alternative names for multiple level objects.
For example, this request:
https://geocoder.api.here.com/6.2/geocode.json?app_id=....&app_code=....&language=en&strictlanguagemode=true&country=Spain&city=Palma
returns this response (as you can see, all AlternativeAttributes use the "Key":"city", but the response is mixing alternative names for the state, county and city:
{
"Response": {
"MetaInfo": {
"Timestamp": "2019-04-16T15:50:30.385+0000"
},
"View": [
{
"_type": "SearchResultsViewType",
"ViewId": 0,
"Result": [
{
"Relevance": 1,
"MatchLevel": "city",
"MatchQuality": {
"Country": 1,
"City": 1
},
"Location": {
"LocationId": "NT_It18KKa.DRNOAE.IP7p2rD",
"LocationType": "point",
"DisplayPosition": {
"Latitude": 39.57149,
"Longitude": 2.64694
},
"NavigationPosition": [
{
"Latitude": 39.57149,
"Longitude": 2.64694
}
],
"MapView": {
"TopLeft": {
"Latitude": 39.65717,
"Longitude": 2.56391
},
"BottomRight": {
"Latitude": 39.50374,
"Longitude": 2.84777
}
},
"Address": {
"Label": "Palma, Balearic Islands, Spain",
"Country": "ESP",
"State": "Balearic Is",
"County": "Balearic Islands",
"City": "Palma",
"PostalCode": "07012",
"AlternativeAttributes": [
{
"Key": "city",
"Value": "Illes Balears",
"Type": "baseName",
"Language": "CAT"
},
{
"Key": "city",
"Value": "Balear Uharteak",
"Semantics": "exonym",
"Language": "BAQ"
},
{
"Key": "city",
"Value": "Bale\u00e1rsk\u00e9 Ostrovy",
"Semantics": "exonym",
"Language": "CZE"
},
{
"Key": "city",
"Value": "Balearerne",
"Semantics": "exonym",
"Language": "DAN"
},
{
"Key": "city",
"Value": "Balearen",
"Semantics": "exonym",
"Language": "DUT"
},
{
"Key": "city",
"Value": "Baleaarit",
"Semantics": "exonym",
"Language": "FIN"
},
{
"Key": "city",
"Value": "Iles Bal\u00e9ares",
"Semantics": "exonym",
"Language": "FRE"
},
{
"Key": "city",
"Value": "Balearische Inseln",
"Semantics": "exonym",
"Language": "GER"
},
{
"Key": "city",
"Value": "Isole Baleari",
"Semantics": "exonym",
"Language": "ITA"
},
{
"Key": "city",
"Value": "Illes Balears",
"Semantics": "exonym",
"Language": "MAY"
},
{
"Key": "city",
"Value": "Balearene",
"Semantics": "exonym",
"Language": "NOR"
},
{
"Key": "city",
"Value": "Baleary",
"Semantics": "exonym",
"Language": "POL"
},
{
"Key": "city",
"Value": "Ilhas Baleares",
"Semantics": "exonym",
"Language": "POR"
},
{
"Key": "city",
"Value": "\u0411\u0430\u043b\u0435\u0430\u0440\u0441\u043a\u0438\u0435 \u041e\u0441\u0442\u0440\u043e\u0432\u0430",
"Semantics": "exonym",
"Language": "RUS"
},
{
"Key": "city",
"Value": "Islas Baleares",
"Semantics": "exonym",
"Language": "SPA"
},
{
"Key": "city",
"Value": "Balearerna",
"Semantics": "exonym",
"Language": "SWE"
},
{
"Key": "city",
"Value": "Balearske Ostrovy",
"Semantics": "exonym",
"Language": "CZX"
},
{
"Key": "city",
"Value": "Baleary",
"Semantics": "exonym",
"Language": "POX"
},
{
"Key": "city",
"Value": "Balearskie Ostrova",
"Semantics": "exonym",
"Language": "RUX"
},
{
"Key": "city",
"Value": "Illes Balears",
"Type": "baseName",
"Language": "CAT"
},
{
"Key": "city",
"Value": "Balearen",
"Semantics": "exonym",
"Language": "DUT"
},
{
"Key": "city",
"Value": "Iles Bal\u00e9ares",
"Semantics": "exonym",
"Language": "FRE"
},
{
"Key": "city",
"Value": "Balearische Inseln",
"Semantics": "exonym",
"Language": "GER"
},
{
"Key": "city",
"Value": "Isole Baleari",
"Semantics": "exonym",
"Language": "ITA"
},
{
"Key": "city",
"Value": "Balearene",
"Semantics": "exonym",
"Language": "NOR"
},
{
"Key": "city",
"Value": "Ilhas Baleares",
"Semantics": "exonym",
"Language": "POR"
},
{
"Key": "city",
"Value": "Islas Baleares",
"Semantics": "exonym",
"Language": "SPA"
},
{
"Key": "city",
"Value": "Balearerna",
"Semantics": "exonym",
"Language": "SWE"
},
{
"Key": "city",
"Value": "Palma",
"Type": "baseName",
"Language": "CAT"
},
{
"Key": "city",
"Value": "Palma de Mallorca",
"Type": "baseName",
"Semantics": "synonym",
"Language": "CAT"
},
{
"Key": "city",
"Value": "Palma",
"Semantics": "exonym",
"Language": "BAQ"
},
{
"Key": "city",
"Value": "\u5e15\u5c14\u9a6c",
"Semantics": "exonym",
"Language": "CHI"
},
{
"Key": "city",
"Value": "Palma",
"Semantics": "exonym",
"Language": "CZE"
},
{
"Key": "city",
"Value": "Palma",
"Semantics": "exonym",
"Language": "DAN"
},
{
"Key": "city",
"Value": "Palma",
"Semantics": "exonym",
"Language": "DUT"
},
{
"Key": "city",
"Value": "Palma",
"Semantics": "exonym",
"Language": "FIN"
},
{
"Key": "city",
"Value": "Palma",
"Semantics": "exonym",
"Language": "FRE"
},
{
"Key": "city",
"Value": "Palma",
"Semantics": "exonym",
"Language": "GER"
},
{
"Key": "city",
"Value": "\u03a0\u03ac\u03bb\u03bc\u03b1",
"Semantics": "exonym",
"Language": "GRE"
},
{
"Key": "city",
"Value": "Palma",
"Semantics": "exonym",
"Language": "ITA"
},
{
"Key": "city",
"Value": "\ud314\ub9c8",
"Semantics": "exonym",
"Language": "KOR"
},
{
"Key": "city",
"Value": "Palma",
"Semantics": "exonym",
"Language": "MAY"
},
{
"Key": "city",
"Value": "Palma",
"Semantics": "exonym",
"Language": "NOR"
},
{
"Key": "city",
"Value": "Palma",
"Semantics": "exonym",
"Language": "POL"
},
{
"Key": "city",
"Value": "Palma",
"Semantics": "exonym",
"Language": "POR"
},
{
"Key": "city",
"Value": "\u041f\u0430\u043b\u044c\u043c\u0430",
"Semantics": "exonym",
"Language": "RUS"
},
{
"Key": "city",
"Value": "Palma",
"Semantics": "exonym",
"Language": "SPA"
},
{
"Key": "city",
"Value": "Palma",
"Semantics": "exonym",
"Language": "SWE"
},
{
"Key": "city",
"Value": "Palma",
"Semantics": "exonym",
"Language": "CZX"
},
{
"Key": "city",
"Value": "Palma",
"Semantics": "exonym",
"Language": "GRX"
},
{
"Key": "city",
"Value": "Palma",
"Semantics": "exonym",
"Language": "KOX"
},
{
"Key": "city",
"Value": "Palma",
"Semantics": "exonym",
"Language": "POX"
},
{
"Key": "city",
"Value": "Pa Er Ma",
"Semantics": "exonym",
"Language": "PYN"
},
{
"Key": "city",
"Value": "Pal'ma",
"Semantics": "exonym",
"Language": "RUX"
}
],
"AdditionalData": [
{
"value": "Spain",
"key": "CountryName"
},
{
"value": "Balearic Islands",
"key": "StateName"
},
{
"value": "Balearic Islands",
"key": "CountyName"
}
]
}
}
}
]
}
]
}
}
Is this a Bug in the AlternativeAttributes response?
How should we differentiate between alternative names for state, county and city in this case?
Thanks!
Geocoder API now returns exonym results with different keys which are city , country, state and county when the option strictlanguagemode set to true.
Related
I am trying to make a basic interactive chart where the user can select a country and observe a single measurement based on the height of the bar. However, prior to selecting a country, the chart shows all the bars stacked on top of each other. once a country is selected i achieve the view that i want.
{"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
"data": {
"url": "https://raw.githubusercontent.com/ConorQuah/ConorQuah.github.io/main/Happiness%26liberties_s%26e.csv"
},
"title": {
"text": "Happiness and Liberty",
"subtitle":"view the happiness of different countries. Notice how the colour of the bar changes!",
"subtitleFontStyle":"italic",
"subtitleFontSize":10,
"anchor": "start"
},
"height": 300,
"width": 300,
"transform": [{"filter": {"selection": "Region"}}],
"selection": {
"Region": {
"type": "single",
"fields": ["Country"],
"bind": {
"input": "select",
"options": [
"null",
"Finland",
"Sweden",
"New Zealand",
"United Kingdom",
"Serbia",
"Zimbabwe",
"Afghanistan"
],
"name": "Select a country"
}
}
},
"mark": {"type": "bar", "width":50},
"encoding": {
"color": {
"field": "Civil liberties",
"title": "Civil liberties",
"scale":{"scheme":"redyellowgreen", "domain":[0,60]},
"type": "quantitative"
},
"y": {
"field": "Happiness",
"scale": {"domain": [0,10]},
"type": "quantitative",
"title": "Happiness"
}
}
}
Here you go:
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"data": {
"url": "https://raw.githubusercontent.com/ConorQuah/ConorQuah.github.io/main/Happiness%26liberties_s%26e.csv"
},
"title": {
"text": "Happiness and Liberty",
"subtitle": "view the happiness of different countries. Notice how the colour of the bar changes!",
"subtitleFontStyle": "italic",
"subtitleFontSize": 10,
"anchor": "start"
},
"params": [
{
"name": "p",
"select": {"type": "point", "fields": ["Country"]},
"bind": { "name": "Country",
"input": "select",
"options": [
"Pick a Country",
"Finland",
"Sweden",
"New Zealand",
"United Kingdom",
"Serbia",
"Zimbabwe",
"Afghanistan"
]
}
}
],
"height": 300,
"width": 300,
"transform": [{"filter": "datum.Country ==p_Country"}],
"mark": {"type": "bar", "width": 50},
"encoding": {
"color": {
"field": "Civil liberties",
"title": "Civil liberties",
"scale": {"scheme": "redyellowgreen", "domain": [0, 60]},
"type": "quantitative"
},
"y": {
"field": "Happiness",
"scale": {"domain": [0, 10]},
"type": "quantitative",
"title": "Happiness"
}
}
}
This is what how the minted picture shows up I have a dApp i'm working on with wordpress. I used Enefti Theme and i used ModelTheme plugin as my NFT creator and i included their contract on my dApp, it shows that i have successfully minted the NFT, but i can't find it on my dApp even though it's confirmed on bsc scan. also, when i import it on my mobile metamask it doesn't show the photo i minted, just a blank picture.
This is the ABI of the contract (on the configure page, it requires ABI and bytecode put together but i can't paste the bytecode here):
{
"_format": "hh-sol-artifact-1",
"contractName": "NFT",
"sourceName": "contracts/NFT.sol",
"abi": [
{
"inputs": [
{
"internalType": "string",
"name": "_name",
"type": "string"
},
{
"internalType": "string",
"name": "_symbol",
"type": "string"
},
{
"internalType": "string",
"name": "_initBaseURI",
"type": "string"
},
{
"internalType": "string",
"name": "_initNotRevealedUri",
"type": "string"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "approved",
"type": "address"
},
{
"indexed": true,
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "Approval",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "operator",
"type": "address"
},
{
"indexed": false,
"internalType": "bool",
"name": "approved",
"type": "bool"
}
],
"name": "ApprovalForAll",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "from",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": true,
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
},
{
"inputs": [
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "approve",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "baseExtension",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "cost",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "getApproved",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"internalType": "address",
"name": "operator",
"type": "address"
}
],
"name": "isApprovedForAll",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "maxMintAmount",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "maxSupply",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_mintAmount",
"type": "uint256"
}
],
"name": "mint",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [],
"name": "name",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "notRevealedUri",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "ownerOf",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bool",
"name": "_state",
"type": "bool"
}
],
"name": "pause",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "paused",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "renounceOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "reveal",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "revealed",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "from",
"type": "address"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "safeTransferFrom",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "from",
"type": "address"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "_data",
"type": "bytes"
}
],
"name": "safeTransferFrom",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "operator",
"type": "address"
},
{
"internalType": "bool",
"name": "approved",
"type": "bool"
}
],
"name": "setApprovalForAll",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "_newBaseExtension",
"type": "string"
}
],
"name": "setBaseExtension",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "_newBaseURI",
"type": "string"
}
],
"name": "setBaseURI",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_newCost",
"type": "uint256"
}
],
"name": "setCost",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "string",
"name": "_notRevealedURI",
"type": "string"
}
],
"name": "setNotRevealedURI",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_newmaxMintAmount",
"type": "uint256"
}
],
"name": "setmaxMintAmount",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes4",
"name": "interfaceId",
"type": "bytes4"
}
],
"name": "supportsInterface",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "symbol",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "index",
"type": "uint256"
}
],
"name": "tokenByIndex",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"internalType": "uint256",
"name": "index",
"type": "uint256"
}
],
"name": "tokenOfOwnerByIndex",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "tokenURI",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "totalSupply",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "from",
"type": "address"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "tokenId",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_owner",
"type": "address"
}
],
"name": "walletOfOwner",
"outputs": [
{
"internalType": "uint256[]",
"name": "",
"type": "uint256[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "withdraw",
"outputs": [],
"stateMutability": "payable",
"type": "function"
}
]
}
I have a json body as below -
{
"type": "SourceUnit",
"children": [
{
"type": "PragmaDirective",
"name": "solidity",
"value": ">=0.4.22 <0.9.0"
},
{
"type": "ContractDefinition",
"name": "txorigin",
"baseContracts": [],
"subNodes": [],
"kind": "contract"
}
],
"tokens": [
{
"type": "Keyword",
"value": "pragma"
},
{
"type": "Identifier",
"value": "solidity"
},
{
"type": "Punctuator",
"value": ">="
},
{
"type": "Version",
"value": "0.4.22"
},
{
"type": "Punctuator",
"value": "<"
},
{
"type": "Version",
"value": "0.9.0"
},
{
"type": "Punctuator",
"value": ";"
},
{
"type": "Keyword",
"value": "contract"
},
{
"type": "Identifier",
"value": "txorigin"
},
{
"type": "Punctuator",
"value": "{"
},
{
"type": "type",
"value": "address"
},
{
"type": "Identifier",
"value": "owner"
},
{
"type": "Punctuator",
"value": ";"
},
{
"type": "Keyword",
"value": "constructor"
},
{
"type": "Punctuator",
"value": "("
},
{
"type": "Punctuator",
"value": ")"
},
{
"type": "Keyword",
"value": "public"
},
{
"type": "Punctuator",
"value": "{"
},
{
"type": "Identifier",
"value": "owner"
},
{
"type": "Punctuator",
"value": "="
},
{
"type": "Identifier",
"value": "msg"
},
{
"type": "Punctuator",
"value": "."
},
{
"type": "Identifier",
"value": "sender"
},
{
"type": "Punctuator",
"value": ";"
},
{
"type": "Punctuator",
"value": "}"
},
{
"type": "Keyword",
"value": "function"
},
{
"type": "Identifier",
"value": "sendTo"
},
{
"type": "Punctuator",
"value": "("
},
{
"type": "type",
"value": "address"
},
{
"type": "Identifier",
"value": "receiver"
},
{
"type": "Punctuator",
"value": ","
},
{
"type": "type",
"value": "uint"
},
{
"type": "Identifier",
"value": "amount"
},
{
"type": "Punctuator",
"value": ")"
},
{
"type": "Keyword",
"value": "public"
},
{
"type": "Punctuator",
"value": "{"
},
{
"type": "Identifier",
"value": "require"
},
{
"type": "Punctuator",
"value": "("
},
{
"type": "Identifier",
"value": "tx"
},
{
"type": "Punctuator",
"value": "."
},
{
"type": "Identifier",
"value": "origin"
},
{
"type": "Punctuator",
"value": "=="
},
{
"type": "Identifier",
"value": "owner"
},
{
"type": "Punctuator",
"value": ")"
},
{
"type": "Punctuator",
"value": ";"
},
{
"type": "Punctuator",
"value": "("
},
{
"type": "type",
"value": "bool"
},
{
"type": "Identifier",
"value": "success"
},
{
"type": "Punctuator",
"value": ","
},
{
"type": "Punctuator",
"value": ")"
},
{
"type": "Punctuator",
"value": "="
},
{
"type": "Identifier",
"value": "receiver"
},
{
"type": "Punctuator",
"value": "."
},
{
"type": "Identifier",
"value": "call"
},
{
"type": "Punctuator",
"value": "."
},
{
"type": "Identifier",
"value": "value"
},
{
"type": "Punctuator",
"value": "("
},
{
"type": "Identifier",
"value": "amount"
},
{
"type": "Punctuator",
"value": ")"
},
{
"type": "Punctuator",
"value": "("
},
{
"type": "Keyword",
"value": ""
},
{
"type": "Punctuator",
"value": ")"
},
{
"type": "Punctuator",
"value": ";"
},
{
"type": "Identifier",
"value": "require"
},
{
"type": "Punctuator",
"value": "("
},
{
"type": "Identifier",
"value": "success"
},
{
"type": "Punctuator",
"value": ")"
},
{
"type": "Punctuator",
"value": ";"
},
{
"type": "Punctuator",
"value": "}"
},
{
"type": "Punctuator",
"value": "}"
},
{
"type": "Keyword",
"value": "<EOF>"
}
]
}
whenever any code executes, I want to check that the above "tx", ".", "origin" values are available in my generated json or not. and, it should be consecutive like (tx.origin). if it is available it will return something. I am available to get any one value - .tokens[?(#.value == "tx")].value
I need to check all 3 in a consecutive manner.
Could you guys help me?
Thanks in advance.
Another option is to just get the values
$.tokens[*].value
This will get you all the values. They should be in the right sequence, but there's no guarantee.
I am using the 'Explore Popular Places by Category' API and it always returns averageRating as 0 for all items in the result.
I made this call with various categories such as restaurants and sights-museums, but it always returns 0 for averageRating. Does HERE not provide this detail, and if so, why is it returned in the response?
Some details:
I am making a call to this url:
https://places.ls.hereapi.com/places/v1/discover/explore?at=52.5159%2C13.3777&cat=sights-museums&apiKey={api_key}
and it returns something like this:
{
"results": {
"next": "https://places.ls.hereapi.com/places/v1/discover/explore;context=Y2F0PXNpZ2h0cy1tdXNldW1zJmZsb3ctaWQ9Mjk0ZjU1NTgtMmY0Mi01Y2FiLWJlYWUtOGEyM2ViY2EzMzgzXzE1ODMyNjMyNjEwMzZfMF84NTcyJm9mZnNldD0yMCZzaXplPTIw?at=52.5159%2C13.3777&app_id=LKO34glU2MBEVbcOD5mQ&app_code=A2ta_nQ8HRYwenju5HFG5Q",
"items": [
{
"position": [
52.51629,
13.37817
],
"distance": 54,
"title": "Brandenburg Gate",
"averageRating": 0,
"category": {
"id": "landmark-attraction",
"title": "Landmark/Attraction",
"href": "https://places.ls.hereapi.com/places/v1/categories/places/landmark-attraction?app_id=LKO34glU2MBEVbcOD5mQ&app_code=A2ta_nQ8HRYwenju5HFG5Q",
"type": "urn:nlp-types:category",
"system": "places"
},
"icon": "https://download.vcdn.data.here.com/p/d/places2/icons/categories/38.icon",
"vicinity": "Pariser Platz<br/>Mitte, 10117 Berlin",
"having": [],
"type": "urn:nlp-types:place",
"href": "https://places.ls.hereapi.com/places/v1/places/276u33db-8ee2e0de906e459cbade0593986debe9;context=Zmxvdy1pZD0yOTRmNTU1OC0yZjQyLTVjYWItYmVhZS04YTIzZWJjYTMzODNfMTU4MzI2MzI2MTAzNl8wXzg1NzImcmFuaz0w?app_id=LKO34glU2MBEVbcOD5mQ&app_code=A2ta_nQ8HRYwenju5HFG5Q",
"id": "276u33db-8ee2e0de906e459cbade0593986debe9",
"alternativeNames": [
{
"name": "Brandenburger Tor",
"language": "de"
}
]
},
{
"position": [
52.51373,
13.37976
],
"distance": 279,
"title": "Holocaust Memorial",
"averageRating": 0,
"category": {
"id": "museum",
"title": "Museum",
"href": "https://places.ls.hereapi.com/places/v1/categories/places/museum?app_id=LKO34glU2MBEVbcOD5mQ&app_code=A2ta_nQ8HRYwenju5HFG5Q",
"type": "urn:nlp-types:category",
"system": "places"
},
"icon": "https://download.vcdn.data.here.com/p/d/places2/icons/categories/10.icon",
"vicinity": "Cora-Berliner-Straße 1<br/>Mitte, 10117 Berlin",
"having": [],
"type": "urn:nlp-types:place",
"href": "https://places.ls.hereapi.com/places/v1/places/276u33de-df7d57fd38494a93b2018fe549a0fd75;context=Zmxvdy1pZD0yOTRmNTU1OC0yZjQyLTVjYWItYmVhZS04YTIzZWJjYTMzODNfMTU4MzI2MzI2MTAzNl8wXzg1NzImcmFuaz0x?app_id=LKO34glU2MBEVbcOD5mQ&app_code=A2ta_nQ8HRYwenju5HFG5Q",
"id": "276u33de-df7d57fd38494a93b2018fe549a0fd75",
"openingHours": {
"text": "Tue-Sun: 10:00 - 20:00",
"label": "Opening hours",
"isOpen": false,
"structured": [
{
"start": "T100000",
"duration": "PT10H00M",
"recurrence": "FREQ:DAILY;BYDAY:TU,WE,TH,FR,SA,SU"
}
]
},
"alternativeNames": [
{
"name": "Memorial to the Murdered European Jews",
"language": "en"
},
{
"name": "Memorial to the Murdered Jews of Europe",
"language": "en"
},
{
"name": "Denkmal für die ermordeten Juden Europas",
"language": "de"
}
]
},
{
"position": [
52.51666,
13.40784
],
"distance": 2041,
"title": "Nicholas Quarter",
"averageRating": 0,
"category": {
"id": "museum",
"title": "Museum",
"href": "https://places.ls.hereapi.com/places/v1/categories/places/museum?app_id=LKO34glU2MBEVbcOD5mQ&app_code=A2ta_nQ8HRYwenju5HFG5Q",
"type": "urn:nlp-types:category",
"system": "places"
},
"icon": "https://download.vcdn.data.here.com/p/d/places2/icons/categories/10.icon",
"vicinity": "Nikolaikirchplatz<br/>Mitte, 10178 Berlin",
"having": [],
"type": "urn:nlp-types:place",
"href": "https://places.ls.hereapi.com/places/v1/places/276u33dc-049683d3c6be4bdba823808678a1b164;context=Zmxvdy1pZD0yOTRmNTU1OC0yZjQyLTVjYWItYmVhZS04YTIzZWJjYTMzODNfMTU4MzI2MzI2MTAzNl8wXzg1NzImcmFuaz0xOQ?app_id=LKO34glU2MBEVbcOD5mQ&app_code=A2ta_nQ8HRYwenju5HFG5Q",
"id": "276u33dc-049683d3c6be4bdba823808678a1b164",
"alternativeNames": [
{
"name": "Nikolaiviertel",
"language": "en"
},
{
"name": "Nikolaiviertel",
"language": "de"
}
]
}
]
},
"search": {
"context": {
"location": {
"position": [
52.5159,
13.3777
],
"address": {
"text": "Ebertstraße 22<br/>Mitte, 10117 Berlin<br/>Germany",
"house": "22",
"street": "Ebertstraße",
"postalCode": "10117",
"district": "Mitte",
"city": "Berlin",
"county": "Berlin",
"stateCode": "Berlin",
"country": "Germany",
"countryCode": "DEU"
}
},
"type": "urn:nlp-types:place",
"href": "https://places.ls.hereapi.com/places/v1/places/loc-dmVyc2lvbj0xO3RpdGxlPUViZXJ0c3RyYSVDMyU5RmUrMjI7bGF0PTUyLjUxNTk7bG9uPTEzLjM3Nzc7c3RyZWV0PUViZXJ0c3RyYSVDMyU5RmU7aG91c2U9MjI7Y2l0eT1CZXJsaW47cG9zdGFsQ29kZT0xMDExNztjb3VudHJ5PURFVTtkaXN0cmljdD1NaXR0ZTtzdGF0ZUNvZGU9QmVybGluO2NvdW50eT1CZXJsaW47Y2F0ZWdvcnlJZD1idWlsZGluZztzb3VyY2VTeXN0ZW09aW50ZXJuYWw;context=c2VhcmNoQ29udGV4dD0x?app_id=LKO34glU2MBEVbcOD5mQ&app_code=A2ta_nQ8HRYwenju5HFG5Q"
}
}
}
Does HERE not provide the averageRatings of restaurants or sights-museums?
From the docs it appears if the place hasn't received a rating it'll be 0
Note: If the place has no ratings (yet), both the average and the count values are zero. But if the place cannot be rated (i.e. a street), the whole rating object is not present.
https://developer.here.com/documentation/places/dev_guide/topics/object-rating.html
I am trying to get the venue list using the API
https://indoor-discovery.venue.maps.api.here.com/discovery/v2?app_id=XXXXXXXXXXXXXXXXXXXX&app_code=XXXXXXXXXXXXXXXXXXXX&at=31.2403,74.6354,8.6291,77.5743
The "at" parameter almost covers the country. but the results always come back as
{
"hostname": "ip-10-13-214-44",
"type": "venues",
"status": {
"code": "OK",
"reason": "DISCOVERY_SUCCESSFULL"
},
"results": {
"items": []
}
}
The maximum value for the bounding box is at 100km x 100km. If you search within a smaller area you will get some results in the list. Here is one for the coverage of Chennai:
https://indoor-discovery.venue.maps.api.here.com/discovery/v2?app_id=yyy&app_code=xxxx&at=13.2403,79.8454,12.7291,80.5743
{
"hostname": "ip-10-13-214-44",
"type": "venues",
"status": {
"code": "OK",
"reason": "DISCOVERY_SUCCESSFULL"
},
"results": {
"items": [
{
"id": "DM_17331",
"title": "Phoenix Marketcity Mall",
"address": {
"countryCode": "IND",
"city": "Chennai",
"postalCode": "600042",
"street": "Radha Mohan Street",
"house": ""
},
"position": [
12.991487949990416,
80.21652530007341
],
"distance": 1045.380777404391,
"type": "urn:nlp-types:venue",
"vicinity": "Radha Mohan Street,600042,Chennai,IND",
"bbox": [
[
12.992687434189028,
80.21572801724027
],
[
12.990288596080005,
80.21732267846822
]
],
"minFloor": -1,
"maxFloor": 3,
"namespace": "public"
},
{
"id": "DM_3869",
"title": "Maya Plaza",
"address": {
"countryCode": "IND",
"city": "Chennai",
"postalCode": "600017",
"street": "Sir Thyagaraya Road",
"house": ""
},
"position": [
13.041404800089397,
80.23480899848522
],
"distance": 6860.646286724997,
"type": "urn:nlp-types:venue",
"vicinity": "Sir Thyagaraya Road,600017,Chennai,IND",
"bbox": [
[
13.041557002816027,
80.23472596161558
],
[
13.04125261448761,
80.23489217568006
]
],
"minFloor": 0,
"maxFloor": 4,
"namespace": "public"
},
{
"id": "DM_3866",
"title": "Challa Mall",
"address": {
"countryCode": "IND",
"city": "Chennai",
"postalCode": "600017",
"street": "Sir Thyagaraya Road",
"house": ""
},
"position": [
13.040501949969517,
80.24325910031074
],
"distance": 7183.4301593814025,
"type": "urn:nlp-types:venue",
"vicinity": "Sir Thyagaraya Road,600017,Chennai,IND",
"bbox": [
[
13.040704496188196,
80.24306093132118
],
[
13.040299554031115,
80.24345735684514
]
],
"minFloor": -1,
"maxFloor": 1,
"namespace": "public"
},
{
"id": "DM_3871",
"title": "Kasi Arcade Mall",
"address": {
"countryCode": "IND",
"city": "Chennai",
"postalCode": "600017",
"street": "Sir Thyagaraya Road",
"house": ""
},
"position": [
13.040300249964666,
80.24435859999508
],
"distance": 7224.9813794400025,
"type": "urn:nlp-types:venue",
"vicinity": "Sir Thyagaraya Road,600017,Chennai,IND",
"bbox": [
[
13.040532567087016,
80.24415738929856
],
[
13.04006805606027,
80.24455999517599
]
],
"minFloor": -1,
"maxFloor": 1,
"namespace": "public"
},
I had copied the lat/long from google maps, then I realized that the longitude has space, in the beginning, I removed the space and it started to work!