Geometry geometry = (Geometry) value;
Projection geomProj = geometry.getProjection();
if (featureProj != null) {
if (geomProj != null) {
if (!featureProj.equals(geometry.getProjection())) {
value = geometry.transform(featureProj);
}
}
} else if (geomProj != null) {
throw ScriptRuntime.constructError("Error", "Cannot add a geometry with a projection to a feature without a projection");
}