Index: GML2EncodingUtils.java =================================================================== --- GML2EncodingUtils.java (revision 35950) +++ GML2EncodingUtils.java (working copy) @@ -50,6 +50,7 @@ import org.geotools.xs.XS; import org.opengis.feature.ComplexAttribute; import org.opengis.feature.Feature; +import org.opengis.feature.GeometryAttribute; import org.opengis.feature.Property; import org.opengis.feature.simple.SimpleFeature; import org.opengis.feature.simple.SimpleFeatureType; @@ -399,6 +400,14 @@ // do not unpack complex attributes as these may have their own bindings, which // will be applied by the encoder value = property; + } else if (property instanceof GeometryAttribute) { + value = property.getValue(); + if (value != null) { + Geometry geometry = (Geometry) value; + CoordinateReferenceSystem crs = ((GeometryAttribute) property) + .getDescriptor().getCoordinateReferenceSystem(); + geometry.setUserData(crs); + } } else { // non-complex bindings are unpacked as for simple feature case value = property.getValue();