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

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

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

Geometry.getCoordinateDimension介绍

[英]Returns the coordinate dimension, i.e. the dimension of the space that the geometry is embedded in.
[中]返回坐标标注,即几何图形嵌入的空间的标注。

代码示例

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

@Override
public int getCoordinateDimension() {
  return members.get( 0 ).getCoordinateDimension();
}

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

@Override
public int getCoordinateDimension() {
  return getReferencedObject().getCoordinateDimension();
}

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

@Override
public boolean visitGeometry( Geometry geom ) {
  if ( geom.getCoordinateSystem() != null && geom.getCoordinateDimension() != 1 ) {
    try {
      geom.getCoordinateSystem();
    } catch ( Exception e ) {
      throw new IllegalArgumentException( e.getMessage() );
    }
  }
  return true;
}

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

int dim =geom.getCoordinateDimension();
if (dim == 3){
  flags.add( WKTWriter.WKTFlag.USE_3D );

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

public static byte[] write( Geometry geom )
            throws ParseException {
  if ( geom instanceof GeometryReference ) {
    geom = ( (GeometryReference<Geometry>) geom ).getReferencedObject();
  }
  // com.vividsolutions.jts.io.WKBWriter is not thread safe
  int dim = geom.getCoordinateDimension();
  return new com.vividsolutions.jts.io.WKBWriter(dim).write( ( (AbstractDefaultGeometry) geom ).getJTSGeometry() );
}

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

@Override
public Geometry inspect( Geometry geom )
            throws GeometryInspectionException {
  ICRS crs = geom.getCoordinateSystem();
  if ( crs != null ) {
    ICRS cs = crs;
    int csDim = cs.getDimension();
    int coordDim = geom.getCoordinateDimension();
    if ( csDim != coordDim ) {
      String msg = "Geometry is invalid. Dimensionality of coordinates (=" + coordDim
             + ") does not match dimensionality of CRS '" + crs.getAlias() + "' (=" + csDim + ").";
      throw new GeometryInspectionException( msg );
    }
  }
  return geom;
}

代码示例来源: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;
}

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

if ( currentGeom != null && currentGeom.getCoordinateDimension() != geom.getCoordinateDimension() ) {
  String msg = "Cannot replace given geometry property '" + prop.getType().getName()
         + "' with given value (wrong dimension).";

相关文章