قدّمت Earth Engine
فئات حصص غير تجارية لحماية موارد الحوسبة المشتركة وضمان أداء موثوق للجميع. تستخدم المشاريع غير التجارية "فئة المجتمع" تلقائيًا، ولكن يمكنك تغيير فئة المشروع في أي وقت.
Google uses AI technology to translate content into your preferred language. AI translations can contain errors.
ee.Date.unitRatio
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
تعرض نسبة طول وحدة إلى طول وحدة أخرى، على سبيل المثال، تعرِض unitRatio('day', 'minute') القيمة 1440. الوحدات الصالحة هي "سنة" و"شهر" و"أسبوع" و"يوم" و"ساعة" و"دقيقة" و"ثانية".
| الاستخدام | المرتجعات |
|---|
ee.Date.unitRatio(numerator, denominator) | عدد عائم |
| الوسيطة | النوع | التفاصيل |
|---|
numerator | سلسلة | |
denominator | سلسلة | |
أمثلة
محرِّر الرموز البرمجية (JavaScript)
print('Minutes in a day', ee.Date.unitRatio('day', 'minute'));
print('Seconds in a year', ee.Date.unitRatio('year', 'second'));
print('Years in a month', ee.Date.unitRatio('month', 'year'));
print('Hours in a week', ee.Date.unitRatio('week', 'hour'));
إعداد Python
اطّلِع على صفحة
بيئة Python للحصول على معلومات عن واجهة برمجة التطبيقات Python API واستخدام
geemap للتطوير التفاعلي.
import ee
import geemap.core as geemap
Colab (Python)
display('Minutes in a day:', ee.Date.unitRatio('day', 'minute'))
display('Seconds in a year:', ee.Date.unitRatio('year', 'second'))
display('Years in a month:', ee.Date.unitRatio('month', 'year'))
display('Hours in a week:', ee.Date.unitRatio('week', 'hour'))
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-07-25 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-25 (حسب التوقيت العالمي المتفَّق عليه)"],[],["The `unitRatio` function calculates the ratio between two time units. It accepts two string arguments: `numerator` and `denominator`, representing the desired units. Valid time units include 'year', 'month', 'week', 'day', 'hour', 'minute', and 'second'. The function returns a float value representing the ratio of the numerator to the denominator (e.g., how many minutes are in a day). Examples are provided in JavaScript and Python demonstrating various unit conversions.\n"]]