science هذا المنتج أو الميزة قيد الاختبار (قبل طرحه للجميع). قد يكون الدعم المقدَّم للمنتجات والميزات في مرحلة ما قبل الإصدار العلني محدودًا، وقد لا تكون التغييرات التي يتم إجراؤها على المنتجات والميزات في مرحلة ما قبل الإصدار العلني متوافقة مع الإصدارات الأخرى من مرحلة ما قبل الإصدار العلني. تخضع "عروض مرحلة ما قبل الإطلاق" للأحكام المحدّدة لخدمة Google Maps Platform. لمزيد من المعلومات، يُرجى الاطّلاع على أوصاف مراحل الإطلاق. الاشتراك لاختبار "إحصاءات الأماكن"
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
تعرض الدالة PLACES_COUNT_PER_TYPE جدولاً يتضمّن عدد مرات ظهور كل نوع من الأماكن المحدّد للدالة. على سبيل المثال، إذا بحثت عن الأنواع doctor وhospital وpharmacy، سيتضمّن الرد جدولاً يتضمّن صفًا منفصلاً لكل نوع.
بما أنّ الدالة PLACES_COUNT_PER_TYPE تعرض جدولاً، استدعِها باستخدام عبارة FROM.
مَعلمات الإدخال:
مطلوبة: geographyمَعلمة الفلترة التي تحدّد مساحة البحث. تتلقّى المَعلمة geography قيمة
محدّدة حسب نوع بيانات
GEOGRAPHY
في BigQuery، والذي يتيح استخدام النقاط والخطوط المتعددة والمضلّعات.
للحصول على أمثلة حول استخدام أنواع مختلفة من المواقع الجغرافية للبحث، مثل منافذ العرض والخطوط، اطّلِع على PLACES_COUNTالدالة.
مطلوبة: typesمَعلمة الفلتر التي تحدّد أنواع الأماكن المطلوب البحث عنها.
جدول يحتوي على صف واحد لكل قيمة types. يحتوي الجدول على الأعمدة type (STRING) وcount (INT64) وsample_place_ids (ARRAY<STRING>)، حيث يحتوي sample_place_ids على ما يصل إلى 250 معرّف مكان لكل type.
مثال: عدد المطاعم والمقاهي والبارات التي تم إرجاعها
في هذا المثال، يمكنك البحث عن جميع المطاعم والمقاهي والحانات المفتوحة في منطقة البحث المحدّدة على شكل مضلّع في مدينة نيويورك.
تأخذ المَعلمة types مصفوفة من قيم STRING تحدّد أنواع الأماكن المطلوب البحث عنها. للاطّلاع على القائمة الكاملة بالقيم المحتملة، راجِع أنواع الأماكن.
يستخدم هذا المثال أيضًا الدالة BigQuery
ST_GEOGFROMTEXT
لعرض قيمة GEOGRAPHY من مضلّع.
تاريخ التعديل الأخير: 2025-09-06 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-09-06 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],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:"]]