|
deegree 2.2 (2008/12/22 11:33 build-3038-official) | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.deegree.enterprise.control.AbstractListener
org.deegree.portal.standard.wfs.control.GeometryValidator
public class GeometryValidator
This listener validates simple geometries. The geometries to be validated are passed in as the
value of the 'GEOMETRY'
parameter of such an RPC request:
<methodCall> <methodName>dig:checkGeometry</methodName> <params> <param><value><struct><member> <name>GEOMETRY</name> <value><string>POLYGON(( 7.38 49.64, 12.03 48.7, 11.34 51.66, 11.34 51.66, 7.38 49.64 ))</string></value> </member></struct></value></param> </params> </methodCall>Subclasses may override
validateRequest( RPCWebEvent rpcEvent )
,
createGeometry( RPCWebEvent rpcEvent )
and/or validateGeometry() if they want to change
the behaviour regarding request validation, geometry creation and/or geometry validation,
respectively. Especially the last method may be different according to use-cases. The result of
the validation is put in the session under the key GeometryValidator.GEOMETRY_STATE
.
Field Summary | |
---|---|
protected Geometry |
geometry
|
static String |
GEOMETRY_STATE
|
static String |
INFORMALLY_VALID_GEOMETRY
|
static String |
INVALID_GEOMETRY
|
static String |
VALID_GEOMETRY
|
Constructor Summary | |
---|---|
GeometryValidator()
|
Method Summary | |
---|---|
void |
actionPerformed(FormEvent event)
This method validates the RPC-encoded request ( validateRequest(RPCWebEvent) ),
create some geometry from the request parameters (createGeometry(RPCWebEvent) and
then validate this geometry (validateGeometry() . |
protected Geometry |
createGeometry(RPCWebEvent rpcEvent)
Creates the geometry from the data provided it the request (rpcEvent). |
protected Object |
validateGeometry()
Validates this object's Geometry and return an object, preferably a code,
indicating the validity state of the geometry. |
protected void |
validateRequest(RPCWebEvent rpcEvent)
Validates the incoming RPc request. |
Methods inherited from class org.deegree.enterprise.control.AbstractListener |
---|
getAlternativeNextPage, getHomePath, getInitParameter, getInitParameterList, getNextPage, getRequest, getReturnValue, gotoErrorPage, handle, setAlternativeNextPage, setDefaultAlternativeNextPage, setDefaultNextPage, setNextPage, setReturnValue, toModel |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String GEOMETRY_STATE
public static final String VALID_GEOMETRY
public static final String INVALID_GEOMETRY
public static final String INFORMALLY_VALID_GEOMETRY
protected Geometry geometry
Constructor Detail |
---|
public GeometryValidator()
Method Detail |
---|
public void actionPerformed(FormEvent event)
validateRequest(RPCWebEvent)
),
create some geometry from the request parameters (createGeometry(RPCWebEvent)
and
then validate this geometry (validateGeometry()
. The result of this validate is
made available to the request object as an attribute under the key
GeometryValidator.GEOMETRY_STATE
.
actionPerformed
in interface WebListener
actionPerformed
in class AbstractListener
event
- the event containing the RPC-emcoded request.protected void validateRequest(RPCWebEvent rpcEvent) throws Exception
'GEOMETRY'
, checks if the valeu is empty and looks no further. The expected
value is a well-known geometry representation.
rpcEvent
- the event containing at least a struct with a string type parameter named
'GEOMETRY'
.
Exception
- If no such parameter is found or if the value is empty. This is interpreted as an
exception and the resulting message is sent back to the client.protected Geometry createGeometry(RPCWebEvent rpcEvent) throws Exception
rpcEvent
- the RPCWebEvent
conatining the request
WKTAdapter.wrap(String, org.deegree.model.crs.CoordinateSystem)
to create the
new Geometry
.
Exception
- if the Geometry
creation failed.validateRequest(RPCWebEvent)
protected Object validateGeometry()
Geometry
and return an object, preferably a code,
indicating the validity state of the geometry. There are three type of geometry validity
states.
GeometryValidator.VALID_GEOMETRY
: The geometry is perfecly OK,GeometryValidator.INVALID_GEOMETRY
: The geometry is not OK (self
intersection, missing points, etc),GeometryValidator.INFORMALLY_VALID_GEOMETRY
: The geometry is OK,
although it may not be considered formally correct in most GIS contexts. For example,
polygons are supposed to have counter-clockwise outter rings, lines may no self-intersect,
etc.Geometry.isValid()
)
and, in the case of polygons, for the order of the coordinates (in other words, whether they
are counter-clockwise}. GeometryValidator.GEOMETRY_STATE
.
|
deegree 2.2 (2008/12/22 11:33 build-3038-official) | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://deegree.sourceforge.net