public class GeometryEditor extends Object
Geometrys which are modifications of existing ones, maintaining the same type structure. Geometry objects are intended to be treated as immutable. This class "modifies" Geometrys by traversing them, applying a user-defined
GeometryEditor.GeometryEditorOperation,
GeometryEditor.CoordinateSequenceOperation or
GeometryEditor.CoordinateOperation and creating new Geometrys with the same structure but (possibly) modified components.
Examples of the kinds of modifications which can be made are:
GeometryTransformer.
This class supports creating an edited Geometry using a different GeometryFactory via the GeometryEditor(GeometryFactory) constructor. Examples of situations where this is required is if the geometry is transformed to a new SRID and/or a new PrecisionModel.
Usage Notes
Geometry.isValid() method should be called. GeometryTransformer,
Geometry.isValid()
| Modifier and Type | Class and Description |
|---|---|
static class |
GeometryEditor
A
GeometryEditor.GeometryEditorOperation which edits the coordinate list of a
Geometry.
|
static class |
GeometryEditor
|
static interface |
GeometryEditor
A interface which specifies an edit operation for Geometries.
|
static class |
GeometryEditor
A GeometryEditorOperation which does not modify the input geometry.
|
| Constructor and Description |
|---|
GeometryEditor()
Creates a new GeometryEditor object which will create edited
Geometrys with the same
GeometryFactory as the input Geometry.
|
GeometryEditor(GeometryFactory
Creates a new GeometryEditor object which will create edited
Geometrys with the given
GeometryFactory.
|
| Modifier and Type | Method and Description |
|---|---|
Geometry |
edit(Geometry
Edit the input
Geometry with the given edit operation.
|
void |
setCopyUserData(boolean isUserDataCopied)
Sets whether the User Data is copied to the edit result.
|
public GeometryEditor()
Geometrys with the same
GeometryFactory as the input Geometry.
public GeometryEditor(GeometryFactoryfactory)
Geometrys with the given
GeometryFactory.
factory - the GeometryFactory to create edited Geometrys with
public void setCopyUserData(boolean isUserDataCopied)
isUserDataCopied - true if the input user data should be copied.
public Geometryedit(Geometry geometry, GeometryEditor .GeometryEditorOperation operation)
Geometry with the given edit operation. Clients can create subclasses of
GeometryEditor.GeometryEditorOperation or
GeometryEditor.CoordinateOperation to perform required modifications.
geometry - the Geometry to edit
operation - the edit operation to carry out
Geometry which is the result of the editing (which may be empty)