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

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

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

Geometry.getGeometryType介绍

[英]Returns the type of geometry.
[中]返回几何图形的类型。

代码示例

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

private Geometry simplify( Geometry geometry ) {
  if ( simplifier == null ) {
    return geometry;
  }
  GeometryType type = geometry.getGeometryType();
  if ( type == ENVELOPE || type == COMPOSITE_GEOMETRY ) {
    return geometry;
  }
  return simplifier.simplify( geometry );
}

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

private Geometry simplify( Geometry geometry ) {
  if ( simplifier == null ) {
    return geometry;
  }
  GeometryType type = geometry.getGeometryType();
  if ( type == ENVELOPE || type == COMPOSITE_GEOMETRY ) {
    return geometry;
  }
  return simplifier.simplify( geometry );
}

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

@Override
public GeometryType getGeometryType() {
  return getReferencedObject().getGeometryType();
}

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

private static void collectMembersDeep( Geometry geometry, List<GeometricPrimitive> deepMembers ) {
  switch ( geometry.getGeometryType() ) {
  case COMPOSITE_GEOMETRY: {
    // TODO
    break;
  }
  case ENVELOPE: {
    // TODO
    break;
  }
  case PRIMITIVE_GEOMETRY: {
    deepMembers.add( (GeometricPrimitive) geometry );
  }
  case MULTI_GEOMETRY: {
    MultiGeometry<?> multi = (MultiGeometry<?>) geometry;
    for ( Geometry member : multi ) {
      collectMembersDeep( member, deepMembers );
    }
  }
  }
}

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

static Geometry fixOrientation( Geometry geom, ICRS defaultCrs ) {
  switch ( geom.getGeometryType() ) {
  case PRIMITIVE_GEOMETRY:
    return fixOrientation( (GeometricPrimitive) geom, defaultCrs );
  case MULTI_GEOMETRY:
    return fixOrientation( (MultiGeometry<?>) geom, defaultCrs );
  default: {
    throw new UnsupportedOperationException();
  }
  }
}

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

/**
 * Simplifies the given {@link Geometry}.
 * 
 * @param geometry
 *            the geometry to be simplified, must not be <code>null</code>
 * @return the simplified geometry
 */
public Geometry simplify( Geometry geometry ) {
  Geometry simplified = null;
  switch ( geometry.getGeometryType() ) {
  case COMPOSITE_GEOMETRY: {
    throw new UnsupportedOperationException( "Simplifying of composites is not implemented yet." );
  }
  case ENVELOPE: {
    throw new UnsupportedOperationException( "Simplifying of envelopes is not implemented yet." );
  }
  case MULTI_GEOMETRY: {
    simplified = simplify( (MultiGeometry<?>) geometry );
    break;
  }
  case PRIMITIVE_GEOMETRY: {
    simplified = simplify( (GeometricPrimitive) geometry );
    break;
  }
  }
  return simplified;
}

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

private boolean validateGeometry( Geometry geom, List<Object> affectedGeometryParticles ) {
  boolean isValid = false;
  switch ( geom.getGeometryType() ) {
  case COMPOSITE_GEOMETRY: {
    isValid = validate( (CompositeGeometry<?>) geom, affectedGeometryParticles );
    break;
  }
  case ENVELOPE: {
    String msg = "Internal error: envelope 'geometries' should not occur here.";
    throw new IllegalArgumentException( msg );
  }
  case MULTI_GEOMETRY: {
    isValid = validate( (MultiGeometry<?>) geom, affectedGeometryParticles );
    break;
  }
  case PRIMITIVE_GEOMETRY: {
    isValid = validate( (GeometricPrimitive) geom, affectedGeometryParticles );
    break;
  }
  }
  return isValid;
}

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

private void traverseGeometry( Geometry node ) {
  GeometryType gt = node.getGeometryType();
  switch ( gt ) {
  case COMPOSITE_GEOMETRY:
    for ( Geometry member : (CompositeGeometry<?>) node ) {
      traverse( member );
    }
    break;
  case ENVELOPE:
    // nothing to do
    break;
  case MULTI_GEOMETRY:
    for ( Geometry member : (MultiGeometry<?>) node ) {
      traverse( member );
    }
    break;
  case PRIMITIVE_GEOMETRY:
    traversePrimitive( (GeometricPrimitive) node );
    break;
  }
}

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

/**
 * 
 * 
 * @param geometry
 *            that has to be written
 * @param writer
 *            that is used
 * @throws IOException
 */
public void writeGeometry( Geometry geometry, Writer writer )
            throws IOException {
  switch ( geometry.getGeometryType() ) {
  case COMPOSITE_GEOMETRY:
    writeCompositeGeometry( (CompositeGeometry<GeometricPrimitive>) geometry, writer );
    break;
  case ENVELOPE:
    writeEnvelope( (Envelope) geometry, writer );
    break;
  case MULTI_GEOMETRY:
    writeMultiGeometry( (MultiGeometry<? extends Geometry>) geometry, writer );
    break;
  case PRIMITIVE_GEOMETRY:
    writeGeometricPrimitive( (GeometricPrimitive) geometry, writer );
    break;
  }
}

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

switch ( geometry.getGeometryType() ) {
case COMPOSITE_GEOMETRY:
  exportCompositeGeometry( (CompositeGeometry<GeometricPrimitive>) geometry );

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

throws XMLStreamException, TransformationException, UnknownCRSException {
geometry = simplify( geometry );
switch ( geometry.getGeometryType() ) {
case COMPOSITE_GEOMETRY: {
  exportCompositeGeometry( (CompositeGeometry<GeometricPrimitive>) geometry );

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

GeometryType geometryType = geo.getGeometryType();
try {
  switch ( geometryType ) {

相关文章