I want to do a distance search via postgis
sql function distance_sphere() or distance_spheroid() in hql but couldn't
find any examples how to do that.
I also looked into the source code test
suite suggested in another thread but also couldn't find anything.
So could anyone help me how to perform
a distance query in a spherical reference system?
The Postgis distance_sphere() and distance_spheroid() are not in the
Simple Feature Specifications (SFS), that is why they are not
registered with HQL. Adding these functions would also be contrary
to the intent, which is to have an SFS-compliant Hibernate extension
that works the same across all supported databases.
So what do you do? For now, I think, you should use a Native SQL
query. This bypasses Hibernate and uses the JDBC directly. Check the
Hibernate documentation relating to the Session.createSQLQuery() method.
Soon, Hibernate Spatial will have a facility that exposes the native
spatial support of the database through a database-specific
SpatialProjection/SpatialRelateExpression factory class. See this
post for relevant discussion: http://www.hibernatespatial.org/ pipermail/hibernatespatial-dev/2007-November/000021.html
Btw, may I invite you to subscribe to the mailing list? Your post was
initially blocked because you're not a list member.
> Hi list,
> I want to do a distance search via postgis sql function
> distance_sphere() or distance_spheroid() in hql but couldn't find
> any examples how to do that.
> I also looked into the source code test suite suggested in another
> thread but also couldn't find anything.
> So could anyone help me how to perform a distance query in a
> spherical reference system?
> hibernatespatial-users mailing list
> [hidden email] > http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/ > hibernatespatial-users