Re: hibernatespatial-users Digest, Vol 43, Issue 16

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: hibernatespatial-users Digest, Vol 43, Issue 16

Coquelicot-2
Hi Shane,

I found this class (ant its distance() method) but according to what I found in the docs, the distance will be returned in geometry's units - which are degrees that I would have to convert to meters somehow. Maybe I am wrong?...

Best regards,

Łukasz
 
Hi,

Have you looked
into com.vividsolutions.jts.operation.distance.DistanceOp.distance(Geometry
g0, Geometry g1)?

http://www.vividsolutions.com/jts/javadoc/com/vividsolutions/jts/operation/distance/DistanceOp.html

<http://www.vividsolutions.com/jts/javadoc/com/vividsolutions/jts/operation/distance/DistanceOp.html>
-Shane




_______________________________________________
hibernatespatial-users mailing list
[hidden email]
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users
Reply | Threaded
Open this post in threaded view
|

Re: hibernatespatial-users Digest, Vol 43, Issue 16

Wouter Schaubroeck
Hi,

Actually, what I do in that case, is transforming the coordinates to a cartographic projection (in your case I would go for a equidistant), with the units in meters (Mercator, Lambert, UTM, ...). Perhaps this could do the job?

grtz, w
--
Wouter
http://blog.giswhat.be


On 25 March 2011 15:31, Coquelicot <[hidden email]> wrote:
Hi Shane,

I found this class (ant its distance() method) but according to what I found in the docs, the distance will be returned in geometry's units - which are degrees that I would have to convert to meters somehow. Maybe I am wrong?...

Best regards,

Łukasz
 
Hi,

Have you looked
into com.vividsolutions.jts.operation.distance.DistanceOp.distance(Geometry
g0, Geometry g1)?

http://www.vividsolutions.com/jts/javadoc/com/vividsolutions/jts/operation/distance/DistanceOp.html

<http://www.vividsolutions.com/jts/javadoc/com/vividsolutions/jts/operation/distance/DistanceOp.html>
-Shane




_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: hibernatespatial-users Digest, Vol 43, Issue 16

Coquelicot-2
Wouter,

thanks for the tip - that was exactly what I was trying to do but I got a little bit confused :). The problem is that my application is a database with it's own query language; from the issued query I try to create HQL that is used to query the Hibernate Spatial objects. I end up with the following HQL:

...and distance(COVERAGE.spatialbox, geometry1 <= distance)

where COVERAGE.spatialbox is a geometry database column and geometry1 is a JTS Geometry object parsed elsewhere and distance is a double.

I tried to some tricks (at least for the PostGIS Hibernate Spatial dialect) trying to convert the geometry into geography using a cartographic projection inside of the query above but failed to create PostGIS Geography from the COVERAGE.spatialbox part... :/

Best regards,

Lukasz


On Sun, Mar 27, 2011 at 6:21 PM, Wouter Schaubroeck <[hidden email]> wrote:
Hi,

Actually, what I do in that case, is transforming the coordinates to a cartographic projection (in your case I would go for a equidistant), with the units in meters (Mercator, Lambert, UTM, ...). Perhaps this could do the job?

grtz, w
--
Wouter
http://blog.giswhat.be


On 25 March 2011 15:31, Coquelicot <[hidden email]> wrote:
Hi Shane,

I found this class (ant its distance() method) but according to what I found in the docs, the distance will be returned in geometry's units - which are degrees that I would have to convert to meters somehow. Maybe I am wrong?...

Best regards,

Łukasz
 
Hi,

Have you looked
into com.vividsolutions.jts.operation.distance.DistanceOp.distance(Geometry
g0, Geometry g1)?

http://www.vividsolutions.com/jts/javadoc/com/vividsolutions/jts/operation/distance/DistanceOp.html

<http://www.vividsolutions.com/jts/javadoc/com/vividsolutions/jts/operation/distance/DistanceOp.html>
-Shane




_______________________________________________
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