تجسم هندسه و اطلاعات
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
تجسم هندسه ها
برای تجسم یک هندسه، آن را به نقشه اضافه کنید. به عنوان مثال:
ویرایشگر کد (جاوا اسکریپت)
// Create a geodesic polygon.
var polygon = ee.Geometry.Polygon([
[[-5, 40], [65, 40], [65, 60], [-5, 60], [-5, 60]]
]);
// Create a planar polygon.
var planarPolygon = ee.Geometry(polygon, null, false);
// Display the polygons by adding them to the map.
Map.centerObject(polygon);
Map.addLayer(polygon, {color: 'FF0000'}, 'geodesic polygon');
Map.addLayer(planarPolygon, {color: '000000'}, 'planar polygon');
برای اطلاعات بیشتر در مورد تجسم، به تجسم ویژگی و مجموعه ویژگی مراجعه کنید.
برای مشاهده اطلاعات مربوط به یک هندسه، آن را چاپ کنید. برای دسترسی به اطلاعات به صورت برنامه ای، Earth Engine چندین روش ارائه می دهد. به عنوان مثال، برای دریافت اطلاعات در مورد چند ضلعی ایجاد شده قبلی، از:
ویرایشگر کد (جاوا اسکریپت)
print('Polygon printout: ', polygon);
// Print polygon area in square kilometers.
print('Polygon area: ', polygon.area().divide(1000 * 1000));
// Print polygon perimeter length in kilometers.
print('Polygon perimeter: ', polygon.perimeter().divide(1000));
// Print the geometry as a GeoJSON string.
print('Polygon GeoJSON: ', polygon.toGeoJSONString());
// Print the GeoJSON 'type'.
print('Geometry type: ', polygon.type());
// Print the coordinates as lists.
print('Polygon coordinates: ', polygon.coordinates());
// Print whether the geometry is geodesic.
print('Geodesic? ', polygon.geodesic());
توجه داشته باشید که محیط (یا طول) یک هندسه بر حسب متر برگردانده می شود و مساحت آن بر حسب متر مربع برمی گردد، مگر اینکه یک برآمدگی مشخص شده باشد. به طور پیش فرض، محاسبه بر روی کروی WGS84 انجام می شود و نتیجه بر حسب متر یا متر مربع محاسبه می شود.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eGeometries can be visualized on the map by adding them as layers with styling options like color.\u003c/p\u003e\n"],["\u003cp\u003eYou can retrieve information about a geometry such as area, perimeter, type, and coordinates programmatically using methods like \u003ccode\u003earea()\u003c/code\u003e, \u003ccode\u003eperimeter()\u003c/code\u003e, \u003ccode\u003etype()\u003c/code\u003e, and \u003ccode\u003ecoordinates()\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eGeometry calculations are performed on the WGS84 spheroid by default, with perimeter returned in meters and area in square meters.\u003c/p\u003e\n"],["\u003cp\u003eTo visualize geometries on the Earth Engine map, you can use \u003ccode\u003eMap.addLayer()\u003c/code\u003e with styling options.\u003c/p\u003e\n"],["\u003cp\u003eFor programmatic access to geometry data, Earth Engine provides methods for retrieving information like type, area, perimeter, and coordinates.\u003c/p\u003e\n"]]],["Geometries are visualized by adding them to the map using `Map.addLayer()`. Information about a geometry can be accessed by printing it. Specific details like area, perimeter, GeoJSON representation, type, coordinates, and geodesic properties are obtained via methods like `.area()`, `.perimeter()`, `.toGeoJSONString()`, `.type()`, `.coordinates()`, and `.geodesic()`. By default, perimeter and area are returned in meters and square meters, respectively, based on the WGS84 spheroid.\n"],null,["# Geometry Visualization and Information\n\nVisualizing geometries\n----------------------\n\nTo visualize a geometry, add it to the map. For example:\n\n### Code Editor (JavaScript)\n\n```javascript\n// Create a geodesic polygon.\nvar polygon = ee.Geometry.Polygon([\n [[-5, 40], [65, 40], [65, 60], [-5, 60], [-5, 60]]\n]);\n\n// Create a planar polygon.\nvar planarPolygon = ee.Geometry(polygon, null, false);\n\n// Display the polygons by adding them to the map.\nMap.centerObject(polygon);\nMap.addLayer(polygon, {color: 'FF0000'}, 'geodesic polygon');\nMap.addLayer(planarPolygon, {color: '000000'}, 'planar polygon');\n```\n\nFor more on visualizing, see [Feature and\nFeatureCollection Visualization](/earth-engine/guides/feature_collections_visualizing).\n\nGeometry information and metadata\n---------------------------------\n\nTo view information about a geometry, print it. To access the information\nprogrammatically, Earth Engine provides several methods. For example, to get information\nabout the polygon created previously, use:\n\n### Code Editor (JavaScript)\n\n```javascript\nprint('Polygon printout: ', polygon);\n\n// Print polygon area in square kilometers.\nprint('Polygon area: ', polygon.area().divide(1000 * 1000));\n\n// Print polygon perimeter length in kilometers.\nprint('Polygon perimeter: ', polygon.perimeter().divide(1000));\n\n// Print the geometry as a GeoJSON string.\nprint('Polygon GeoJSON: ', polygon.toGeoJSONString());\n\n// Print the GeoJSON 'type'.\nprint('Geometry type: ', polygon.type());\n\n// Print the coordinates as lists.\nprint('Polygon coordinates: ', polygon.coordinates());\n\n// Print whether the geometry is geodesic.\nprint('Geodesic? ', polygon.geodesic());\n```\n\nObserve that the perimeter (or length) of a geometry is returned in meters and the\narea is returned in square meters unless a projection is specified. By default, the\ncomputation is performed on the WGS84 spheroid and the result is computed in meters or\nsquare meters."]]