org.geotools.referencing.CRS.getTemporalCRS()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(1.2k)|赞(0)|评价(0)|浏览(159)

本文整理了Java中org.geotools.referencing.CRS.getTemporalCRS()方法的一些代码示例,展示了CRS.getTemporalCRS()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。CRS.getTemporalCRS()方法的具体详情如下:
包路径:org.geotools.referencing.CRS
类名称:CRS
方法名:getTemporalCRS

CRS.getTemporalCRS介绍

[英]Returns the first temporal coordinate reference system found in the given CRS, or null if there is none.
[中]返回给定CRS中找到的第一个时间坐标系,如果没有,则返回null。

代码示例

代码示例来源:origin: geotools/geotools

  1. /**
  2. * Returns the first temporal coordinate reference system found in the given CRS, or {@code
  3. * null} if there is none.
  4. *
  5. * @param crs The coordinate reference system, or {@code null}.
  6. * @return The temporal CRS, or {@code null} if none.
  7. * @since 2.4
  8. */
  9. public static TemporalCRS getTemporalCRS(final CoordinateReferenceSystem crs) {
  10. if (crs instanceof TemporalCRS) {
  11. return (TemporalCRS) crs;
  12. }
  13. if (crs instanceof CompoundCRS) {
  14. final CompoundCRS cp = (CompoundCRS) crs;
  15. for (final CoordinateReferenceSystem c : cp.getCoordinateReferenceSystems()) {
  16. final TemporalCRS candidate = getTemporalCRS(c);
  17. if (candidate != null) {
  18. return candidate;
  19. }
  20. }
  21. }
  22. return null;
  23. }

代码示例来源:origin: org.geotools/gt2-coverage

  1. } else {
  2. this.coverage = coverage;
  3. temporalCRS = DefaultTemporalCRS.wrap(CRS.getTemporalCRS(crs));
  4. if (temporalCRS == null) {
  5. throw new IllegalArgumentException(

相关文章