[기술 정보] 더욱 정교해진 Google Places API
  • SPH Blog
  • SPH Linkedin
  • SPH Facebook
  • SPH Youtube

[기술 정보] 더욱 정교해진 Google Places API

2016-02-26

SPH-HJ

그동안 Google Places API을 사용해서 개발을 해오셨던 분들을 위한 업데이트 소식입니다. 최근 구글에서는 Places API를 Google Maps search와 연동하였으며, 이제는 Places API를 사용하였을 때에도, Google Maps(maps.google.com)에서 검색하는 것과 동일한 결과를 받을 수 있습니다.

사라지는 기능들은 2017 2 16 이후에는 지원되지 않습니다. 이에 따른 내용을 소개해드리니, 그동안 Place API를 사용하셨던 개발자분들은 아래 내용을 참고하시고 업데이트 된 내용으로 반영을 해 주시기 바랍니다.


새로운 Types Search Parameter

2016 2 16일을 시작으로, types restriction parameter 새로운 types search parameter 대체됩니다. 만약 그동안 Nearby Search, Text Search, 혹은 Radar Search를 위한 타입 파라미터를 사용해왔다면 영향을 받으실 것입니다.

새로운 type search 기능은 상당히 직관적입니다. types 파라미터에 types restriction parameter가 없어지고, 대신 새로운 types search parameter 기능으로 대체되면서 Google Maps에서만 제공되던 결과를 Places API로도 받을 수 있게 됐습니다. 이는 모든 주변, 텍스트, 레이더 검색 엔드포인트를 이용하는 쿼리에 적용됩니다.


var service = new google.maps.places.PlacesService(map);

  service.nearbySearch({

    location: pyrmont,

    radius: 2000,

    type: ['bank']

  }, callback);


sampleresults


많은 개발자들 또한 구글의 이러한 변화에 환영을 표했습니다.

userresponse

 

기존의 Google Places API에서는 Bank를 Google Maps에서 검색을 하면 주변 은행에 대한 결과가 제대로 나오지만, Google Places API를 이용해서 구현된 애플리케이션에서는 다른 결과를 반환했습니다. Google Maps에서 제공되는 내용(DB) 중 일부가 Google Places API에서 제한됐었기 때문입니다.


Place Type 대한 제한

types search parameter는 기존의 types restriction parameter과 비슷하게 작동하겠지만, 요청 당 하나의 type만 지원합니다. 예를 들어, 여러 타입을 한번에 검색하는 것(예: types=hospital|pharmacy|doctor)은 지원되지 않을 것입니다.

사라지는 기능들은 2017 2 16일까지는 결과 값을 반환 하겠지만, 그 뒤로는 더 이상 지원되지 않습니다. 따라서, 가장 최적의 search result를 보장하기 위해 search request에서 single type 을 사용할 것을 추천 드립니다.

예시를 통해 새로운 types search parameter에 대해 확인해보세요.

https://maps.googleapis.com/maps/api/place/textsearch/json

?type=airport

&location=-33.87,151.21

&radius=5000

&key=


지원하는 타입에 대한 변화

지원하는 타입도 수정되었습니다시설(establishment), 음식(food), 건강(health), 건설업자(general_contractor), finance, 종교시설(place_of_worship)은 검색 가능한 타입(searchable types)에서 제외됩니다. 이 타입들은 search & details 결과에서 값을 리턴하겠지만 2017 2 16부터는 검색이 지원되지 않을 것입니다.

현재 기준으로 지원하는 타입에 대해 아래 표에서 확인해보세요.


지원되는 타입

accounting

embassy

moving_company

airport

establishment

museum

amusement_park

finance

night_club

aquarium

fire_station

painter

art_gallery

florist

park

atm

food

parking

bakery

funeral_home

pet_store

bank

furniture_store

pharmacy

bar

gas_station

physiotherapist

beauty_salon

general_contractor

place_of_worship

bicycle_store

grocery_or_supermarket

plumber

book_store

gym

police

bowling_alley

hair_care

post_office

bus_station

hardware_store

real_estate_agency

cafe

health

restaurant

campground

hindu_temple

roofing_contractor

car_dealer

home_goods_store

rv_park

car_rental

hospital

school

car_repair

insurance_agency

shoe_store

car_wash

jewelry_store

shopping_mall

casino

laundry

spa

cemetery

lawyer

stadium

church

library

storage

city_hall

liquor_store

store

clothing_store

local_government_office

subway_station

convenience_store

locksmith

synagogue

courthouse

lodging

taxi_stand

dentist

meal_delivery

train_station

department_store

meal_takeaway

travel_agency

doctor

mosque

university

electrician

movie_rental

veterinary_care

electronics_store

movie_theater

zoo

Places API에서 Google Maps(maps.google.com)과 동일한 검색 결과를 보여지게 함으로써 Places API의 활용도가 높아질 것으로 기대됩니다. 관련 문의사항은 SPH(help@sphinfo.co.kr)로 문의 주시기 바랍니다.

>> 구글 블로그 원문보기

 

Powered by Froala Editor


SPH는 Google Maps, SuperMap, Maxar Technologies 등 다양한 제품군을 가지고 있으며, 고객의 사례에 꼭 맞는 무료 세미나 및 인적 컨설팅을 제공하고 있습니다. 더욱 자세한 이야기를 나누고 싶으시다면, 여기에서 문의 주시길 바라며, SPH에서 발행하는 GIS / 로케이션인텔리전스 관련 최신 소식을 받아보고 싶으신 분들은 페이스북 페이지 또는 뉴스레터를 구독해주시길 바랍니다

Newsletter구독 신청
문의하기
sph-symbol