שליחת משוב
ee.FeatureCollection.runBigQuery
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
מריצים שאילתה ב-BigQuery, מאחזרים את התוצאות ומציגים אותן כ-FeatureCollection.
שימוש החזרות ee.FeatureCollection.runBigQuery(query, geometryColumn , maxBytesBilled )
FeatureCollection
ארגומנט סוג פרטים query
מחרוזת שאילתת GoogleSQL לביצוע במשאבי BigQuery. geometryColumn
מחרוזת, ברירת המחדל: null השם של העמודה שישמשת כגיאומטריה של המאפיין הראשי. אם לא מציינים ערך, המערכת משתמשת בעמודת הגיאומטריה הראשונה. maxBytesBilled
ארוך, ברירת המחדל: 100000000000 מספר הבייטים המקסימלי שחויב במהלך עיבוד השאילתה. כל משימה ב-BigQuery שתחרוג מהמגבלה הזו תיכשל ולא תחויב.
דוגמאות
Code Editor (JavaScript)
// Get places from Overture Maps Dataset in BigQuery public data.
Map . setCenter ( - 3.69 , 40.41 , 12 )
var mapGeometry = ee . Geometry ( Map . getBounds ( true )). toGeoJSONString ();
var sql =
"SELECT geometry, names.primary as name, categories.primary as category "
+ " FROM bigquery-public-data.overture_maps.place "
+ " WHERE ST_INTERSECTS(geometry, ST_GEOGFROMGEOJSON('" + mapGeometry + "'))" ;
var features = ee . FeatureCollection . runBigQuery ({
query : sql ,
geometryColumn : 'geometry'
});
// Display all relevant features on the map.
Map . addLayer ( features ,
{ 'color' : 'black' },
'Places from Overture Maps Dataset' );
// Create a histogram of the categories and print it.
var propertyOfInterest = 'category' ;
var histogram = features . filter ( ee . Filter . notNull ([ propertyOfInterest ]))
. aggregate_histogram ( propertyOfInterest );
print ( histogram );
// Create a frequency chart for the histogram.
var categories = histogram . keys (). map ( function ( k ) {
return ee . Feature ( null , {
key : k ,
value : histogram . get ( k )
});
});
var sortedCategories = ee . FeatureCollection ( categories ). sort ( 'value' , false );
print ( ui . Chart . feature . byFeature ( sortedCategories ). setChartType ( 'Table' ));
הגדרת Python
בדף
סביבת Python מפורט מידע על Python API ועל השימוש ב-geemap
לפיתוח אינטראקטיבי.
import ee
import geemap.core as geemap
Colab (Python)
import json
import pandas as pd
# Get places from Overture Maps Dataset in BigQuery public data.
location = ee . Geometry . Point ( - 3.69 , 40.41 )
map_geometry = json . dumps ( location . buffer ( 5e3 ) . getInfo ())
sql = f """SELECT geometry, names.primary as name, categories.primary as category
FROM bigquery-public-data.overture_maps.place
WHERE ST_INTERSECTS(geometry, ST_GEOGFROMGEOJSON(' { map_geometry } '))"""
features = ee . FeatureCollection . runBigQuery (
query = sql , geometryColumn = "geometry"
)
# Display all relevant features on the map.
m = geemap . Map ()
m . center_object ( location , 13 )
m . add_layer ( features , { 'color' : 'black' }, 'Places from Overture Maps Dataset' )
display ( m )
# Create a histogram of the place categories.
property_of_interest = 'category'
histogram = (
features . filter (
ee . Filter . notNull ([ property_of_interest ])
) . aggregate_histogram ( property_of_interest )
) . getInfo ()
# Display the histogram as a pandas DataFrame.
df = pd . DataFrame ( list ( histogram . items ()), columns = [ 'category' , 'frequency' ])
df = df . sort_values ( by = [ 'frequency' ], ascending = False , ignore_index = True )
display ( df )
שליחת משוב
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0 . לפרטים, ניתן לעיין במדיניות האתר Google Developers . Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-25 (שעון UTC).
רוצה לתת לנו משוב?
[[["התוכן קל להבנה","easyToUnderstand","thumb-up"],["התוכן עזר לי לפתור בעיה","solvedMyProblem","thumb-up"],["סיבה אחרת","otherUp","thumb-up"]],[["חסרים לי מידע או פרטים","missingTheInformationINeed","thumb-down"],["התוכן מורכב מדי או עם יותר מדי שלבים","tooComplicatedTooManySteps","thumb-down"],["התוכן לא עדכני","outOfDate","thumb-down"],["בעיה בתרגום","translationIssue","thumb-down"],["בעיה בדוגמאות/בקוד","samplesCodeIssue","thumb-down"],["סיבה אחרת","otherDown","thumb-down"]],["עדכון אחרון: 2025-07-25 (שעון UTC)."],[],[]]