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

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

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

Geometry.contains介绍

[英]Tests whether this geometry contains the specified geometry. TODO formal explanation (DE9IM)
[中]测试此几何图形是否包含指定的几何图形。TODO正式解释(DE9IM)

代码示例

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

@Override
public boolean contains( Geometry geometry ) {
  return getReferencedObject().contains( geometry );
}

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

@Override
public <T> boolean evaluate( T obj, XPathEvaluator<T> xpathEvaluator )
            throws FilterEvaluationException {
  for ( TypedObjectNode paramValue : propName.evaluate( obj, xpathEvaluator ) ) {
    Geometry geom = checkGeometryOrNull( paramValue );
    if ( geom != null ) {
      Geometry transformedLiteral = getCompatibleGeometry( geom, geometry );
      return geom.contains( transformedLiteral );
    }
  }
  return false;
}

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

@Override
public void process( ProcessletInputs in, ProcessletOutputs out, ProcessletExecutionInfo info )
            throws ProcessletException {
  ComplexInput gmlInput1 = (ComplexInput) in.getParameter( "GMLInput1" );
  ComplexInput gmlInput2 = (ComplexInput) in.getParameter( "GMLInput2" );
  Geometry geometry1 = readGeometry( gmlInput1 );
  Geometry geometry2 = readGeometry( gmlInput2 );
  boolean contains = geometry1.contains( geometry2 );
  LiteralOutput containsOutput = (LiteralOutput) out.getParameter( "Contains" );
  containsOutput.setValue( String.valueOf( contains ) );
}

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

Geometry clipGeometry( final Geometry geom, Geometry clippingArea ) {
  if ( clippingArea != null && !clippingArea.contains( geom ) ) {
    try {
      Geometry clippedGeometry = clippingArea.getIntersection( geom );
      if ( clippedGeometry == null ) {
        return null;
      }
      com.vividsolutions.jts.geom.Geometry jtsOrig = ( (AbstractDefaultGeometry) geom ).getJTSGeometry();
      com.vividsolutions.jts.geom.Geometry jtsClipped = ( (AbstractDefaultGeometry) clippedGeometry ).getJTSGeometry();
      if ( jtsOrig == jtsClipped ) {
        return geom;
      }
      if ( isInvertedOrientation( jtsOrig ) ) {
        return clippedGeometry;
      }
      return fixOrientation( clippedGeometry, clippedGeometry.getCoordinateSystem() );
    } catch ( UnsupportedOperationException e ) {
      // use original geometry if intersection not supported by JTS
      return geom;
    }
  }
  return geom;
}

相关文章