public class GeometryEditorEx
extends java.lang.Object
Geometry
s
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
GeometryEditorEx.GeometryEditorOperation
, GeometryEditorEx.CoordinateSequenceOperation
or GeometryEditorEx.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 | Description |
---|---|---|
static class |
GeometryEditorEx.CoordinateOperation |
A
GeometryEditorEx.GeometryEditorOperation which edits the coordinate list of a Geometry . |
static class |
GeometryEditorEx.CoordinateSequenceOperation |
|
static interface |
GeometryEditorEx.GeometryEditorOperation |
A interface which specifies an edit operation for Geometries.
|
static class |
GeometryEditorEx.NoOpGeometryOperation |
A GeometryEditorOperation which does not modify
the input geometry.
|
Constructor | Description |
---|---|
GeometryEditorEx() |
Creates a new GeometryEditor object which will create
edited
Geometry s with the same GeometryFactory as the input Geometry. |
GeometryEditorEx(GeometryFactory targetFactory) |
Creates a new GeometryEditor object which will create
edited
Geometry s with the given GeometryFactory . |
GeometryEditorEx(GeometryEditorEx.GeometryEditorOperation operation) |
Creates a GeometryEditor which edits geometries using
a given
GeometryOperation
and the same GeometryFactory as the input Geometry. |
GeometryEditorEx(GeometryEditorEx.GeometryEditorOperation operation,
GeometryFactory targetFactory) |
Creates a GeometryEditor which edits geometries using
a given
GeometryOperation
and the given GeometryFactory . |
Modifier and Type | Method | Description |
---|---|---|
Geometry |
edit(Geometry geometry) |
Edit a
Geometry . |
void |
setCopyUserData(boolean isUserDataCopied) |
Sets whether the User Data is copied to the edit result.
|
public GeometryEditorEx()
Geometry
s with the same GeometryFactory
as the input Geometry.public GeometryEditorEx(GeometryFactory targetFactory)
Geometry
s with the given GeometryFactory
.targetFactory
- the GeometryFactory to create edited Geometrys withpublic GeometryEditorEx(GeometryEditorEx.GeometryEditorOperation operation)
GeometryOperation
and the same GeometryFactory
as the input Geometry.operation
- the edit operation to usepublic GeometryEditorEx(GeometryEditorEx.GeometryEditorOperation operation, GeometryFactory targetFactory)
GeometryOperation
and the given GeometryFactory
.operation
- the edit operation to usetargetFactory
- the GeometryFactory to create edited Geometrys withpublic void setCopyUserData(boolean isUserDataCopied)
isUserDataCopied
- true if the input user data should be copied.public Geometry edit(Geometry geometry)
Geometry
.
Clients can create subclasses of GeometryEditorEx.GeometryEditorOperation
or
GeometryEditorEx.CoordinateOperation
to perform required modifications.geometry
- the Geometry to editGeometry
which is the result of the editing (which may be empty)Copyright © 2018. All rights reserved.