science 이 제품 또는 기능은 실험용 (GA 이전) 버전입니다. GA 이전 제품과 기능은 지원이 제한될 수 있으며, GA 이전 제품과 기능이 변경된 경우 다른 GA 이전 버전과 호환되지 않을 수 있습니다. GA 이전 버전 제품 및 서비스에는 Google Maps Platform 서비스별 약관이 적용됩니다. 자세한 내용은 출시 단계 설명을 참조하세요. 가입하여 장소 통계를 테스트해 보세요.
types 값당 하나의 행이 있는 테이블 이 테이블에는 type (STRING), count (INT64), sample_place_ids(ARRAY<STRING>) 열이 포함되어 있으며, 여기서 sample_place_ids에는 각 type에 최대 250개의 장소 ID가 포함됩니다.
예: 레스토랑, 카페, 바의 개수 반환
이 예에서는 뉴욕시의 다각형으로 정의된 지정된 검색 영역에서 운영 중인 모든 레스토랑, 카페, 바를 검색합니다.
types 매개변수는 검색할 장소 유형을 지정하는 STRING 값의 배열을 사용합니다. 가능한 값의 전체 목록은 장소 유형의 표 A와 표 B를 참고하세요.
이 예에서는 BigQuery ST_GEOGFROMTEXT 함수를 사용하여 다각형에서 GEOGRAPHY 값을 반환합니다.
[null,null,["최종 업데이트: 2025-07-17(UTC)"],[],[],null,["The `PLACES_COUNT_PER_TYPE` function returns a table of counts for each place\n**type** specified to the function. For example, if you search for the types\n`doctor`, `hospital`, and `pharmacy` the response contains a table with a\nseparate row for each type.\n| **Note:** If you specify these same three types to the `PLACES_COUNT` function, `PLACES_COUNT` returns a single value containing the combined count for all three types.\n\nBecause the `PLACES_COUNT_PER_TYPE` function returns a table, call it using a\n`FROM` clause.\n\n- Input parameters:\n\n - **Required** : The `geography` [filter parameter](/maps/documentation/placesinsights/experimental/filter-params) that\n specifies the search area. The `geography` parameter takes a value\n defined by the BigQuery\n [`GEOGRAPHY`](https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types#geography_type)\n data type, which supports points, linestrings, and polygons.\n\n For examples of using different types of search geographies, such as\n viewports and lines, see [`PLACES_COUNT`\n function](/maps/documentation/placesinsights/experimental/places-count).\n - **Required** : The `types` [filter parameter](/maps/documentation/placesinsights/experimental/filter-params) that\n specifies the place types to search for.\n\n - **Optional** : Additional [filter](/maps/documentation/placesinsights/experimental/filter-params) parameters to refine\n your search.\n\n- Returns:\n\n - A table with one row per `types` value. The table contains the columns `type` (`STRING`) and `count` (`INT64`).\n\nExample: Return count of restaurant, cafes, and bars\n\nIn this example, you search for all operational restaurant, cafe, and bars in\nthe specified search area defined as a polygon in New York City.\n\nThe `types` parameter takes an array of `STRING` values specifying the place\ntypes to search for. For the complete list of possible values, see Table A and\nTable B at [Places types](/maps/documentation/places/web-service/place-types).\n\nThis example also uses the BigQuery\n[`ST_GEOGFROMTEXT`](https://cloud.google.com/bigquery/docs/reference/standard-sql/geography_functions#st_geogfromtext)\nfunction to return a `GEOGRAPHY` value from a polygon. \n\n```googlesql\nDECLARE geo GEOGRAPHY;\nSET geo = ST_GEOGFROMTEXT('''POLYGON((-73.985708 40.75773,-73.993324 40.750298,\n -73.9857 40.7484,-73.9785 40.7575,\n -73.985708 40.75773))'''); -- NYC viewport\n\nSELECT * FROM `maps-platform-analytics-hub.sample_places_insights_us.PLACES_COUNT_PER_TYPE`(\n JSON_OBJECT(\n 'types', [\"restaurant\", \"cafe\", \"bar\"],\n 'geography', geo,\n 'business_status', ['OPERATIONAL']\n )\n);\n```\n\nThis function returns a table with three rows, one per type:"]]