if (geomName != null && geomName.equals(name)) {
if (!(value instanceof Geometry)) {
throw ScriptRuntime.constructError("Error", "Attempted to set geometry property to a non-geometry object: " + Context.toString(value));
}
Projection featureProj = getProjection();
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");
}