공지사항:
2025년 4월 15일 전에 Earth Engine 사용을 위해 등록된 모든 비상업용 프로젝트는 Earth Engine 액세스를 유지하기 위해
비상업용 자격 요건을 인증해야 합니다.
ee.Filter.lessThanOrEquals
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
왼쪽 피연산자가 오른쪽 피연산자보다 크지 않으면 통과하는 단항 또는 이항 필터를 만듭니다.
사용 | 반환 값 |
---|
ee.Filter.lessThanOrEquals(leftField, rightValue, rightField, leftValue) | 필터 |
인수 | 유형 | 세부정보 |
---|
leftField | 문자열, 기본값: null | 왼쪽 피연산자의 선택기입니다. leftValue가 지정된 경우 지정하면 안 됩니다. |
rightValue | 객체, 기본값: null | 오른쪽 피연산자의 값입니다. rightField가 지정된 경우 지정하면 안 됩니다. |
rightField | 문자열, 기본값: null | 오른쪽 피연산자의 선택기입니다. rightValue가 지정된 경우 지정하면 안 됩니다. |
leftValue | 객체, 기본값: null | 왼쪽 피연산자의 값입니다. leftField가 지정된 경우 지정하면 안 됩니다. |
예
코드 편집기 (JavaScript)
// Field site vegetation characteristics from projects in western USA.
var fc = ee.FeatureCollection('BLM/AIM/v1/TerrADat/TerrestrialAIM')
.filter('ProjectName == "Colorado NWDO Kremmling FO 2016"');
// Display field plots on the map.
Map.setCenter(-107.792, 39.871, 7);
Map.addLayer(fc);
// Compare the per-feature values of two properties and filter the collection
// based on the results of various relational expressions. The two properties
// to compare are invasive and non-invasive annual forb cover at each plot.
var leftProperty = 'InvAnnForbCover_AH';
var rightProperty = 'NonInvAnnForbCover_AH';
print('Plots where invasive forb cover is…');
print('…EQUAL to non-invasive cover',
fc.filter(ee.Filter.equals(
{leftField: leftProperty, rightField: rightProperty})));
print('…NOT EQUAL to non-invasive cover',
fc.filter(ee.Filter.notEquals(
{leftField: leftProperty, rightField: rightProperty})));
print('…LESS THAN non-invasive cover',
fc.filter(ee.Filter.lessThan(
{leftField: leftProperty, rightField: rightProperty})));
print('…LESS THAN OR EQUAL to non-invasive cover',
fc.filter(ee.Filter.lessThanOrEquals(
{leftField: leftProperty, rightField: rightProperty})));
print('…GREATER THAN non-invasive cover',
fc.filter(ee.Filter.greaterThan(
{leftField: leftProperty, rightField: rightProperty})));
print('…GREATER THAN OR EQUAL to non-invasive cover',
fc.filter(ee.Filter.greaterThanOrEquals(
{leftField: leftProperty, rightField: rightProperty})));
print('…is not greater than 10 percent different than non-invasive cover',
fc.filter(ee.Filter.maxDifference(
{difference: 10, leftField: leftProperty, rightField: rightProperty})));
// Instead of comparing values of two feature properties using the leftField
// and rightField parameters, you can compare a property value (leftProperty)
// against a constant value (rightValue).
print('Plots where invasive forb cover is greater than 20%',
fc.filter(ee.Filter.greaterThan(
{leftField: leftProperty, rightValue: 20})));
// You can also swap the operands to assign the constant to the left side of
// the relational expression (leftValue) and the feature property on the right
// (rightField). Here, we get the complement of the previous example.
print('Plots where 20% is greater than invasive forb cover.',
fc.filter(ee.Filter.greaterThan(
{leftValue: 20, rightField: leftProperty})));
// Binary filters are useful in joins. For example, group all same-site plots
// together using a saveAll join.
var groupingProp = 'SiteID';
var sitesFc = fc.distinct(groupingProp);
var joinFilter = ee.Filter.equals(
{leftField: groupingProp, rightField: groupingProp});
var groupedPlots = ee.Join.saveAll('site_plots').apply(sitesFc, fc, joinFilter);
print('List of plots in first site', groupedPlots.first().get('site_plots'));
Python 설정
Python API 및 geemap
를 사용한 대화형 개발에 관한 자세한 내용은
Python 환경 페이지를 참고하세요.
import ee
import geemap.core as geemap
Colab (Python)
# Field site vegetation characteristics from projects in western USA.
fc = ee.FeatureCollection('BLM/AIM/v1/TerrADat/TerrestrialAIM').filter(
'ProjectName == "Colorado NWDO Kremmling FO 2016"'
)
# Display field plots on the map.
m = geemap.Map()
m.set_center(-107.792, 39.871, 7)
m.add_layer(fc)
display(m)
# Compare the per-feature values of two properties and filter the collection
# based on the results of various relational expressions. The two properties
# to compare are invasive and non-invasive annual forb cover at each plot.
left_property = 'InvAnnForbCover_AH'
right_property = 'NonInvAnnForbCover_AH'
display('Plots where invasive forb cover is…')
display(
'…EQUAL to non-invasive cover',
fc.filter(
ee.Filter.equals(leftField=left_property, rightField=right_property)
),
)
display(
'…NOT EQUAL to non-invasive cover',
fc.filter(
ee.Filter.notEquals(leftField=left_property, rightField=right_property)
),
)
display(
'…LESS THAN non-invasive cover',
fc.filter(
ee.Filter.lessThan(leftField=left_property, rightField=right_property)
),
)
display(
'…LESS THAN OR EQUAL to non-invasive cover',
fc.filter(
ee.Filter.lessThanOrEquals(
leftField=left_property, rightField=right_property
)
),
)
display(
'…GREATER THAN non-invasive cover',
fc.filter(
ee.Filter.greaterThan(
leftField=left_property, rightField=right_property
)
),
)
display(
'…GREATER THAN OR EQUAL to non-invasive cover',
fc.filter(
ee.Filter.greaterThanOrEquals(
leftField=left_property, rightField=right_property
)
),
)
display(
'…is not greater than 10 percent different than non-invasive cover',
fc.filter(
ee.Filter.maxDifference(
difference=10, leftField=left_property, rightField=right_property
)
),
)
# Instead of comparing values of two feature properties using the leftField
# and rightField parameters, you can compare a property value (left_property)
# against a constant value (rightValue).
display(
'Plots where invasive forb cover is greater than 20%',
fc.filter(ee.Filter.greaterThan(leftField=left_property, rightValue=20)),
)
# You can also swap the operands to assign the constant to the left side of
# the relational expression (leftValue) and the feature property on the right
# (rightField). Here, we get the complement of the previous example.
display(
'Plots where 20% is greater than invasive forb cover.',
fc.filter(ee.Filter.greaterThan(leftValue=20, rightField=left_property)),
)
# Binary filters are useful in joins. For example, group all same-site plots
# together using a saveAll join.
grouping_prop = 'SiteID'
sites_fc = fc.distinct(grouping_prop)
join_filter = ee.Filter.equals(
leftField=grouping_prop, rightField=grouping_prop
)
grouped_plots = ee.Join.saveAll('site_plots').apply(sites_fc, fc, join_filter)
display('List of plots in first site', grouped_plots.first().get('site_plots'))
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-26(UTC)
[null,null,["최종 업데이트: 2025-07-26(UTC)"],[[["\u003cp\u003eCreates a filter that passes features unless the left operand is greater than the right operand.\u003c/p\u003e\n"],["\u003cp\u003eThe filter can be unary or binary, comparing a property to a constant or two properties.\u003c/p\u003e\n"],["\u003cp\u003eOperands are specified using \u003ccode\u003eleftField\u003c/code\u003e, \u003ccode\u003erightValue\u003c/code\u003e, \u003ccode\u003erightField\u003c/code\u003e, and \u003ccode\u003eleftValue\u003c/code\u003e parameters.\u003c/p\u003e\n"],["\u003cp\u003eUseful for filtering FeatureCollections based on property comparisons.\u003c/p\u003e\n"],["\u003cp\u003eCan be used in joins to group features based on shared properties.\u003c/p\u003e\n"]]],["The content describes creating filters using `ee.Filter` for comparing data. This involves using methods like `equals`, `notEquals`, `lessThan`, `lessThanOrEquals`, `greaterThan`, `greaterThanOrEquals`, and `maxDifference` to filter a FeatureCollection based on property comparisons. These comparisons can be between two fields (e.g., `leftField`, `rightField`) or a field and a constant value (e.g., `leftField`, `rightValue`). These filters are used to filter collections and are also used in joins.\n"],null,["# ee.Filter.lessThanOrEquals\n\nCreates a unary or binary filter that passes unless the left operand is greater than the right operand.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|-----------------------------------------------------------------------------------------------|---------|\n| `ee.Filter.lessThanOrEquals(`*leftField* `, `*rightValue* `, `*rightField* `, `*leftValue*`)` | Filter |\n\n| Argument | Type | Details |\n|--------------|-----------------------|---------------------------------------------------------------------------------------|\n| `leftField` | String, default: null | A selector for the left operand. Should not be specified if leftValue is specified. |\n| `rightValue` | Object, default: null | The value of the right operand. Should not be specified if rightField is specified. |\n| `rightField` | String, default: null | A selector for the right operand. Should not be specified if rightValue is specified. |\n| `leftValue` | Object, default: null | The value of the left operand. Should not be specified if leftField is specified. |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\n// Field site vegetation characteristics from projects in western USA.\nvar fc = ee.FeatureCollection('BLM/AIM/v1/TerrADat/TerrestrialAIM')\n .filter('ProjectName == \"Colorado NWDO Kremmling FO 2016\"');\n\n// Display field plots on the map.\nMap.setCenter(-107.792, 39.871, 7);\nMap.addLayer(fc);\n\n// Compare the per-feature values of two properties and filter the collection\n// based on the results of various relational expressions. The two properties\n// to compare are invasive and non-invasive annual forb cover at each plot.\nvar leftProperty = 'InvAnnForbCover_AH';\nvar rightProperty = 'NonInvAnnForbCover_AH';\n\nprint('Plots where invasive forb cover is...');\n\nprint('...EQUAL to non-invasive cover',\n fc.filter(ee.Filter.equals(\n {leftField: leftProperty, rightField: rightProperty})));\n\nprint('...NOT EQUAL to non-invasive cover',\n fc.filter(ee.Filter.notEquals(\n {leftField: leftProperty, rightField: rightProperty})));\n\nprint('...LESS THAN non-invasive cover',\n fc.filter(ee.Filter.lessThan(\n {leftField: leftProperty, rightField: rightProperty})));\n\nprint('...LESS THAN OR EQUAL to non-invasive cover',\n fc.filter(ee.Filter.lessThanOrEquals(\n {leftField: leftProperty, rightField: rightProperty})));\n\nprint('...GREATER THAN non-invasive cover',\n fc.filter(ee.Filter.greaterThan(\n {leftField: leftProperty, rightField: rightProperty})));\n\nprint('...GREATER THAN OR EQUAL to non-invasive cover',\n fc.filter(ee.Filter.greaterThanOrEquals(\n {leftField: leftProperty, rightField: rightProperty})));\n\nprint('...is not greater than 10 percent different than non-invasive cover',\n fc.filter(ee.Filter.maxDifference(\n {difference: 10, leftField: leftProperty, rightField: rightProperty})));\n\n// Instead of comparing values of two feature properties using the leftField\n// and rightField parameters, you can compare a property value (leftProperty)\n// against a constant value (rightValue).\nprint('Plots where invasive forb cover is greater than 20%',\n fc.filter(ee.Filter.greaterThan(\n {leftField: leftProperty, rightValue: 20})));\n\n// You can also swap the operands to assign the constant to the left side of\n// the relational expression (leftValue) and the feature property on the right\n// (rightField). Here, we get the complement of the previous example.\nprint('Plots where 20% is greater than invasive forb cover.',\n fc.filter(ee.Filter.greaterThan(\n {leftValue: 20, rightField: leftProperty})));\n\n// Binary filters are useful in joins. For example, group all same-site plots\n// together using a saveAll join.\nvar groupingProp = 'SiteID';\nvar sitesFc = fc.distinct(groupingProp);\n\nvar joinFilter = ee.Filter.equals(\n {leftField: groupingProp, rightField: groupingProp});\n\nvar groupedPlots = ee.Join.saveAll('site_plots').apply(sitesFc, fc, joinFilter);\nprint('List of plots in first site', groupedPlots.first().get('site_plots'));\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# Field site vegetation characteristics from projects in western USA.\nfc = ee.FeatureCollection('BLM/AIM/v1/TerrADat/TerrestrialAIM').filter(\n 'ProjectName == \"Colorado NWDO Kremmling FO 2016\"'\n)\n\n# Display field plots on the map.\nm = geemap.Map()\nm.set_center(-107.792, 39.871, 7)\nm.add_layer(fc)\ndisplay(m)\n\n# Compare the per-feature values of two properties and filter the collection\n# based on the results of various relational expressions. The two properties\n# to compare are invasive and non-invasive annual forb cover at each plot.\nleft_property = 'InvAnnForbCover_AH'\nright_property = 'NonInvAnnForbCover_AH'\n\ndisplay('Plots where invasive forb cover is...')\n\ndisplay(\n '...EQUAL to non-invasive cover',\n fc.filter(\n ee.Filter.equals(leftField=left_property, rightField=right_property)\n ),\n)\n\ndisplay(\n '...NOT EQUAL to non-invasive cover',\n fc.filter(\n ee.Filter.notEquals(leftField=left_property, rightField=right_property)\n ),\n)\n\ndisplay(\n '...LESS THAN non-invasive cover',\n fc.filter(\n ee.Filter.lessThan(leftField=left_property, rightField=right_property)\n ),\n)\n\ndisplay(\n '...LESS THAN OR EQUAL to non-invasive cover',\n fc.filter(\n ee.Filter.lessThanOrEquals(\n leftField=left_property, rightField=right_property\n )\n ),\n)\n\ndisplay(\n '...GREATER THAN non-invasive cover',\n fc.filter(\n ee.Filter.greaterThan(\n leftField=left_property, rightField=right_property\n )\n ),\n)\n\ndisplay(\n '...GREATER THAN OR EQUAL to non-invasive cover',\n fc.filter(\n ee.Filter.greaterThanOrEquals(\n leftField=left_property, rightField=right_property\n )\n ),\n)\n\ndisplay(\n '...is not greater than 10 percent different than non-invasive cover',\n fc.filter(\n ee.Filter.maxDifference(\n difference=10, leftField=left_property, rightField=right_property\n )\n ),\n)\n\n# Instead of comparing values of two feature properties using the leftField\n# and rightField parameters, you can compare a property value (left_property)\n# against a constant value (rightValue).\ndisplay(\n 'Plots where invasive forb cover is greater than 20%',\n fc.filter(ee.Filter.greaterThan(leftField=left_property, rightValue=20)),\n)\n\n# You can also swap the operands to assign the constant to the left side of\n# the relational expression (leftValue) and the feature property on the right\n# (rightField). Here, we get the complement of the previous example.\ndisplay(\n 'Plots where 20% is greater than invasive forb cover.',\n fc.filter(ee.Filter.greaterThan(leftValue=20, rightField=left_property)),\n)\n\n# Binary filters are useful in joins. For example, group all same-site plots\n# together using a saveAll join.\ngrouping_prop = 'SiteID'\nsites_fc = fc.distinct(grouping_prop)\n\njoin_filter = ee.Filter.equals(\n leftField=grouping_prop, rightField=grouping_prop\n)\n\ngrouped_plots = ee.Join.saveAll('site_plots').apply(sites_fc, fc, join_filter)\ndisplay('List of plots in first site', grouped_plots.first().get('site_plots'))\n```"]]