2

I'm trying to use INTERSECTS operation with Querydsl:

PolygonPath<Polygon> polygonpath = new PolygonPath<Polygon>(entityPath, "location");
Geometry geometry = Wkt.fromWkt("POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))");
BooleanExpression intersectsExpression = polygonpath.intersects(geometry);

and when generates BooleanExpression i'm getting the following message:

unknown operation with operator com.mysema.query.spatial.SpatialOps#INTERSECTS and args [entity.location, POLYGON((30 10,40 40,20 40,10 20,30 10))]

I'm using HibernateSpatial.. then i'm trying to do the following:

Create my own class based on your HibernateSpatialSupport to create a valid intersects operation to use on HibernateSpatial.

I've created an HibernateSpatialOps with:

private static final String NS = HibernateSpatialOps.class.getName(); public static final Operator<Object> INTERSECTS = new OperatorImpl<Object>( NS, "intersects({0}, {1})");

When i generate BooleanExpression with intersects operation appears the following message:

unknown operation with operator org.project1.querydsl.HibernateSpatialOps#intersects({0}, {1}) and args [entity.location, POLYGON ((-0.948944091796875 39.49052944781087, -0.4988479614257812 39.49052944781087, -0.4988479614257812 39.39030533696812, -0.948944091796875 39.39030533696812, -0.948944091796875 39.49052944781087))]

Can you help me?

Best Regards,

jcgarcia
  • 3,762
  • 4
  • 18
  • 32

1 Answers1

0

Hibernate Spatial support ist not yet available in Querydsl. Feel free to push it further with a pull request.

Timo Westkämper
  • 21,824
  • 5
  • 78
  • 111
  • 1
    Finally I found a solution to solve it. I've create an HibernateSpatialTemplate that gets ops values from your /test/HibernateSpatialSupport and pass when constructs JPAQuery... And that works fine using HibernateSpatial!!!... On the other hand i'm using JTS instead of geolate types...I've implemented GeometryExpression, GeometryPath, etc... To recive JTS items... Do you think is a good solution? – jcgarcia Sep 09 '14 at 16:25