DB2 code

I don't really understand how the spatial filter expression is supposed 
to be used.

Looking at the comment in org.hibernate.criterion.SpatialFilter
  * An implementation for a simple spatial filter. This 
<code>Criterion</code>
  * restricts the resultset to those features whose bounding box 
overlaps the
  * filter geometry. It is intended for quick, but inexact spatial queries.
It sounds like this is something like ST_MBRIntersects or 
EnvelopesIntersect(geom, x1, y1, x2, y2, srid) (DB2-specific)

What would the source syntax look like?

On 11/24/2014 3:35 PM, Karel Maesen wrote:
>
> In 
> hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/db2/DB2SpatialDialect.java:
>
> > +		case SpatialAggregate.EXTENT:  // same as extent function above???
> > +			return "db2gse.ST_GetAggrResult(MAX(db2gse.st_BuildMBRAggr(" + columnName + ")))";
> > +		case SpatialAggregate.UNION:
> > +			return "db2gse.ST_GetAggrResult(MAX(db2gse.st_BuildUnionAggr(" + columnName + ")))";			
> > +		default:
> > +			throw new IllegalArgumentException(
> > +					"Aggregation of type "
> > +							+ type + " are not supported by this dialect"
> > +			);
> > +	}
> > +	}
> > +
> > +	@Override
> > +	public String getSpatialFilterExpression(String arg0) {
> > +		// TODO Auto-generated method stub
> > +		return null;
>
> This breaks the contract: a non-null expression is required. May just 
> use st_within()?
>
> —
> Reply to this email directly or view it on GitHub 
> <https://github.com/maesenka/hibernate-core/pull/6/files#r20819953>.
>



---
This email has been checked for viruses by Avast antivirus software.
http://www.avast.com