org.deegree.geometry.primitive.Point.getId()方法的使用及代码示例

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

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

Point.getId介绍

暂无

代码示例

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

private boolean checkForReferencesOrIds( final Points points ) {
  boolean hasID = false;
  for ( final Point p : points ) {
    if ( p instanceof Reference<?> && !( (Reference<?>) p ).isLocal() ) {
      hasID = true;
      break;
    } else if ( p.getId() != null && p.getId().trim().length() > 0 ) {
      hasID = true;
      break;
    }
  }
  return hasID;
}

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

/**
 * @param multiPoint
 * @throws XMLStreamException
 * @throws UnknownCRSException
 * @throws TransformationException
 */
public void exportMultiPoint( MultiPoint multiPoint )
            throws XMLStreamException, TransformationException, UnknownCRSException {
  startGeometry( "MultiPoint", multiPoint );
  for ( Point point : multiPoint ) {
    if ( referenceExportStrategy.isObjectExported( point.getId() ) ) {
      writer.writeEmptyElement( "gml", "pointMember", GML21NS );
      writer.writeAttribute( "xlink", XLNNS, "href", "#" + point.getId() );
    } else {
      writer.writeStartElement( "gml", "pointMember", GML21NS );
      exportPoint( point );
      writer.writeEndElement();
    }
  }
  writer.writeEndElement(); // </gml:MultiPoint>
}

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

private void exportPointsAsProperties( final Points points )
            throws XMLStreamException, UnknownCRSException, TransformationException {
  for ( final Point point : points ) {
    writer.writeStartElement( "gml", "pointProperty", gmlNs );
    if ( point instanceof Reference<?> && !( (Reference<?>) point ).isLocal() ) {
      final Reference<?> ref = (Reference<?>) point;
      writeAttributeWithNS( XLNNS, "href", ref.getURI() );
    } else if ( point.getId() != null && referenceExportStrategy.isObjectExported( point.getId() ) ) {
      writeAttributeWithNS( XLNNS, "href", "#" + point.getId() );
    } else {
      export( point );
    }
    writer.writeEndElement();
  }
}

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

private static Points move( Points points, double offx, double offy ) {
  List<Point> movedPoints = new ArrayList<Point>( points.size() );
  GeometryFactory fac = new GeometryFactory();
  for ( Point point : points ) {
    double[] movedCoordinates = new double[] { point.get0() + offx, point.get1() + offy };
    movedPoints.add( fac.createPoint( point.getId(), movedCoordinates, point.getCoordinateSystem() ) );
  }
  return new PointsList( movedPoints );
}

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

/**
 * transforms the list of points
 * 
 * @throws TransformationException
 */
private Points transform( Points points, Transformation trans )
            throws TransformationException {
  List<Point> result = new ArrayList<Point>( points.size() );
  for ( Point point : points ) {
    Point3d coord = new Point3d( point.get0(), point.get1(), point.get2() );
    Point3d tmp = new Point3d( coord );
    tmp = trans.doTransform( coord );
    if ( Double.isNaN( point.get2() ) ) {
      result.add( geomFactory.createPoint( point.getId(), new double[] { tmp.x, tmp.y }, getTargetCRS() ) );
    } else {
      // pass the 3rd coordinate if exist and dimension of source and target CRS is 2
      if ( trans.getSourceCRS().getDimension() == 2 && trans.getTargetCRS().getDimension() == 2 ) {
        tmp.z = point.get2();
      }
      result.add( geomFactory.createPoint( point.getId(), new double[] { tmp.x, tmp.y, tmp.z },
                         getTargetCRS() ) );
    }
  }
  return new PointsList( result );
}

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

/**
 * transforms the submitted point to the target coordinate reference system
 * 
 * @throws TransformationException
 */
private Point transform( Point geo, Transformation trans )
            throws TransformationException {
  Point3d coord = new Point3d( geo.get0(), geo.get1(), geo.get2() );
  Point3d result = new Point3d( coord );
  result = trans.doTransform( coord );
  if ( Double.isNaN( geo.get2() ) ) {
    return geomFactory.createPoint( geo.getId(), new double[] { result.x, result.y }, getTargetCRS() );
  } else if ( trans.getSourceCRS().getDimension() == 2 && trans.getTargetCRS().getDimension() == 2 ) {
    // pass the 3rd coordinate if exist and dimension of source and target CRS is 2
    result.z = geo.get2();
  }
  return geomFactory.createPoint( geo.getId(), new double[] { result.x, result.y, result.z }, getTargetCRS() );
}

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

for ( Point point : multiPoint ) {
  writer.writeStartElement( gmlNs, "pointMember" );
  if ( point.getId() != null && referenceExportStrategy.isObjectExported( point.getId() ) ) {
    writer.writeAttribute( XLNNS, "href", "#" + point.getId() );
  } else {
    export( point );

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

if ( min.equals( max ) ) {
  min = new DefaultPoint( min.getId(), min.getCoordinateSystem(), min.getPrecision(),
              new double[] { min.get0() - 0.0001, min.get1() - 0.0001 } );
  if ( min.equals( max ) ) {
    min = new DefaultPoint( min.getId(), min.getCoordinateSystem(), min.getPrecision(),
                new double[] { min.get0() - 0.0001, min.get1() - 0.0001 } );

相关文章