本文整理了Java中org.deegree.geometry.Geometry.getId()
方法的一些代码示例,展示了Geometry.getId()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Geometry.getId()
方法的具体详情如下:
包路径:org.deegree.geometry.Geometry
类名称:Geometry
方法名:getId
暂无
代码示例来源:origin: deegree/deegree3
@Override
public boolean visitGeometry( Geometry geom ) {
idToObject.put( geom.getId(), geom );
return true;
}
代码示例来源:origin: deegree/deegree3
@Override
public boolean visitGeometry( final Geometry geom ) {
checkForDuplication( geom.getId() );
return true;
}
代码示例来源:origin: deegree/deegree3
/**
* Does the work to write the standardproperties for the geometryobjects
* <p>
* This specification comes from the GML and is not necessary for databases but maybe necessary for an export within
* deegree
*
* @param sb
* @param geom
* @throws IOException
*/
private void appendObjectProps( Writer writer, Geometry geom )
throws IOException {
writer.append( '[' );
//
writer.append( "id='" );
if ( geom.getId() != null ) {
writer.append( geom.getId() );
} else
writer.append( "" );
writer.append( '\'' );
writer.append( ']' );
}
}
代码示例来源:origin: deegree/deegree3
private void startGeometry( String localName, Geometry geometry )
throws XMLStreamException {
writeStartElementWithNS( GML21NS, localName );
if ( geometry.getId() != null ) {
referenceExportStrategy.addExportedId( geometry.getId() );
writer.writeAttribute( "gid", geometry.getId() );
}
if ( outputCRS != null ) {
writer.writeAttribute( "srsName", outputCRS.getAlias() );
} else if ( geometry.getCoordinateSystem() != null ) {
ICRS coordinateSystem = geometry.getCoordinateSystem();
writer.writeAttribute( "srsName", coordinateSystem.getAlias() );
}
}
代码示例来源:origin: deegree/deegree3
private void startGeometry( String localName, Geometry geometry )
throws XMLStreamException, UnknownCRSException, TransformationException {
GMLObjectType gmlType = geometry.getType();
if ( gmlType == null ) {
writeStartElementWithNS( gmlNs, localName );
} else {
QName elName = gmlType.getName();
writeStartElementWithNS( elName.getNamespaceURI(), elName.getLocalPart() );
}
if ( geometry.getId() != null ) {
referenceExportStrategy.addExportedId( geometry.getId() );
writeAttributeWithNS( gmlNs, "id", geometry.getId() );
} else if ( version == GML_32 && geometry.getId() == null ) {
// in GML 3.2, a gml:id is required for every geometry
writeAttributeWithNS( gmlNs, "id", "GEOMETRY_" + generateNewId() );
}
if ( outputCRS != null ) {
writer.writeAttribute( "srsName", outputCRS.getAlias() );
} else if ( geometry.getCoordinateSystem() != null ) {
writer.writeAttribute( "srsName", geometry.getCoordinateSystem().getAlias() );
}
exportStandardProps( geometry );
}
代码示例来源:origin: deegree/deegree3
startGeometry( "MultiGeometry", multiGeometry );
for ( Geometry geom : multiGeometry ) {
if ( referenceExportStrategy.isObjectExported( geom.getId() ) ) {
writer.writeEmptyElement( "gml", "geometryMember", GML21NS );
writer.writeAttribute( "xlink", XLNNS, "href", "#" + geom.getId() );
} else {
writer.writeStartElement( "gml", "geometryMember", GML21NS );
代码示例来源:origin: deegree/deegree3
private String getGeometryId( Geometry geometry, IDGenMode mode ) {
String gid = geometry.getId();
switch ( mode ) {
case GENERATE_NEW: {
gid = "GEOMETRY_" + generateNewId();
break;
}
case REPLACE_DUPLICATE: {
if ( gid == null || sf.getObjectById( gid ) != null ) {
gid = "FEATURE_" + generateNewId();
}
}
case USE_EXISTING: {
if ( gid == null ) {
gid = "GEOMETRY_" + generateNewId();
}
break;
}
}
return gid;
}
代码示例来源:origin: deegree/deegree3
if ( geometry.getId() == null || !( gids.contains( geometry.getId() ) ) ) {
geometries.add( geometry );
if ( geometry.getId() != null ) {
gids.add( geometry.getId() );
代码示例来源:origin: deegree/deegree3
String oldGid = geometry.getId();
if ( oldGid != null ) {
gids.remove( oldGid );
if ( geometry.getId() == null ) {
String newGid = "GEOMETRY_" + generateNewId();
geometry.setId( newGid );
代码示例来源:origin: deegree/deegree3
} else {
Geometry gValue = (Geometry) value;
if ( !exportSf && gValue.getId() != null && referenceExportStrategy.isObjectExported( gValue.getId() ) ) {
writeEmptyElementWithNS( propName.getNamespaceURI(), propName.getLocalPart() );
writeAttributeWithNS( XLNNS, "href", "#" + gValue.getId() );
endEmptyElement();
} else {
writeStartElementWithNS( propName.getNamespaceURI(), propName.getLocalPart() );
if ( gValue.getId() != null ) {
writer.writeComment( "Inlined geometry '" + gValue.getId() + "'" );
代码示例来源:origin: deegree/deegree3
if ( geom instanceof Point ) {
Point p = (Point) geom;
return fac.createPoint( geom.getId(), new double[] { p.get0() + offx, p.get1() + offy },
p.getCoordinateSystem() );
ps.add( (Point) move( p, offx, offy ) );
return fac.createLineString( geom.getId(), c.getCoordinateSystem(), new PointsList( ps ) );
return fac.createSurface( geom.getId(), movedPatches, geom.getCoordinateSystem() );
代码示例来源:origin: deegree/deegree3
for ( Geometry geometryMember : geometry ) {
writer.writeStartElement( gmlNs, "geometryMember" );
if ( geometryMember.getId() != null
&& referenceExportStrategy.isObjectExported( geometryMember.getId() ) ) {
writer.writeAttribute( XLNNS, "href", "#" + geometryMember.getId() );
} else {
export( geometryMember );
代码示例来源:origin: deegree/deegree3
List<SurfacePatch> patches = new ArrayList<SurfacePatch>();
patches.add( geomFac.createPolygonPatch( p.getExteriorRing(), p.getInteriorRings() ) );
geom = geomFac.createSurface( geom.getId(), patches, geom.getCoordinateSystem() );
} else if ( hierarchy.getCurveSubstitutions().contains( particle.getName() ) && geom instanceof LineString ) {
CurveSegment[] segments = new CurveSegment[1];
segments[0] = geomFac.createLineStringSegment( p.getControlPoints() );
geom = geomFac.createCurve( geom.getId(), geom.getCoordinateSystem(), segments );
代码示例来源:origin: deegree/deegree3
if ( !insideValidDomain( domainOfValidity, geo ) ) {
throw new OutsideCRSDomainException( "Geometry (gml:id="
+ ( isSet( geo.getId() ) ? geo.getId() : "not set" )
+ ")is outside the area of validity of the source CRS." );
内容来源于网络,如有侵权,请联系作者删除!