Jim:
I am sending to you (and anyone in the list eventually interested) a
class diagram I have made on the Simple Features for SQL standard
implemented by PostGIS, where you can see that such a class does not
exist, but there is a new type called 'CircularString', or even more
appropriate, the 'CurvePolygon' which could be used for that purpose.
This last one has even the method 'ST_PointonSurface()', to be called
using SQL, of course. These are the SQL/MM types most recently added to
PostGIS.
This does not mean that some other type of implementation is not
possible, because Hibernate Spatial uses the JTS library internally, to
translate database geometry types to Java geometry types. Anyhow, I give
a quick look into the org.hibernatespatial.postgis package and did not
find Circle, not even the SQL/MM types.
As I am not a specialist (rather a newbie) on Hibernate Spatial, JTS and
the likes, I think we have to wait for a response from Karen, perhaps a
hint on how to add the missing geometry types from PostGIS.
PS: by the way, this can be a little tricky, once I heard the last
implementations of SQL/MM types on some databases are not that much
compliant with the standard.
Regards,
JP Hespanha
-----Original Message-----
From:
[hidden email]
[mailto:
[hidden email]] On
Behalf Of Jeremy
Sent: Tuesday, November 27, 2007 4:50 PM
To: Hibernate Spatial Users Discussion
Subject: [hibernatespatial-users] Spatial Query with Circle
Hello,
I'm trying to run a spatial query to know if a point is in a circle.
I use something like that :
Query q = session.createQuery("from Event where within(location, ?) =
true"); Type geometryType = new CustomType(GeometryUserType.class,
null); q.setParameter(0, filter, geometryType); List result =
q.list();
And my filter is a Circle created like that :
Circle spatialFilter = new Circle(latitude,longitude,radius);
However, I have a ClassCastException (I guess this is due to the fact
that Circle is not of type Geometry):
java.lang.ClassCastException: org.hibernatespatial.Circle
at
org.hibernatespatial.oracle.SDOGeometryType.nullSafeSet(SDOGeometryType.
java:88)
at
org.hibernatespatial.GeometryUserType.nullSafeSet(GeometryUserType.java:
183)
at
org.hibernate.type.CustomType.nullSafeSet(CustomType.java:156)
So my question is : how can we make spatial queries to search if a point
is in a circle?
Thanks in advance,
Regards,
Jim
_______________________________________________
hibernatespatial-users mailing list
[hidden email]
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users
_______________________________________________
hibernatespatial-users mailing list
[hidden email]
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users