ee.FeatureCollection.getInfo
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ฟังก์ชันที่จำเป็นซึ่งแสดงข้อมูลที่ทราบทั้งหมดเกี่ยวกับคอลเล็กชันนี้ผ่านการเรียก AJAX
แสดงคำอธิบายคอลเล็กชันที่มีช่องต่อไปนี้
- ฟีเจอร์: รายการที่มีข้อมูลเมตาเกี่ยวกับฟีเจอร์ในคอลเล็กชัน
- พร็อพเพอร์ตี้: พจนานุกรมที่ไม่บังคับซึ่งมีพร็อพเพอร์ตี้ข้อมูลเมตาของคอลเล็กชัน
การใช้งาน | การคืนสินค้า |
---|
FeatureCollection.getInfo(callback) | FeatureCollectionDescription |
อาร์กิวเมนต์ | ประเภท | รายละเอียด |
---|
ดังนี้ featurecollection | FeatureCollection | อินสแตนซ์ FeatureCollection |
callback | ฟังก์ชัน (ไม่บังคับ) | การเรียกกลับที่ไม่บังคับ หากไม่ได้ระบุไว้ ระบบจะโทรแบบพร้อมกัน หากระบุไว้ ระบบจะเรียกใช้พารามิเตอร์แรกหากสำเร็จ และพารามิเตอร์ที่ 2 หากไม่สำเร็จ |
ตัวอย่าง
โปรแกรมแก้ไขโค้ด (JavaScript)
/**
* WARNING: this function transfers data from Earth Engine servers to the
* client. Doing so can negatively affect request processing and client
* performance. Server-side options should be used whenever possible.
* Learn more about the distinction between server and client:
* https://developers.google.com/earth-engine/guides/client_server
*/
// A server-side ee.FeatureCollection of power plants in Belgium.
var fcServer = ee.FeatureCollection('WRI/GPPD/power_plants')
.filter('country_lg == "Belgium"');
// Use getInfo to transfer server-side feature collection to the client. The
// result is an object.
var fcClient = fcServer.getInfo();
print('Client-side feature collection is an object', typeof fcClient);
print('Feature collection object keys', Object.keys(fcClient));
print('Array of features', fcClient.features);
print('Properties of first feature', fcClient.features[0].properties);
การตั้งค่า Python
ดูข้อมูลเกี่ยวกับ Python API และการใช้ geemap
เพื่อการพัฒนาแบบอินเทอร์แอกทีฟได้ที่หน้า
สภาพแวดล้อม Python
import ee
import geemap.core as geemap
Colab (Python)
"""WARNING: this function transfers data from Earth Engine servers to the
client. Doing so can negatively affect request processing and client
performance. Server-side options should be used whenever possible.
Learn more about the distinction between server and client:
https://developers.google.com/earth-engine/guides/client_server
"""
# A server-side ee.FeatureCollection of power plants in Belgium.
fc_server = ee.FeatureCollection('WRI/GPPD/power_plants').filter(
'country_lg == "Belgium"')
# Use getInfo to transfer server-side feature collection to the client. The
# result is an object.
fc_client = fc_server.getInfo()
print('Client-side feature collection is a dictionary:', type(fc_client))
print('Feature collection dictionary keys:', fc_client.keys())
print('Array of features:', fc_client['features'])
print('Properties of first feature:', fc_client['features'][0]['properties'])
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 2025-07-26 UTC"],[[["\u003cp\u003e\u003ccode\u003egetInfo()\u003c/code\u003e retrieves all data from a server-side FeatureCollection to the client as a FeatureCollectionDescription.\u003c/p\u003e\n"],["\u003cp\u003eThe returned FeatureCollectionDescription contains 'features' (metadata about features) and optional 'properties' (collection metadata).\u003c/p\u003e\n"],["\u003cp\u003eThis function can negatively impact performance due to client-side data transfer; server-side alternatives are preferred when feasible.\u003c/p\u003e\n"],["\u003cp\u003eUsage involves calling \u003ccode\u003eFeatureCollection.getInfo()\u003c/code\u003e with an optional callback function for asynchronous execution.\u003c/p\u003e\n"]]],[],null,["# ee.FeatureCollection.getInfo\n\n\u003cbr /\u003e\n\nAn imperative function that returns all the known information about this collection via an AJAX call.\n\n\u003cbr /\u003e\n\nReturns a collection description whose fields include:\n\n- features: a list containing metadata about the features in the collection.\n\n- properties: an optional dictionary containing the collection's metadata properties.\n\n| Usage | Returns |\n|-------------------------------------------|------------------------------|\n| FeatureCollection.getInfo`(`*callback*`)` | FeatureCollectionDescription |\n\n| Argument | Type | Details |\n|---------------------------|--------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| this: `featurecollection` | FeatureCollection | The FeatureCollection instance. |\n| `callback` | Function, optional | An optional callback. If not supplied, the call is made synchronously. If supplied, will be called with the first parameter if successful and the second if unsuccessful. |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\n/**\n * WARNING: this function transfers data from Earth Engine servers to the\n * client. Doing so can negatively affect request processing and client\n * performance. Server-side options should be used whenever possible.\n * Learn more about the distinction between server and client:\n * https://developers.google.com/earth-engine/guides/client_server\n */\n\n// A server-side ee.FeatureCollection of power plants in Belgium.\nvar fcServer = ee.FeatureCollection('WRI/GPPD/power_plants')\n .filter('country_lg == \"Belgium\"');\n\n// Use getInfo to transfer server-side feature collection to the client. The\n// result is an object.\nvar fcClient = fcServer.getInfo();\nprint('Client-side feature collection is an object', typeof fcClient);\nprint('Feature collection object keys', Object.keys(fcClient));\nprint('Array of features', fcClient.features);\nprint('Properties of first feature', fcClient.features[0].properties);\n```\nPython setup\n\nSee the [Python Environment](/earth-engine/guides/python_install) page for information on the Python API and using\n`geemap` for interactive development. \n\n```python\nimport ee\nimport geemap.core as geemap\n```\n\n### Colab (Python)\n\n```python\n\"\"\"WARNING: this function transfers data from Earth Engine servers to the\nclient. Doing so can negatively affect request processing and client\nperformance. Server-side options should be used whenever possible.\nLearn more about the distinction between server and client:\nhttps://developers.google.com/earth-engine/guides/client_server\n\"\"\"\n\n# A server-side ee.FeatureCollection of power plants in Belgium.\nfc_server = ee.FeatureCollection('WRI/GPPD/power_plants').filter(\n 'country_lg == \"Belgium\"')\n\n# Use getInfo to transfer server-side feature collection to the client. The\n# result is an object.\nfc_client = fc_server.getInfo()\nprint('Client-side feature collection is a dictionary:', type(fc_client))\nprint('Feature collection dictionary keys:', fc_client.keys())\nprint('Array of features:', fc_client['features'])\nprint('Properties of first feature:', fc_client['features'][0]['properties'])\n```"]]