Geocoding Japanese cities insert a space between characters and the city is not found

Fred5907 20 Reputation points
2024-11-06T02:41:54.97+00:00

Hi,

I am trying to use Azure Map for geocoding cities and it looks like I am doing something wrong because the result is not really the one wanted.

Can you please help in getting a more accurate result?

I tried those two :

  • Tokyo (東京)

https://atlas.microsoft.com/search/address/json?api-version=1.0&query=%E6%9D%B1%E4%BA%AC&subscription-key=<key>

This works even it looks like a space is also added.

{"summary":{"query":"东 京","queryType":"NON_NEAR","queryTime":7,"numResults":3,"offset":0,"totalResults":3,"fuzzyLevel":1},"results":[{"type":"Geography","id":"TbOmYMFBz7Hm8q_lxc-oCA","score":1,"entityType":"Municipality","matchConfidence":{"score":1},"address":{"municipality":"Tokyo","countrySubdivision":"Kanto","countrySubdivisionName":"Kanto","countryCode":"JP","country":"Japan","countryCodeISO3":"JPN","freeformAddress":"Tokyo, Kanto"},"position":{"lat":35.68696,"lon":139.74946},"viewport":{"topLeftPoint":{"lat":37.14388,"lon":138.37411},"btmRightPoint":{"lat":34.89988,"lon":140.87509}},"boundingBox":{"topLeftPoint":{"lat":37.14388,"lon":138.37411},"btmRightPoint":{"lat":34.89988,"lon":140.87509}},"dataSources":{"geometry":{"id":"00005858-5800-1200-0000-00007d30cf7f"}}},{"type":"Cross Street","id":"RLcuh7f4vyzt6tP2jvxoyQ","score":0.8436848116464776,"matchConfidence":{"score":0.8436848116464776},"address":{"streetName":"Jingji 7th Road & Bade East Road","municipalitySubdivision":"Renwu District","municipality":"Kaohsiung City","countrySubdivision":"Kaohsiung City","countrySubdivisionName":"Kaohsiung City","postalCode":"814","countryCode":"TW","country":"Taiwan","countryCodeISO3":"TWN","freeformAddress":"Jingji 7th Road & Bade East Road, Renwu District, Kaohsiung City 814","localName":"Renwu District"},"position":{"lat":22.68506,"lon":120.34094},"viewport":{"topLeftPoint":{"lat":22.68596,"lon":120.33997},"btmRightPoint":{"lat":22.68416,"lon":120.34191}}},{"type":"Cross Street","id":"V-K9YrxqigrEdeIIjxcGHg","score":0.8453314176137078,"matchConfidence":{"score":0.8453314176137078},"address":{"streetName":"Jingji 6th Road & Bade East Road","municipalitySubdivision":"Renwu District","municipality":"Kaohsiung City","countrySubdivision":"Kaohsiung City","countrySubdivisionName":"Kaohsiung City","postalCode":"814","countryCode":"TW","country":"Taiwan","countryCodeISO3":"TWN","freeformAddress":"Jingji 6th Road & Bade East Road, Renwu District, Kaohsiung City 814","localName":"Renwu District"},"position":{"lat":22.68556,"lon":120.342},"viewport":{"topLeftPoint":{"lat":22.68646,"lon":120.34103},"btmRightPoint":{"lat":22.68466,"lon":120.34297}}}]}
  • Yokohama(横浜)

https://atlas.microsoft.com/search/address/json?api-version=1.0&query=%E6%A8%AA%E6%B5%9C&subscription-key=<key>

This result is as following, space in the query, city is found in HongKong and not Japan:

{"summary":{"query":"横 浜","queryType":"NON_NEAR","queryTime":96,"numResults":10,"offset":0,"totalResults":633,"fuzzyLevel":2},"results":[{"type":"Geography","id":"QtO6uyBaCV-Yv0zZTGcq3g","score":0.5273266241290786,"entityType":"MunicipalitySubdivision","matchConfidence":{"score":0.5273266241290786},"address":{"municipalitySubdivision":"Wang Chau","municipality":"Hong Kong","countrySubdivision":"Hong Kong","countrySubdivisionName":"Hong Kong","countryCode":"HK","country":"Hong Kong SAR","countryCodeISO3":"HKG","freeformAddress":"Wang Chau, Hong Kong, Hong Kong"},"position":{"lat":22.45066,"lon":114.01347},"viewport":{"topLeftPoint":{"lat":22.4688,"lon":114.00872},"btmRightPoint":{"lat":22.44453,"lon":114.0298}},"boundingBox":{"topLeftPoint":{"lat":22.4688,"lon":114.00872},"btmRightPoint":{"lat":22.44453,"lon":114.0298}},"dataSources":{"geometry":{"id":"d2b264de-d90a-4fb4-a915-881dd2074ca8"}}},{"type":"Geography","id":"OWEQVbxc14Ox0JLLbYqM7g","score":0.4669416425418478,"entityType":"MunicipalitySubdivision","matchConfidence":{"score":0.4669416425418478},"address":{"municipalitySubdivision":"Wang Tau Hom","municipality":"Hong Kong","countrySubdivision":"Hong Kong","countrySubdivisionName":"Hong Kong","countryCode":"HK","country":"Hong Kong SAR","countryCodeISO3":"HKG","freeformAddress":"Wang Tau Hom, Hong Kong, Hong Kong"},"position":{"lat":22.3423,"lon":114.18792},"viewport":{"topLeftPoint":{"lat":22.34317,"lon":114.18312},"btmRightPoint":{"lat":22.33839,"lon":114.18954}},"boundingBox":{"topLeftPoint":{"lat":22.34317,"lon":114.18312},"btmRightPoint":{"lat":22.33839,"lon":114.18954}},"dataSources":{"geometry":{"id":"d1b4caa5-0316-43bd-a6ca-9b57f4ca3118"}}},{"type":"Geography","id":"ld-VLR-ukoENEARPJACn2g","score":0.5455533208523642,"entityType":"MunicipalitySubdivision","matchConfidence":{"score":0.5455533208523642},"address":{"municipalitySubdivision":"Hengshan Township","municipality":"Hsinchu County","countryCode":"TW","country":"Taiwan","countryCodeISO3":"TWN","freeformAddress":"Hengshan Township, Hsinchu County"},"position":{"lat":24.71688,"lon":121.14154},"viewport":{"topLeftPoint":{"lat":24.7581,"lon":121.09818},"btmRightPoint":{"lat":24.65388,"lon":121.20379}},"boundingBox":{"topLeftPoint":{"lat":24.7581,"lon":121.09818},"btmRightPoint":{"lat":24.65388,"lon":121.20379}},"dataSources":{"geometry":{"id":"00005858-5800-1200-0000-00007d2f531e"}}},{"type":"Street","id":"gLsML7pXU5z7CS9OXLTrDw","score":0.6200488889839451,"matchConfidence":{"score":0.6200488889839451},"address":{"streetName":"Heng Street","municipalitySubdivision":"Zhushan Township","municipality":"Nantou County","countryCode":"TW","country":"Taiwan","countryCodeISO3":"TWN","freeformAddress":"Heng Street, Zhushan Township, Nantou County","localName":"Zhushan Township"},"position":{"lat":23.75479,"lon":120.68389},"viewport":{"topLeftPoint":{"lat":23.7568,"lon":120.68261},"btmRightPoint":{"lat":23.7532,"lon":120.68539}}},{"type":"Street","id":"_Lr2lU0pTNghCT853rrIjw","score":0.5571609668356959,"matchConfidence":{"score":0.5571609668356959},"address":{"streetName":"Hengshan Road","municipalitySubdivision":"Yanchao District","municipality":"Kaohsiung City","countrySubdivision":"Kaohsiung City","countrySubdivisionName":"Kaohsiung City","countryCode":"TW","country":"Taiwan","countryCodeISO3":"TWN","freeformAddress":"Hengshan Road, Yanchao District, Kaohsiung City","localName":"Yanchao District"},"position":{"lat":22.76414,"lon":120.37364},"viewport":{"topLeftPoint":{"lat":22.77348,"lon":120.36303},"btmRightPoint":{"lat":22.7555,"lon":120.38253}}},{"type":"Street","id":"Z0uyO4E6UUmVRD7yzAqU5Q","score":0.6005761045836986,"matchConfidence":{"score":0.6005761045836986},"address":{"streetName":"Wang Street","municipalitySubdivision":"Sai Kung","municipality":"Hong Kong","neighbourhood":"Sai Kung Seafood Street","countrySubdivision":"Hong Kong","countrySubdivisionName":"Hong Kong","countryCode":"HK","country":"Hong Kong SAR","countryCodeISO3":"HKG","freeformAddress":"Wang Street, Sai Kung, Sai Kung District, Hong Kong","localName":"Sai Kung District"},"position":{"lat":22.38025,"lon":114.27072},"viewport":{"topLeftPoint":{"lat":22.38025,"lon":114.2706},"btmRightPoint":{"lat":22.38016,"lon":114.27083}}},{"type":"Street","id":"FDlaIO0BGbyqwu-itj7l5g","score":0.5571609668356959,"matchConfidence":{"score":0.5571609668356959},"address":{"streetName":"Hengshan Road","municipalitySubdivision":"Nan'ao Township","municipality":"Yilan County","postalCode":"272","countryCode":"TW","country":"Taiwan","countryCodeISO3":"TWN","freeformAddress":"Hengshan Road, Nan'ao Township, Yilan County 272","localName":"Nan'ao Township"},"position":{"lat":24.442,"lon":121.76679},"viewport":{"topLeftPoint":{"lat":24.4421,"lon":121.76628},"btmRightPoint":{"lat":24.4419,"lon":121.76707}}},{"type":"Street","id":"hyL1R021kXBH3gB5b35S_A","score":0.5571609668356959,"matchConfidence":{"score":0.5571609668356959},"address":{"streetName":"Hengshan Road","municipalitySubdivision":"Sanzhi District","municipality":"New Taipei City","countrySubdivision":"New Taipei City","countrySubdivisionName":"New Taipei City","postalCode":"252","countryCode":"TW","country":"Taiwan","countryCodeISO3":"TWN","freeformAddress":"Hengshan Road, Sanzhi District, New Taipei City 252","localName":"Sanzhi District"},"position":{"lat":25.26296,"lon":121.54256},"viewport":{"topLeftPoint":{"lat":25.26392,"lon":121.53995},"btmRightPoint":{"lat":25.26259,"lon":121.54477}}},{"type":"Street","id":"SmITfHKO9ruLvoa_0malEg","score":0.5020172611561144,"matchConfidence":{"score":0.5020172611561144},"address":{"streetName":"Ma Wang Road","municipality":"Hong Kong","countrySubdivision":"Hong Kong","countrySubdivisionName":"Hong Kong","countryCode":"HK","country":"Hong Kong SAR","countryCodeISO3":"HKG","freeformAddress":"Ma Wang Road, Hong Kong, Hong Kong","localName":"Hong Kong"},"position":{"lat":22.44677,"lon":114.02066},"viewport":{"topLeftPoint":{"lat":22.45472,"lon":114.01131},"btmRightPoint":{"lat":22.43673,"lon":114.03077}}},{"type":"Street","id":"d8AURkRUDTBfewA9S9kUWA","score":0.5062875644031553,"matchConfidence":{"score":0.5062875644031553},"address":{"streetName":"2nd Side Street","municipalitySubdivision":"Dongshi District","municipality":"Taichung City","countrySubdivision":"Taichung City","countrySubdivisionName":"Taichung City","postalCode":"423","extendedPostalCode":"42342, 42343","countryCode":"TW","country":"Taiwan","countryCodeISO3":"TWN","freeformAddress":"2nd Side Street, Dongshi District, Taichung City 423","localName":"Dongshi District"},"position":{"lat":24.2546,"lon":120.82946},"viewport":{"topLeftPoint":{"lat":24.25472,"lon":120.82871},"btmRightPoint":{"lat":24.25444,"lon":120.83036}}}]}
Azure Maps
Azure Maps
An Azure service that provides geospatial APIs to add maps, spatial analytics, and mobility solutions to apps.
742 questions
0 comments No comments
{count} votes

Accepted answer
  1. IoTGirl 3,211 Reputation points Microsoft Employee
    2024-11-06T04:52:40.2833333+00:00

    Hi Fred,

    Can you please try our V2 Geocoder? V1 does not have good coverage for Asia and you are likely to get better results from V2. V2 has the version number as a date. See https://learn.microsoft.com/en-us/rest/api/maps/search/get-geocoding?view=rest-maps-2024-04-01&tabs=HTTP for the sample calls and parameter details.

    Also, you will get better answers if you give more context. For example, "Yokohama" vs "Yokohama, Japan". If you can give the city and country, the Geocoder will have greater information to narrow down the options.

    Sincerely,

    IoTGirl

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.