Announcement: All noncommercial projects registered to use Earth Engine beforeApril 15, 2025 mustverify noncommercial eligibility to maintain access. If you have not verified by September 26, 2025, your access may be on hold.

ee.FeatureCollection.getNumber

  • Learn how to extract a numerical property from a FeatureCollection using thegetNumber method.

  • ThegetNumber method takes the property name as a string and returns anee.Number object in JavaScript or requires.getInfo() in Python for a standard number.

  • Examples in both JavaScript and Python demonstrate how to applygetNumber to retrieve a specific number property from a FeatureCollection.

Extract a property from a feature.

UsageReturns
FeatureCollection.getNumber(property)Number
ArgumentTypeDetails
this:objectElementThe feature to extract the property from.
propertyStringThe property to extract.

Examples

Code Editor (JavaScript)

// A FeatureCollection with a number property value.varfc=ee.FeatureCollection([]).set('number_property',1.5);// Fetch the number property value as an ee.Number object.print('Number property value as ee.Number',fc.getNumber('number_property'));

Python setup

See the Python Environment page for information on the Python API and usinggeemap for interactive development.

importeeimportgeemap.coreasgeemap

Colab (Python)

# A FeatureCollection with a number property value.fc=ee.FeatureCollection([]).set('number_property',1.5)# Fetch the number property value as an ee.Number object.display('Number property value as ee.Number:',fc.getNumber('number_property'))

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2023-10-06 UTC.