- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.geotools.resources.XArray.doResize()
方法的一些代码示例,展示了XArray.doResize()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XArray.doResize()
方法的具体详情如下:
包路径:org.geotools.resources.XArray
类名称:XArray
方法名:doResize
[英]Returns a new table which contains the same elements as array but with the length specified. If the desired length is longer than the initial length of the array table, the returned table will contain all the elements of array as well as the elements initialised to null at the end of the table. If, on the contrary, the desired length is shorter than the initial length of the array table, the table will be truncated (that is to say the surplus array elements will be forgotten). If the length of array is equal to length, then array will be returned as it stands.
[中]返回一个新表,该表包含与数组相同的元素,但具有指定的长度。如果所需的长度大于数组表的初始长度,则返回的表将包含数组的所有元素以及在表末尾初始化为null的元素。相反,如果所需的长度小于数组表的初始长度,则该表将被截断(也就是说,多余的数组元素将被忽略)。如果数组的长度等于length,那么数组将按原样返回。
代码示例来源:origin: org.geotools/gt-metadata
/**
* Returns an array containing the same elements as the given {@code array} but
* specified {@code length}, truncating or padding with zeros if necessary.
*
* @param array Array to copy.
* @param length Length of the desired array.
* @return A new array of the requested length, or {@code array} if the original
* array already have the requested length.
*/
public static int[] resize(final int[] array, final int length) {
return doResize(array, length);
}
代码示例来源:origin: org.geotools/gt-metadata
/**
* Returns an array containing the same elements as the given {@code array} but
* specified {@code length}, truncating or padding with zeros if necessary.
*
* @param array Array to copy.
* @param length Length of the desired array.
* @return A new array of the requested length, or {@code array} if the original
* array already have the requested length.
*/
public static double[] resize(final double[] array, final int length) {
return doResize(array, length);
}
代码示例来源:origin: org.geotools/gt-metadata
/**
* Returns an array containing the same elements as the given {@code array} but
* specified {@code length}, truncating or padding with zeros if necessary.
*
* @param array Array to copy.
* @param length Length of the desired array.
* @return A new array of the requested length, or {@code array} if the original
* array already have the requested length.
*/
public static boolean[] resize(final boolean[] array, final int length) {
return doResize(array, length);
}
代码示例来源:origin: org.geotools/gt-metadata
/**
* Returns an array containing the same elements as the given {@code array} but
* specified {@code length}, truncating or padding with zeros if necessary.
*
* @param array Array to copy.
* @param length Length of the desired array.
* @return A new array of the requested length, or {@code array} if the original
* array already have the requested length.
*/
public static byte[] resize(final byte[] array, final int length) {
return doResize(array, length);
}
代码示例来源:origin: org.geotools/gt-metadata
/**
* Returns an array containing the same elements as the given {@code array} but
* specified {@code length}, truncating or padding with zeros if necessary.
*
* @param array Array to copy.
* @param length Length of the desired array.
* @return A new array of the requested length, or {@code array} if the original
* array already have the requested length.
*/
public static float[] resize(final float[] array, final int length) {
return doResize(array, length);
}
代码示例来源:origin: org.geotools/gt-metadata
/**
* Returns an array containing the same elements as the given {@code array} but
* specified {@code length}, truncating or padding with zeros if necessary.
*
* @param array Array to copy.
* @param length Length of the desired array.
* @return A new array of the requested length, or {@code array} if the original
* array already have the requested length.
*/
public static long[] resize(final long[] array, final int length) {
return doResize(array, length);
}
代码示例来源:origin: org.geotools/gt-metadata
/**
* Returns an array containing the same elements as the given {@code array} but
* specified {@code length}, truncating or padding with zeros if necessary.
*
* @param array Array to copy.
* @param length Length of the desired array.
* @return A new array of the requested length, or {@code array} if the original
* array already have the requested length.
*/
public static short[] resize(final short[] array, final int length) {
return doResize(array, length);
}
代码示例来源:origin: org.geotools/gt-metadata
/**
* Returns an array containing the same elements as the given {@code array} but
* specified {@code length}, truncating or padding with zeros if necessary.
*
* @param array Array to copy.
* @param length Length of the desired array.
* @return A new array of the requested length, or {@code array} if the original
* array already have the requested length.
*/
public static char[] resize(final char[] array, final int length) {
return doResize(array, length);
}
代码示例来源:origin: org.geotools/gt2-metadata
/**
* Returns a new table which contains the same elements as
* {@code array} but with the {@code length} specified.
* If the desired {@code length} is longer than the initial
* length of the {@code array} table, the returned table will contain
* all the elements of {@code array} as well as the elements
* initialised to {@code null} at the end of the table. If, on the
* contrary, the desired {@code length} is shorter than the initial
* length of the {@code array} table, the table will be truncated
* (that is to say the surplus {@code array} elements will be
* forgotten). If the length of {@code array} is equal to
* {@code length}, then {@code array} will be returned as it
* stands.
*
* @param array Table to copy.
* @param length Length of the desired table.
* @return Table of the same type as {@code array}, of length
* {@code length} and containing the data from
* {@code array}.
*/
public static short[] resize(final short[] array, final int length) {
return (short[]) doResize(array, length);
}
代码示例来源:origin: org.geotools/gt2-metadata
/**
* Returns a new table which contains the same elements as
* {@code array} but with the {@code length} specified.
* If the desired {@code length} is longer than the initial
* length of the {@code array} table, the returned table will contain
* all the elements of {@code array} as well as the elements
* initialised to {@code null} at the end of the table. If, on the
* contrary, the desired {@code length} is shorter than the initial
* length of the {@code array} table, the table will be truncated
* (that is to say the surplus {@code array} elements will be
* forgotten). If the length of {@code array} is equal to
* {@code length}, then {@code array} will be returned as it
* stands.
*
* @param array Table to copy.
* @param length Length of the desired table.
* @return Table of the same type as {@code array}, of length
* {@code length} and containing the data from
* {@code array}.
*/
public static double[] resize(final double[] array, final int length) {
return (double[]) doResize(array, length);
}
代码示例来源:origin: org.geotools/gt2-metadata
/**
* Returns a new table which contains the same elements as
* {@code array} but with the {@code length} specified.
* If the desired {@code length} is longer than the initial
* length of the {@code array} table, the returned table will contain
* all the elements of {@code array} as well as the elements
* initialised to {@code null} at the end of the table. If, on the
* contrary, the desired {@code length} is shorter than the initial
* length of the {@code array} table, the table will be truncated
* (that is to say the surplus {@code array} elements will be
* forgotten). If the length of {@code array} is equal to
* {@code length}, then {@code array} will be returned as it
* stands.
*
* @param array Table to copy.
* @param length Length of the desired table.
* @return Table of the same type as {@code array}, of length
* {@code length} and containing the data from
* {@code array}.
*/
public static float[] resize(final float[] array, final int length) {
return (float[]) doResize(array, length);
}
代码示例来源:origin: org.geotools/gt2-metadata
/**
* Returns a new table which contains the same elements as
* {@code array} but with the {@code length} specified.
* If the desired {@code length} is longer than the initial
* length of the {@code array} table, the returned table will contain
* all the elements of {@code array} as well as the elements
* initialised to {@code null} at the end of the table. If, on the
* contrary, the desired {@code length} is shorter than the initial
* length of the {@code array} table, the table will be truncated
* (that is to say the surplus {@code array} elements will be
* forgotten). If the length of {@code array} is equal to
* {@code length}, then {@code array} will be returned as it
* stands.
*
* @param array Table to copy.
* @param length Length of the desired table.
* @return Table of the same type as {@code array}, of length
* {@code length} and containing the data from
* {@code array}.
*/
public static char[] resize(final char[] array, final int length) {
return (char[]) doResize(array, length);
}
代码示例来源:origin: org.geotools/gt2-metadata
/**
* Returns a new table which contains the same elements as
* {@code array} but with the {@code length} specified.
* If the desired {@code length} is longer than the initial
* length of the {@code array} table, the returned table will contain
* all the elements of {@code array} as well as the elements
* initialised to {@code null} at the end of the table. If, on the
* contrary, the desired {@code length} is shorter than the initial
* length of the {@code array} table, the table will be truncated
* (that is to say the surplus {@code array} elements will be
* forgotten). If the length of {@code array} is equal to
* {@code length}, then {@code array} will be returned as it
* stands.
*
* @param array Table to copy.
* @param length Length of the desired table.
* @return Table of the same type as {@code array}, of length
* {@code length} and containing the data from
* {@code array}.
*/
public static Object[] resize(final Object[] array, final int length) {
return (Object[]) doResize(array, length);
}
代码示例来源:origin: org.geotools/gt2-metadata
/**
* Returns a new table which contains the same elements as
* {@code array} but with the {@code length} specified.
* If the desired {@code length} is longer than the initial
* length of the {@code array} table, the returned table will contain
* all the elements of {@code array} as well as the elements
* initialised to {@code null} at the end of the table. If, on the
* contrary, the desired {@code length} is shorter than the initial
* length of the {@code array} table, the table will be truncated
* (that is to say the surplus {@code array} elements will be
* forgotten). If the length of {@code array} is equal to
* {@code length}, then {@code array} will be returned as it
* stands.
*
* @param array Table to copy.
* @param length Length of the desired table.
* @return Table of the same type as {@code array}, of length
* {@code length} and containing the data from
* {@code array}.
*/
public static long[] resize(final long[] array, final int length) {
return (long[]) doResize(array, length);
}
代码示例来源:origin: org.geotools/gt2-metadata
/**
* Returns a new table which contains the same elements as
* {@code array} but with the {@code length} specified.
* If the desired {@code length} is longer than the initial
* length of the {@code array} table, the returned table will contain
* all the elements of {@code array} as well as the elements
* initialised to {@code null} at the end of the table. If, on the
* contrary, the desired {@code length} is shorter than the initial
* length of the {@code array} table, the table will be truncated
* (that is to say the surplus {@code array} elements will be
* forgotten). If the length of {@code array} is equal to
* {@code length}, then {@code array} will be returned as it
* stands.
*
* @param array Table to copy.
* @param length Length of the desired table.
* @return Table of the same type as {@code array}, of length
* {@code length} and containing the data from
* {@code array}.
*/
public static int[] resize(final int[] array, final int length) {
return (int[]) doResize(array, length);
}
代码示例来源:origin: org.geotools/gt2-metadata
/**
* Returns a new table which contains the same elements as
* {@code array} but with the {@code length} specified.
* If the desired {@code length} is longer than the initial
* length of the {@code array} table, the returned table will contain
* all the elements of {@code array} as well as the elements
* initialised to {@code null} at the end of the table. If, on the
* contrary, the desired {@code length} is shorter than the initial
* length of the {@code array} table, the table will be truncated
* (that is to say the surplus {@code array} elements will be
* forgotten). If the length of {@code array} is equal to
* {@code length}, then {@code array} will be returned as it
* stands.
*
* @param array Table to copy.
* @param length Length of the desired table.
* @return Table of the same type as {@code array}, of length
* {@code length} and containing the data from
* {@code array}.
*/
public static byte[] resize(final byte[] array, final int length) {
return (byte[]) doResize(array, length);
}
代码示例来源:origin: org.geotools/gt2-metadata
/**
* Returns a new table which contains the same elements as
* {@code array} but with the {@code length} specified.
* If the desired {@code length} is longer than the initial
* length of the {@code array} table, the returned table will contain
* all the elements of {@code array} as well as the elements
* initialised to {@code null} at the end of the table. If, on the
* contrary, the desired {@code length} is shorter than the initial
* length of the {@code array} table, the table will be truncated
* (that is to say the surplus {@code array} elements will be
* forgotten). If the length of {@code array} is equal to
* {@code length}, then {@code array} will be returned as it
* stands.
*
* @param array Table to copy.
* @param length Length of the desired table.
* @return Table of the same type as {@code array}, of length
* {@code length} and containing the data from
* {@code array}.
*/
public static boolean[] resize(final boolean[] array, final int length) {
return (boolean[]) doResize(array, length);
}
代码示例来源:origin: org.geotools/gt-metadata
/**
* Returns an array containing the same elements as the given {@code array} but with the
* specified {@code length}, truncating or padding with {@code null} if necessary.
* <ul>
* <li><p>If the given {@code length} is longer than the length of the given {@code array},
* then the returned array will contain all the elements of {@code array} at index
* <var>i</var> < {@code array.length}. Elements at index <var>i</var> >=
* {@code array.length} are initialized to {@code null}.</p></li>
*
* <li><p>If the given {@code length} is shorter than the length of the given {@code array},
* then the returned array will contain only the elements of {@code array} at index
* <var>i</var> < {@code length}. Remainding elements are not copied.</p></li>
*
* <li><p>If the given {@code length} is equals to the length of the given {@code array},
* then {@code array} is returned unchanged. <strong>No copy</strong> is performed.
* This behavior is what make this method different than {@link Arrays#copyOf}.</p></li>
*
* @param <E> The array elements.
* @param array Array to copy.
* @param length Length of the desired array.
* @return A new array of the requested length, or {@code array} if the original
* array already have the requested length.
*
* @see Arrays#copyOf(Object[],int)
*/
public static <E> E[] resize(final E[] array, final int length) {
return doResize(array, length);
}
假设我有以下二维数组 >>> import numpy as np >>> budgets = np.array([ [np.nan, 450.], [500. , 10
我正在尝试读取单个 WRF 的时间序列输出变量。时间序列是分布式的,每个文件一个时间戳,跨越 5000 多个 netCDF 文件。每个文件包含大约 200 个变量。 有没有办法只为我感兴趣的变量调用
我有一个相当大的 xr.Dataset,其中包含大约 20 个数据变量。我只对保留其中两个感兴趣。我看到 xr.Dataset.drop带有数据集的删除变量。 我正在寻找保留变量的语法。我尝试了 f[
我正在尝试计算 xarray 数据集中时间维度子集的每月气候。时间是使用 datetime64 定义的。 如果我想使用整个时间序列,这很好用: monthly_avr=ds_clm.groupby('
我有一个空间数据的 pandas 数据框,我想将其转换为 netCDF。我找到了 xarray 并将我的数据帧转换为 xarray 数据集的方法: # create xray Dataset from
我有一个名为 rio 的 DataArray 对象。 In [59]: rio Out[59]: array([[[0, 0, ..., 0, 0], [0, 0, ..., 0,
我目前正在尝试将一个大的多维数组 (>5 GB) 加载到 python 脚本中。由于我将数组用作机器学习模型的训练数据,因此以小批量高效加载数据非常重要,但要避免将整个数据集加载到内存中一次。 我的想
假设我有一个 dataset类型 xarray.Dataset .我有一个名为 name 的维度,(由 DataArray 中的所有 Dataset 共享,但我认为这对这个问题并不重要,)我想选择一个
我想读入 https://hrrrzarr.s3.amazonaws.com/index.html#sfc/20210208/20210208_00z_anl.zarr/ 的远程 zarr 存储。 z
我想获取栅格(卫星图像)数据,并构建一个Dataset 或DataArray,以加快我的图像处理速度(我必须处理多-波段,多日期卫星图像很多)。 数据来自每个图像日期的单独波段,我了解如何将每个波段日
所以我有 3 个 netcdf4 文件(每个大约 90 MB),我想使用包 xarray 将它们连接起来。每个文件都有一个变量 (dis),以 0.5 度分辨率(纬度、经度)表示 365 天(时间)。
对于我的数据数组,我有坐标经度、纬度和时间。我只想沿纬度反转数组,以便 [90, 85, ..., -85, -90]变成 [-90, -80, ..., 85, 90] . 最佳答案 同意@jham
完成 MetPy 横截面示例后,我尝试将该示例推广到 NCEP NAM-12km GRIB2 文件,但未成功。通过将我的文件的 DataArray 与示例文件(netCDF 文件)进行比较,我发现 x
我正在使用 xarray.apply_ufunc() 将函数应用于 xarray.DataArray .它适用于某些 NetCDF,但在尺寸、坐标等方面似乎具有可比性的其他 NetCDF 会失败。但是
是否也可以创建一个核外 DataArray,并使用 xarray 将其逐块写入 NetCDF4 文件? 例如,当维度更大时,我希望能够以核外方式执行此操作,因此我无法将整个数组存储在内存中: num_
我有一个数据数组arr,坐标为“时间”。到达: array([244.40161, 244.39998, ..., 244.40936, 244.40549], dtype=float32)
我有一个数据数组arr,坐标为“时间”。到达: array([244.40161, 244.39998, ..., 244.40936, 244.40549], dtype=float32)
我是新手,我使用的是XARRAY。我的netcdf文件包含时间为‘天数自0001-01-01 00:00:00’的数据,日历类型为Julian。有谁知道将时间转换成标准日历的简单方法吗?。提前感谢:)
我是新手,我使用的是XARRAY。我的netcdf文件包含时间为‘天数自0001-01-01 00:00:00’的数据,日历类型为Julian。有谁知道将时间转换成标准日历的简单方法吗?。提前感谢:)
我是新手,我使用的是XARRAY。我的netcdf文件包含时间为‘天数自0001-01-01 00:00:00’的数据,日历类型为Julian。有谁知道将时间转换成标准日历的简单方法吗?。提前感谢:)
我是一名优秀的程序员,十分优秀!