ee.Geometry.Rectangle
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
आयताकार पॉलीगॉन की जानकारी देने वाला ee.Geometry बनाता है.
जब सभी आर्ग्युमेंट संख्याएं हों, तो सुविधा के लिए वैरग्स का इस्तेमाल किया जा सकता है. इससे, चार निर्देशांकों के हिसाब से EPSG:4326 पॉलीगॉन बनाए जा सकते हैं. जैसे, ee.Geometry.Rectangle(minLng, minLat, maxLng, maxLat).
इस्तेमाल | रिटर्न |
---|
ee.Geometry.Rectangle(coords, proj, geodesic, evenOdd) | Geometry.Rectangle |
आर्ग्यूमेंट | टाइप | विवरण |
---|
coords | List<Geometry>|List<List<Number>>|List<Number> | आयताकार के सबसे छोटे और सबसे बड़े कोने, GeoJSON 'पॉइंट' निर्देशांक के फ़ॉर्मैट में दो पॉइंट की सूची के तौर पर या किसी पॉइंट के बारे में बताने वाले दो ee.Geometry ऑब्जेक्ट की सूची के तौर पर या xMin, yMin, xMax, yMax के क्रम में चार संख्याओं की सूची के तौर पर. |
proj | अनुमान, ज़रूरी नहीं | इस ज्यामिति का प्रोजेक्शन. अगर कोई वैल्यू नहीं दी गई है, तो डिफ़ॉल्ट रूप से इनपुट ee.Geometry का प्रोजेक्शन या कोई ee.Geometry इनपुट न होने पर EPSG:4326 का इस्तेमाल किया जाता है. |
geodesic | बूलियन, ज़रूरी नहीं | अगर यह वैल्यू false है, तो प्रोजेक्शन में किनारे सीधे होते हैं. अगर यह सही है, तो पृथ्वी की सतह पर सबसे छोटे रास्ते का पालन करने के लिए, किनारों को घुमाया जाता है. डिफ़ॉल्ट रूप से, इनपुट की जियोडेसिक स्थिति या इनपुट के नंबर होने पर, यह true होता है. |
evenOdd | बूलियन, ज़रूरी नहीं | अगर यह सही है, तो पॉलीगॉन के अंदरूनी हिस्सों को सम/विषम नियम के हिसाब से तय किया जाएगा. इसमें, कोई पॉइंट अंदरूनी हिस्सा तब माना जाएगा, जब वह अनंत में मौजूद पॉइंट तक पहुंचने के लिए, विषम संख्या में किनारों को पार करता हो. ऐसा न होने पर, पॉलीगॉन, लेफ़्ट-इनसाइड नियम का इस्तेमाल करते हैं. इसमें, दिए गए क्रम में वर्टिसेस को वॉक करते समय, अंदरूनी हिस्से शेल के किनारों की बाईं ओर होते हैं. अगर कोई वैल्यू नहीं दी गई है, तो डिफ़ॉल्ट रूप से इसकी वैल्यू 'सही है' पर सेट होती है. |
उदाहरण
कोड एडिटर (JavaScript)
// Coordinates for the bounds of a rectangle.
var xMin = -122.09;
var yMin = 37.42;
var xMax = -122.08;
var yMax = 37.43;
// Construct a rectangle from a list of GeoJSON 'point' formatted coordinates.
var rectangleGeoJSON = ee.Geometry.Rectangle(
[
[xMin, yMin],
[xMax, yMax] // max x and y
]
);
Map.addLayer(rectangleGeoJSON, {}, 'rectangleGeoJSON');
// Construct a rectangle from a list of ee.Geometry.Point objects.
var rectanglePoint = ee.Geometry.Rectangle(
[
ee.Geometry.Point(xMin, yMin), // min x and y
ee.Geometry.Point(xMax, yMax) // max x and y
]
);
Map.addLayer(rectanglePoint, {}, 'rectanglePoint');
// Construct a rectangle from a list of bounding coordinates.
var rectangleBounds = ee.Geometry.Rectangle(
[xMin, yMin, xMax, yMax]
);
Map.addLayer(rectangleBounds, {}, 'rectangleBounds');
Map.setCenter(-122.085, 37.422, 15);
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-07-25 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-07-25 (UTC) को अपडेट किया गया."],[[["\u003cp\u003eDefines a rectangular polygon geometry in Earth Engine.\u003c/p\u003e\n"],["\u003cp\u003eAccepts coordinates as GeoJSON points, Earth Engine points, or bounding numbers.\u003c/p\u003e\n"],["\u003cp\u003eAllows specifying projection, geodesic nature, and polygon interior rules.\u003c/p\u003e\n"],["\u003cp\u003eProvides a convenient way to create EPSG:4326 polygons with four coordinates directly.\u003c/p\u003e\n"]]],[],null,["# ee.Geometry.Rectangle\n\n\u003cbr /\u003e\n\nConstructs an ee.Geometry describing a rectangular polygon.\n\n\u003cbr /\u003e\n\nFor convenience, varargs may be used when all arguments are numbers. This allows creating EPSG:4326 Polygons given exactly four coordinates, e.g. ee.Geometry.Rectangle(minLng, minLat, maxLng, maxLat).\n\n| Usage | Returns |\n|------------------------------------------------------------------------|--------------------|\n| `ee.Geometry.Rectangle(coords, `*proj* `, `*geodesic* `, `*evenOdd*`)` | Geometry.Rectangle |\n\n| Argument | Type | Details |\n|------------|----------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `coords` | List\\\u003cGeometry\\\u003e\\|List\\\u003cList\\\u003cNumber\\\u003e\\\u003e\\|List\\\u003cNumber\\\u003e | The minimum and maximum corners of the rectangle, as a list of two points each in the format of GeoJSON 'Point' coordinates, or a list of two ee.Geometry objects describing a point, or a list of four numbers in the order xMin, yMin, xMax, yMax. |\n| `proj` | Projection, optional | The projection of this geometry. If unspecified, the default is the projection of the input ee.Geometry, or EPSG:4326 if there are no ee.Geometry inputs. |\n| `geodesic` | Boolean, optional | If false, edges are straight in the projection. If true, edges are curved to follow the shortest path on the surface of the Earth. The default is the geodesic state of the inputs, or true if the inputs are numbers. |\n| `evenOdd` | Boolean, optional | If true, polygon interiors will be determined by the even/odd rule, where a point is inside if it crosses an odd number of edges to reach a point at infinity. Otherwise polygons use the left- inside rule, where interiors are on the left side of the shell's edges when walking the vertices in the given order. If unspecified, defaults to true. |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\n// Coordinates for the bounds of a rectangle.\nvar xMin = -122.09;\nvar yMin = 37.42;\nvar xMax = -122.08;\nvar yMax = 37.43;\n\n// Construct a rectangle from a list of GeoJSON 'point' formatted coordinates.\nvar rectangleGeoJSON = ee.Geometry.Rectangle(\n [\n [xMin, yMin],\n [xMax, yMax] // max x and y\n ]\n);\nMap.addLayer(rectangleGeoJSON, {}, 'rectangleGeoJSON');\n\n// Construct a rectangle from a list of ee.Geometry.Point objects.\nvar rectanglePoint = ee.Geometry.Rectangle(\n [\n ee.Geometry.Point(xMin, yMin), // min x and y\n ee.Geometry.Point(xMax, yMax) // max x and y\n ]\n);\nMap.addLayer(rectanglePoint, {}, 'rectanglePoint');\n\n// Construct a rectangle from a list of bounding coordinates.\nvar rectangleBounds = ee.Geometry.Rectangle(\n [xMin, yMin, xMax, yMax]\n);\nMap.addLayer(rectangleBounds, {}, 'rectangleBounds');\n\nMap.setCenter(-122.085, 37.422, 15);\n```"]]