Anúncio: todos os projetos não comerciais registrados para usar o Earth Engine antes de
15 de abril de 2025 precisam
verificar a qualificação não comercial para manter o acesso ao Earth Engine.
Visão geral da FeatureCollection
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Grupos de recursos relacionados podem ser combinados em um FeatureCollection
para
permitir operações adicionais em todo o conjunto, como filtragem, classificação e renderização.
Além de elementos simples (geometria + propriedades), as coleções de elementos também podem conter outras coleções.
O construtor FeatureCollection
Uma maneira de criar um FeatureCollection
é fornecer ao construtor
uma lista de recursos. Os elementos não precisam ter o mesmo tipo de geometria ou as mesmas propriedades. Exemplo:
Editor de código (JavaScript)
// Make a list of Features.
var features = [
ee.Feature(ee.Geometry.Rectangle(30.01, 59.80, 30.59, 60.15), {name: 'Voronoi'}),
ee.Feature(ee.Geometry.Point(-73.96, 40.781), {name: 'Thiessen'}),
ee.Feature(ee.Geometry.Point(6.4806, 50.8012), {name: 'Dirichlet'})
];
// Create a FeatureCollection from the list and print it.
var fromList = ee.FeatureCollection(features);
print(fromList);
Configuração do Python
Consulte a página
Ambiente Python para informações sobre a API Python e o uso de
geemap
para desenvolvimento interativo.
import ee
import geemap.core as geemap
Colab (Python)
# Make a list of Features.
features = [
ee.Feature(
ee.Geometry.Rectangle(30.01, 59.80, 30.59, 60.15), {'name': 'Voronoi'}
),
ee.Feature(ee.Geometry.Point(-73.96, 40.781), {'name': 'Thiessen'}),
ee.Feature(ee.Geometry.Point(6.4806, 50.8012), {'name': 'Dirichlet'}),
]
# Create a FeatureCollection from the list and print it.
from_list = ee.FeatureCollection(features)
display(from_list)
Geometrias individuais também podem ser transformadas em um FeatureCollection
de apenas uma Feature
:
Editor de código (JavaScript)
// Create a FeatureCollection from a single geometry and print it.
var fromGeom = ee.FeatureCollection(ee.Geometry.Point(16.37, 48.225));
print(fromGeom);
Configuração do Python
Consulte a página
Ambiente Python para informações sobre a API Python e o uso de
geemap
para desenvolvimento interativo.
import ee
import geemap.core as geemap
Colab (Python)
# Create a FeatureCollection from a single geometry and print it.
from_geom = ee.FeatureCollection(ee.Geometry.Point(16.37, 48.225))
display(from_geom)
Conjuntos de dados de tabela
O Earth Engine hospeda vários conjuntos de dados de tabelas. Para carregar um conjunto de dados de tabela, forneça o ID da tabela ao construtor FeatureCollection
. Por exemplo, para carregar dados de Ecoregions do RESOLVE:
Editor de código (JavaScript)
var fc = ee.FeatureCollection('RESOLVE/ECOREGIONS/2017');
Map.setCenter(12.17, 20.96, 3);
Map.addLayer(fc, {}, 'ecoregions');
Configuração do Python
Consulte a página
Ambiente Python para informações sobre a API Python e o uso de
geemap
para desenvolvimento interativo.
import ee
import geemap.core as geemap
Colab (Python)
fc = ee.FeatureCollection('RESOLVE/ECOREGIONS/2017')
m = geemap.Map()
m.set_center(12.17, 20.96, 3)
m.add_layer(fc, {}, 'ecoregions')
display(m)
Assim como nos conjuntos de dados de imagem, é possível pesquisar conjuntos de dados de tabela no Catálogo de dados do Earth Engine.
Amostras aleatórias
Para receber uma coleção de pontos aleatórios em uma região especificada, use:
Editor de código (JavaScript)
// Define an arbitrary region in which to compute random points.
var region = ee.Geometry.Rectangle(-119.224, 34.669, -99.536, 50.064);
// Create 1000 random points in the region.
var randomPoints = ee.FeatureCollection.randomPoints(region);
// Display the points.
Map.centerObject(randomPoints);
Map.addLayer(randomPoints, {}, 'random points');
Configuração do Python
Consulte a página
Ambiente Python para informações sobre a API Python e o uso de
geemap
para desenvolvimento interativo.
import ee
import geemap.core as geemap
Colab (Python)
# Define an arbitrary region in which to compute random points.
region = ee.Geometry.Rectangle(-119.224, 34.669, -99.536, 50.064)
# Create 1000 random points in the region.
random_points = ee.FeatureCollection.randomPoints(region)
# Display the points.
m = geemap.Map()
m.center_object(random_points)
m.add_layer(random_points, {}, 'random points')
display(m)
Exceto em caso de indicação contrária, o conteúdo desta página é licenciado de acordo com a Licença de atribuição 4.0 do Creative Commons, e as amostras de código são licenciadas de acordo com a Licença Apache 2.0. Para mais detalhes, consulte as políticas do site do Google Developers. Java é uma marca registrada da Oracle e/ou afiliadas.
Última atualização 2025-07-25 UTC.
[null,null,["Última atualização 2025-07-25 UTC."],[[["\u003cp\u003e\u003ccode\u003eFeatureCollection\u003c/code\u003es group related features, enabling operations like filtering, sorting, and rendering.\u003c/p\u003e\n"],["\u003cp\u003eYou can create \u003ccode\u003eFeatureCollection\u003c/code\u003es using a list of features, a single geometry, or by loading a table dataset using its ID.\u003c/p\u003e\n"],["\u003cp\u003eEarth Engine provides access to various table datasets, searchable in the Data Catalog.\u003c/p\u003e\n"],["\u003cp\u003eRandom point samples within a specified region can be generated using \u003ccode\u003eee.FeatureCollection.randomPoints()\u003c/code\u003e.\u003c/p\u003e\n"]]],["`FeatureCollection` combines related features, enabling operations like filtering and sorting. You can create one by providing a list of features, even with varied geometries and properties, or from a single geometry. Loading table datasets is done by using the `FeatureCollection` constructor with a table ID. The `randomPoints` method generates random points within a region, and both table data and random points can be displayed.\n"],null,["# FeatureCollection Overview\n\nGroups of related features can be combined into a `FeatureCollection`, to\nenable additional operations on the entire set such as filtering, sorting and rendering.\nBesides just simple features (geometry + properties), feature collections can also contain\nother collections.\n\nThe `FeatureCollection` constructor\n-----------------------------------\n\nOne way to create a `FeatureCollection` is to provide the constructor with\na list of features. The features don't need to have the same geometry type or the same\nproperties. For example:\n\n### Code Editor (JavaScript)\n\n```javascript\n// Make a list of Features.\nvar features = [\n ee.Feature(ee.Geometry.Rectangle(30.01, 59.80, 30.59, 60.15), {name: 'Voronoi'}),\n ee.Feature(ee.Geometry.Point(-73.96, 40.781), {name: 'Thiessen'}),\n ee.Feature(ee.Geometry.Point(6.4806, 50.8012), {name: 'Dirichlet'})\n];\n\n// Create a FeatureCollection from the list and print it.\nvar fromList = ee.FeatureCollection(features);\nprint(fromList);\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# Make a list of Features.\nfeatures = [\n ee.Feature(\n ee.Geometry.Rectangle(30.01, 59.80, 30.59, 60.15), {'name': 'Voronoi'}\n ),\n ee.Feature(ee.Geometry.Point(-73.96, 40.781), {'name': 'Thiessen'}),\n ee.Feature(ee.Geometry.Point(6.4806, 50.8012), {'name': 'Dirichlet'}),\n]\n\n# Create a FeatureCollection from the list and print it.\nfrom_list = ee.FeatureCollection(features)\ndisplay(from_list)\n```\n\nIndividual geometries can also be turned into a `FeatureCollection` of\njust one `Feature`:\n\n### Code Editor (JavaScript)\n\n```javascript\n// Create a FeatureCollection from a single geometry and print it.\nvar fromGeom = ee.FeatureCollection(ee.Geometry.Point(16.37, 48.225));\nprint(fromGeom);\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# Create a FeatureCollection from a single geometry and print it.\nfrom_geom = ee.FeatureCollection(ee.Geometry.Point(16.37, 48.225))\ndisplay(from_geom)\n```\n\n### Table Datasets\n\nEarth Engine hosts a variety of table datasets. To load a table dataset, provide the\ntable ID to the `FeatureCollection` constructor. For example, to load\nRESOLVE Ecoregions data:\n\n### Code Editor (JavaScript)\n\n```javascript\nvar fc = ee.FeatureCollection('RESOLVE/ECOREGIONS/2017');\nMap.setCenter(12.17, 20.96, 3);\nMap.addLayer(fc, {}, 'ecoregions');\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\nfc = ee.FeatureCollection('RESOLVE/ECOREGIONS/2017')\nm = geemap.Map()\nm.set_center(12.17, 20.96, 3)\nm.add_layer(fc, {}, 'ecoregions')\ndisplay(m)\n```\n\nNote that as with image datasets, you can search for table datasets in the\n[Earth Engine Data Catalog](/earth-engine/datasets).\n\n### Random Samples\n\nTo get a collection of random points in a specified region, you can use:\n\n### Code Editor (JavaScript)\n\n```javascript\n// Define an arbitrary region in which to compute random points.\nvar region = ee.Geometry.Rectangle(-119.224, 34.669, -99.536, 50.064);\n\n// Create 1000 random points in the region.\nvar randomPoints = ee.FeatureCollection.randomPoints(region);\n\n// Display the points.\nMap.centerObject(randomPoints);\nMap.addLayer(randomPoints, {}, 'random points');\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# Define an arbitrary region in which to compute random points.\nregion = ee.Geometry.Rectangle(-119.224, 34.669, -99.536, 50.064)\n\n# Create 1000 random points in the region.\nrandom_points = ee.FeatureCollection.randomPoints(region)\n\n# Display the points.\nm = geemap.Map()\nm.center_object(random_points)\nm.add_layer(random_points, {}, 'random points')\ndisplay(m)\n```"]]