private static void export( SpatialOperator operator, XMLStreamWriter writer ) throws XMLStreamException, UnknownCRSException, TransformationException { QName elementName = spatialOperatorTypeToElementName.get( operator.getSubType() ); if ( elementName == null ) throw new IllegalArgumentException( "Encoding of spatial operator subtype " + operator.getSubType() + " is not supported yet!" ); writer.writeStartElement( elementName.getNamespaceURI(), elementName.getLocalPart() ); switch ( operator.getSubType() ) { case BBOX: geometry = ( (BBOX) operator ).getBoundingBox(); break; default: throw new IllegalArgumentException( "Encoding of spatial operator subtype " + operator.getSubType() + " is not supported yet!" );
throws XMLStreamException, UnknownCRSException, TransformationException { QName elementName = spatialOperatorTypeToElementName.get( operator.getSubType() ); writer.writeStartElement( elementName.getNamespaceURI(), elementName.getLocalPart() ); Measure distance = null; switch ( operator.getSubType() ) {
switch ( o.getSubType() ) { case BBOX: return new BBOX( (Expression) os[0], (Envelope) os[1] );
private static BBOX extractBBox( SpatialOperator oper ) { SubType type = oper.getSubType(); switch ( type ) { case BBOX: return (BBOX) oper; case CONTAINS: // Oracle does not like zero-extent bboxes if ( !( ( (Contains) oper ).getGeometry() instanceof Point ) ) return new BBOX( ( (Contains) oper ).getParam1(), ( (Contains) oper ).getGeometry().getEnvelope() ); return null; case CROSSES: return new BBOX( ( (Crosses) oper ).getParam1(), ( (Crosses) oper ).getGeometry().getEnvelope() ); case DWITHIN: // TOOD use enlarged bbox return null; case EQUALS: return new BBOX( ( (Equals) oper ).getParam1(), ( (Equals) oper ).getGeometry().getEnvelope() ); case INTERSECTS: return new BBOX( ( (Intersects) oper ).getParam1(), ( (Intersects) oper ).getGeometry().getEnvelope() ); case OVERLAPS: return new BBOX( ( (Overlaps) oper ).getParam1(), ( (Overlaps) oper ).getGeometry().getEnvelope() ); case WITHIN: return new BBOX( ( (Within) oper ).getParam1(), ( (Within) oper ).getGeometry().getEnvelope() ); default: { return null; } } }
int srid = propNameExpr.getSRID() != null ? Integer.parseInt( propNameExpr.getSRID() ) : 0; switch ( op.getSubType() ) { case BBOX: { BBOX bbox = (BBOX) op;
int srid = propNameExpr.getSRID() != null ? Integer.parseInt( propNameExpr.getSRID() ) : -1; switch ( op.getSubType() ) { case BBOX: { BBOX bbox = (BBOX) op;
case SPATIAL: GeometryFactory gf = new GeometryFactory(); switch ( ( (SpatialOperator) op ).getSubType() ) { case BBOX: BBOX bbox = (BBOX) op;