private Feature transformGeometries( Feature feature, GeometryTransformer transformer ) throws IllegalArgumentException, TransformationException, UnknownCRSException { // TODO Do not modify the incoming feature, but create a new one. for ( Property prop : feature.getProperties() ) { List<TypedObjectNode> children = prop.getChildren(); if ( children != null && !children.isEmpty() ) { List<TypedObjectNode> newChildren = new ArrayList<TypedObjectNode>( children.size() ); for ( TypedObjectNode child : children ) { newChildren.add( transformGeometries( child, transformer ) ); } prop.setChildren( newChildren ); } else { TypedObjectNode value = prop.getValue(); if ( value != null ) { prop.setValue( transformGeometries( value, transformer ) ); } } } feature.setEnvelope( feature.calcEnvelope() ); return feature; }