How to request traditional chinese (pinyin) - xLocate1

deals with geocoding and reverse geocoding
Post Reply
User avatar
Bernd Welter
Site Admin
Posts: 2574
Joined: Mon Apr 14, 2014 10:28 am
Contact:

How to request traditional chinese (pinyin) - xLocate1

Post by Bernd Welter »

Here's an example for how to retrieve the results of a chinese geocoding (China Cluster xS1 - https://china-test.ptvgroup.cn/) in Pinyin (traditional chinese) style:

Code: Select all

{
  "address": "Shanghai",
  "country": "CN",
  "options": [  {"$type": "SearchOption",
      "value": "PYN",
    "param": "RESULT_LANGUAGE"}
  ],
  "sorting": [],
  "additionalFields": [],
  "callerContext": {
    "properties": [
      {
        "key": "CoordFormat",
        "value": "PTV_MERCATOR"
      },
      {
        "key": "Profile",
        "value": "default"
      }
   ]
  }
}
returns

Code: Select all

{
  "address": "Shanghai",
  "country": "CN",
  "options": [  {"$type": "SearchOption",
      "value": "PYN",
    "param": "RESULT_LANGUAGE"}
  ],
  "sorting": [],
  "additionalFields": [],
  "callerContext": {
    "properties": [
      {
        "key": "CoordFormat",
        "value": "PTV_MERCATOR"
      },
      {
        "key": "Profile",
        "value": "default"
      }
   ]
  }
}
If you do not specify PYN as output language but rely on the default we return

Code: Select all

{
  "errorCode": 0,
  "resultList": [
    {
      "$type": "ResultAddress",
      "country": "C",
      "postCode": "100020",
      "city": "朝阳区",
      "city2": "",
      "street": "霄云路",
      "houseNumber": "",
      "totalScore": 0,
      "detailLevelDescription": "COUNTRY",
      "classificationDescription": "NOT_CLASSIFIED",
      "coordinates": {
        "$type": "Point",
        "point": {
          "$type": "PlainPoint",
          "x": 12950511.723,
          "y": 4854575.4003
        }
      }
    },
  ]
}
Bernd Welter
Technical Partner Manager Developer Components
PTV Logistics - Germany

Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning... :twisted:
Post Reply