0

I have longitude and latitude coordinates saved in a database and would like to map it to a MySQL POINT column in another MySQL table.

I'd like to use spring data Point in my code with the constructor Point(double x, double y). Unfortunately, I cannot find out which parameter (x or y) corresponds to which geo-location coordinate? How do I create a Point with latitude and longitude correctly?

Ira Re
  • 730
  • 3
  • 9
  • 25
  • ? You've got a 50/50 chance of guessing it right first time, right? – Strawberry Apr 20 '21 at 10:46
  • Yes, sure. It would be still nice to get some explicit documentation on that. I also updated my question with a code sample and the error message I get during the test. – Ira Re Apr 20 '21 at 10:58
  • There seem to be two mostly unrelated questions here: How to use `Point` with Spring Data JDBC, and what the relationship between `Point.x` and `Point.y` on one hand and longitude and latitude on the other is. Could you clarify, which is your actual question? You might want a separate question for the other. – Jens Schauder May 04 '21 at 07:40
  • One of the two questions would be a duplicate of this one: https://stackoverflow.com/questions/60492254/spring-data-jdbc-how-to-use-point-from-org-springframework-data-geo-package I suggest editing the question to just ask the other one. – Jens Schauder May 04 '21 at 07:41
  • Yes, you are right. I removed the duplicate part of the code related to the mapping of the Point type to a MySQL point. – Ira Re May 12 '21 at 11:00

0 Answers0