ee.FeatureCollection.runBigQuery
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
यह BigQuery क्वेरी चलाता है, नतीजे फ़ेच करता है, और उन्हें FeatureCollection के तौर पर दिखाता है.
इस्तेमाल | रिटर्न |
---|
ee.FeatureCollection.runBigQuery(query, geometryColumn, maxBytesBilled) | FeatureCollection |
आर्ग्यूमेंट | टाइप | विवरण |
---|
query | स्ट्रिंग | BigQuery संसाधनों पर लागू की जाने वाली GoogleSQL क्वेरी. |
geometryColumn | स्ट्रिंग, डिफ़ॉल्ट: null | मुख्य फ़ीचर की ज्यामिति के तौर पर इस्तेमाल किए जाने वाले कॉलम का नाम. अगर यह जानकारी नहीं दी गई है, तो पहले ज्यामिति कॉलम का इस्तेमाल किया जाएगा. |
maxBytesBilled | लॉन्ग, डिफ़ॉल्ट: 100000000000 | क्वेरी प्रोसेस करते समय, ज़्यादा से ज़्यादा कितने बाइट के लिए शुल्क लिया गया. इस सीमा से ज़्यादा समय लेने वाली कोई भी BigQuery जॉब पूरी नहीं होगी और उसका शुल्क नहीं लिया जाएगा. |
उदाहरण
कोड एडिटर (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 API के बारे में जानकारी पाने और इंटरैक्टिव डेवलपमेंट के लिए geemap
का इस्तेमाल करने के लिए,
Python एनवायरमेंट पेज देखें.
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 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-07-25 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-07-25 (UTC) को अपडेट किया गया."],[],[],null,[]]