How to get longitude/latitude of a point

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

How to get longitude/latitude of a point

fourat
Hi,
I've integrated hibernatespatial into JPA with Seam2 project, my entity has a "location" getter returning a Geometry object annotated with:
@Type(type="org.hibernatespatial.GeometryUserType")
When rendering on the view, i would like to get the longitude/latitude of each point (X and Y at least), i dont find the right getter on that location object to do so.

Thank you for helping.

_______________________________________________
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: How to get longitude/latitude of a point

Jan Boonen
Hi Fourat,

You have to cast the Geometry to type Point. Then you can use getX() and getY(). See API documentation of JTS for reference: http://tsusiatsoftware.net/jts/javadoc/index.html

Cheers,

Jan

On 22-8-2010 16:05, Fourat ZOUARI wrote:
Hi,
I've integrated hibernatespatial into JPA with Seam2 project, my entity has a "location" getter returning a Geometry object annotated with:
@Type(type="org.hibernatespatial.GeometryUserType")
When rendering on the view, i would like to get the longitude/latitude of each point (X and Y at least), i dont find the right getter on that location object to do so.

Thank you for helping.
_______________________________________________ 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: How to get longitude/latitude of a point

GavinMartin
This post has NOT been accepted by the mailing list yet.
Hi!
I agree to your post. You can use getX() and getY() for point co ordinates. Thanks!