use of org.geotoolkit.gml.xml.v321.MultiSolidType in project geotoolkit by Geomatys.
the class JAXPStreamFeatureWriter method setId.
/**
* @param inc auto increment value, ids must be unique
*/
private void setId(AbstractGeometry gmlGeometry, String id) {
if (gmlGeometry.getId() == null || gmlGeometry.getId().isEmpty()) {
// do not override ids if they exist
gmlGeometry.setId(id + (gidInc));
gidInc++;
}
if (gmlGeometry instanceof MultiCurve) {
for (CurveProperty po : ((MultiCurve) gmlGeometry).getCurveMember()) {
final AbstractCurve child = po.getAbstractCurve();
if (child instanceof AbstractGeometry) {
setId((AbstractGeometry) child, id);
}
}
} else if (gmlGeometry instanceof MultiSurface) {
for (SurfaceProperty po : ((MultiSurface) gmlGeometry).getSurfaceMember()) {
final AbstractSurface child = po.getAbstractSurface();
if (child instanceof AbstractGeometry) {
setId((AbstractGeometry) child, id);
}
}
} else if (gmlGeometry instanceof MultiGeometryType) {
for (GeometryPropertyType po : ((MultiGeometryType) gmlGeometry).getGeometryMember()) {
final AbstractGeometryType child = po.getAbstractGeometry();
if (child instanceof AbstractGeometry) {
setId((AbstractGeometry) child, id);
}
}
} else if (gmlGeometry instanceof MultiSolidType) {
for (SolidPropertyType po : ((MultiSolidType) gmlGeometry).getSolidMember()) {
final AbstractSolidType child = po.getAbstractSolid().getValue();
if (child instanceof AbstractGeometry) {
setId((AbstractGeometry) child, id);
}
}
} else if (gmlGeometry instanceof MultiPointType) {
for (PointPropertyType po : ((MultiPointType) gmlGeometry).getPointMember()) {
final PointType child = po.getPoint();
if (child instanceof AbstractGeometry) {
setId((AbstractGeometry) child, id);
}
}
}
}
Aggregations