org.deegree.geometry.Geometry.setCoordinateSystem()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(2.0k)|赞(0)|评价(0)|浏览(158)

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

Geometry.setCoordinateSystem介绍

[英]Sets the associated spatial reference system.
[中]设置关联的空间参照系。

代码示例

代码示例来源:origin: deegree/deegree3

@Override
public void setCoordinateSystem( ICRS crs ) {
  getReferencedObject().setCoordinateSystem( crs );
}

代码示例来源:origin: deegree/deegree3

/**
 * Sets the {@link CRS} for all geometries contained in the given {@link Filter} that do not have crs information.
 * 
 * @param filter
 *            filter to process, must not be <code>null</code>
 * @param crs
 *            crs to set, must not be <code>null</code>
 */
public static void setDefaultCRS( Filter filter, ICRS crs ) {
  for ( Geometry geom : getGeometries( filter ) ) {
    if ( geom.getCoordinateSystem() == null ) {
      // TODO propagate to deeper levels / change behavior of setCoordinateSystem()
      geom.setCoordinateSystem( crs );
    }
  }
}

代码示例来源:origin: deegree/deegree3

private <T extends Geometry> T transformLinearized( T g ) {
  if ( g instanceof Surface ) {
    @SuppressWarnings("unchecked")
    T g2 = (T) transform( linearizer.linearize( (Surface) g, new NumPointsCriterion( 100 ) ) );
    g2.setCoordinateSystem( g.getCoordinateSystem() );
    return g2;
  }
  if ( g instanceof Curve ) {
    @SuppressWarnings("unchecked")
    T g2 = (T) transform( linearizer.linearize( (Curve) g, new NumPointsCriterion( 100 ) ) );
    g2.setCoordinateSystem( g.getCoordinateSystem() );
    return g2;
  }
  return null;
}

代码示例来源:origin: deegree/deegree3

private Geometry transformGeometry( Geometry value, GeometryTransformer transformer )
            throws IllegalArgumentException, TransformationException {
  Geometry transformed = value;
  if ( transformed.getCoordinateSystem() == null ) {
    transformed.setCoordinateSystem( transformer.getTargetCRS() );
  } else {
    transformed = linearizer.linearize( value, crit );
    if ( !( transformed instanceof Point && transformed.getCoordinateDimension() == 1 ) ) {
      transformed = transformer.transform( transformed, transformed.getCoordinateSystem() );
    }
  }
  return transformed;
}

相关文章