Execute the operation!

@return Returns a new geometry. If the given geometry is null, then null is returned.
428884
public Geometry execute(Geometry geometry) {
		if (geometry == null) {
			return null;
		}
		if (geometry instanceof Point) {
			return translate((Point) geometry);
		} else if (geometry instanceof LinearRing) {
			return translate((LinearRing) geometry);
		} else if (geometry instanceof LineString) {
			return translate((LineString) geometry);
		} else if (geometry instanceof Polygon) {
			return translate((Polygon) geometry);
		} else if (geometry instanceof MultiPoint) {
			return translate((MultiPoint) geometry);
		} else if (geometry instanceof MultiLineString) {
			return translate((MultiLineString) geometry);
		} else if (geometry instanceof MultiPolygon) {
			return translate((MultiPolygon) geometry);
		}

		return null;
	}
837751
public Geometry execute(Geometry geometry) {
		if (geometry == null) {
			return null;
		}
		if (geometry instanceof LinearRing) {
			if (coordIndex <= 0) {
				coordIndex = 0;
			} else if (coordIndex > geometry.getNumPoints() - 2) {
				coordIndex = geometry.getNumPoints() - 2;
			}
			Coordinate[] coordinates = new Coordinate[geometry.getNumPoints()];
			for (int i = 0; i < coordinates.length; i++) {
				Coordinate coordinate = geometry.getCoordinates()[i];
				if (i == coordIndex) {
					coordinates[i] = new Coordinate(coordinate.getX() + translateX, coordinate.getY() + translateY);
				} else if (i == geometry.getNumPoints() - 1) {
					coordinates[i] = coordinates[0];
				} else {
					coordinates[i] = coordinate;
				}
			}
			return geometry.getGeometryFactory().createLinearRing(coordinates);
		} else if (geometry instanceof LineString) {
			if (coordIndex <= 0) {
				coordIndex = 0;
			} else if (coordIndex > geometry.getNumPoints() - 1) {
				coordIndex = geometry.getNumPoints() - 1;
			}
			Coordinate[] coordinates = new Coordinate[geometry.getNumPoints()];
			for (int i = 0; i < coordinates.length; i++) {
				Coordinate coordinate = geometry.getCoordinates()[i];
				if (i == coordIndex) {
					coordinates[i] = new Coordinate(coordinate.getX() + translateX, coordinate.getY() + translateY);
				} else {
					coordinates[i] = geometry.getCoordinates()[i];
				}
			}
			return geometry.getGeometryFactory().createLineString(coordinates);
		}
		return null;
	}
795239
public static <T extends Geometry> JTSGeometryExpression<T> geometryOperation(Class<? extends T> type,
                                                                                  Operator op, Expression<?>... args) {
        return new JTSGeometryOperation<T>(type, op, args);
    }
244568
public DomainQueryResult execute() {
		DomainQueryResult ret = new DomainQueryResult(this);
		Object so = this.queryExecutor.getMappingInfo().getInternalDomainAccess().getSyncObject();
		if (so != null) {
			synchronized (so) {
				this.queryExecutor.execute();
			}
		} else
			this.queryExecutor.execute();
		return ret;
	}
12499
private <T> T execute(Operation<T> operation) throws Exception {
    return execute(operation, null);
  }
1025518
@Override public WebViewMapFragment build() {
    if (options == null) {
      options = new GoogleWebMapType();
    }
    if (options instanceof GoogleWebMapType) {
      return GoogleWebViewMapFragment.newInstance(options);
    }
    if (options instanceof GoogleChinaMapType) {
      return GoogleChinaWebViewMapFragment.newInstance(options);
    }
    if (options instanceof LeafletMapType) {
      return LeafletWebViewMapFragment.newInstance(options);
    }
    return null;
  }
857477
public static Geometry ST_Transform(Connection connection, Geometry geom, Integer codeEpsg) throws SQLException, CoordinateOperationException {
        if (geom == null) {
            return null;
        }
        if (codeEpsg == null) {
            throw new IllegalArgumentException("The SRID code cannot be null.");
        }
        if (crsf == null) {
            crsf = new CRSFactory();
            //Activate the CRSFactory and the internal H2 spatial_ref_sys registry to
            // manage Coordinate Reference Systems.
            crsf.getRegistryManager().addRegistry(srr);
        }
        srr.setConnection(connection);
        try {
            int inputSRID = geom.getSRID();
            if (inputSRID == 0) {
                throw new SQLException("Cannot find a CRS");
            } else {
                CoordinateReferenceSystem inputCRS = crsf.getCRS(srr.getRegistryName() + ":" + String.valueOf(inputSRID));
                CoordinateReferenceSystem targetCRS = crsf.getCRS(srr.getRegistryName() + ":" + String.valueOf(codeEpsg));
                if (inputCRS.equals(targetCRS)) {
                    return geom;
                }
                EPSGTuple epsg = new EPSGTuple(inputSRID, codeEpsg);
                CoordinateOperation op = copPool.get(epsg);
                if (op != null) {
                    Geometry outPutGeom = geom.copy();
                    outPutGeom.geometryChanged();
                    outPutGeom.apply(new CRSTransformFilter(op));
                    outPutGeom.setSRID(codeEpsg);
                    return outPutGeom;
                } else {
                    if (inputCRS instanceof GeodeticCRS && targetCRS instanceof GeodeticCRS) {
                        Set<CoordinateOperation> ops = CoordinateOperationFactory
                                .createCoordinateOperations((GeodeticCRS) inputCRS, (GeodeticCRS) targetCRS);
                        if (!ops.isEmpty()) {
                            op = CoordinateOperationFactory.getMostPrecise(ops);
                            Geometry outPutGeom = (Geometry) geom.copy();
                            outPutGeom.geometryChanged();
                            outPutGeom.apply(new CRSTransformFilter(op));
                            copPool.put(epsg, op);
                            outPutGeom.setSRID(codeEpsg);
                            return outPutGeom;
                        }
                    } else {
                        throw new SQLException("The transformation from "
                                + inputCRS + " to " + codeEpsg + " is not yet supported.");
                    }
                }
            }
        } catch (CRSException ex) {
            throw new SQLException("Cannot create the CRS", ex);
        } finally {
            srr.setConnection(null);
        }
        return null;

    }
720287
function(geometry) {
        this._queue = function() {
            for (var i=0, len=this.layers.length; i<len; i++) {
                var layer = this.layers[i];
                var geometryAttributes = this.getGeometryAttributes(layer);
                var filters = [];
                for (var j=0, lenj=geometryAttributes.length; j<lenj; j++) {
                    var geometryAttribute = geometryAttributes[j];
                    if (geometryAttribute !== null) {
                        // from the click handler we will not get an actual 
                        // geometry so transform
                        if (!(geometry instanceof OpenLayers.Geometry)) {
                            var point = this.map.getLonLatFromPixel(
                                geometry.xy);
                            geometry = new OpenLayers.Geometry.Point(
                                point.lon, point.lat);
                        }
                        var filter = this.createFilter(geometryAttribute,
                        geometry);
                        if (filter !== null) {
                            filters.push(filter);
                        }
                    }
                }
    
                var selectionLayer = this.createSelectionLayer(layer);
    
                this.events.triggerEvent("selected", {
                    layer: layer,
                    filters: filters
                });

                var sld = this.createSLD(layer, filters, geometryAttributes);
    
                selectionLayer.mergeNewParams({SLD_BODY: sld});
                delete this._queue;
            }
        };
        this.applySelection();
    }
1042253
@Override
	public void move(List<GeometryIndex> indices, List<List<Coordinate>> coordinates)
			throws GeometryOperationFailedException {
		if (indices == null || coordinates == null || indices.size() == 0 || coordinates.size() == 0) {
			throw new GeometryOperationFailedException("Illegal arguments passed; nothing to move.");
		}

		Geometry geometry = service.getGeometry();
		OperationSequence seq = null;
		if (isOperationSequenceActive()) {
			seq = current;
		} else {
			seq = new OperationSequence();
			redoQueue.clear();
		}
		for (int i = 0; i < indices.size(); i++) {
			if (indexService.getType(indices.get(i)) == GeometryIndexType.TYPE_VERTEX) {
				GeometryIndexOperation op = new MoveVertexOperation(indexService, coordinates.get(i).get(0));
				executeOperation(op, indices.get(i));
				seq.addOperation(op);
			} else {
				throw new GeometryOperationFailedException("Can only move vertices. Other types not suported.");
			}
		}
		if (!isOperationSequenceActive()) {
			undoQueue.add(seq);
		}
		eventBus.fireEvent(new GeometryEditMoveEvent(geometry, indices));
		if (!isOperationSequenceActive()) {
			eventBus.fireEvent(new GeometryEditShapeChangedEvent(service.getGeometry()));
		}
	}
1115576
public byte[] write( Geometry geom ) {
        try {
            byteArrayOS.reset();
            writeSpatialiteGeometry(geom, byteArrayOutStream);
        } catch (IOException ex) {
            throw new RuntimeException("Unexpected IO exception: " + ex.getMessage());
        }
        return byteArrayOS.toByteArray();
    }
55160
@Override
	public MapController create(GeometryEditService editService, GeometryIndex index)
			throws GeometryIndexNotFoundException {
		if (index == null) {
			return null;
		}
		switch (editService.getIndexService().getType(index)) {
			case TYPE_VERTEX:
				return createVertexController(editService, index);
			case TYPE_EDGE:
				return createEdgeController(editService, index);
			default:
				return null;
		}
	}
665394
public GeometryExpression<Geometry> union(Expression<? extends Geometry> geometry) {
        return GeometryExpressions.geometryOperation(SpatialOps.UNION, mixin, geometry);
    }
1109051
@Override
    public boolean execute() throws SQLException
    {
        checkClosed();
        boolean result = this.execute(this.Query.getExecutableQuery(this.parameters));
        this.parameters = this.Query.getParameterArray();
        return result;
    }
149997
@Override
	public void start(Geometry geometry) {
		if (started) {
			return;
		}
		this.geometry = geometry;
		if (geometry == null) {
			throw new IllegalArgumentException("Null geometry not allowed.");
		}
		started = true;
		eventBus.fireEvent(new GeometryEditStartEvent(geometry));
	}
503147
public Geometry createGeometry(Geometry geometry) {
		if (geometry instanceof Point) {
			return createPoint(geometry.getCoordinate());
		} else if (geometry instanceof LinearRing) {
			return createLinearRing(geometry.getCoordinates());
		} else if (geometry instanceof LineString) {
			return createLineString(geometry.getCoordinates());
		} else if (geometry instanceof Polygon) {
			Polygon polygon = (Polygon) geometry;
			LinearRing exteriorRing = createLinearRing(polygon.getExteriorRing().getCoordinates());
			LinearRing[] interiorRings = new LinearRing[polygon.getNumInteriorRing()];
			for (int n = 0; n < polygon.getNumInteriorRing(); n++) {
				interiorRings[n] = createLinearRing(polygon.getInteriorRingN(n).getCoordinates());
			}
			return new Polygon(srid, precision, exteriorRing, interiorRings);
		} else if (geometry instanceof MultiPoint) {
			Point[] clones = new Point[geometry.getNumGeometries()];
			for (int n = 0; n < geometry.getNumGeometries(); n++) {
				clones[n] = createPoint(geometry.getGeometryN(n).getCoordinate());
			}
			return new MultiPoint(srid, precision, clones);
		} else if (geometry instanceof MultiLineString) {
			LineString[] clones = new LineString[geometry.getNumGeometries()];
			for (int n = 0; n < geometry.getNumGeometries(); n++) {
				clones[n] = createLineString(geometry.getGeometryN(n).getCoordinates());
			}
			return new MultiLineString(srid, precision, clones);
		} else if (geometry instanceof MultiPolygon) {
			Polygon[] clones = new Polygon[geometry.getNumGeometries()];
			for (int n = 0; n < geometry.getNumGeometries(); n++) {
				clones[n] = (Polygon) createGeometry(geometry.getGeometryN(n));
			}
			return new MultiPolygon(srid, precision, clones);
		}
		return null;
	}
82897
function() {
    if (!this.isSquare) { return null; }
    var els = [], n = this.elements.length, k = n, i;
    do { i = k - n;
      els.push(this.elements[i][i]);
    } while (--n);
    return Vector.create(els);
  }
309993
private void execute(MultiPolygon multiPolygon) {
		Polygon polygon = execute((Polygon) multiPolygon.getGeometryN(index.getGeometryIndex()));
		setPolygonN(multiPolygon, polygon, index.getGeometryIndex());
	}