how do I compare latitudes and longitudes?

0
Dear fellow mendix developers, How do I compare 2 Latitudes and Longitudes? See Image What it does is: If you click on the blue button it looks for the Current GEO Location and fills the Latitude and Longitude in the Latitude and Longitude fields in. What i want is: if the Latitude and Longitude calculated by the blue button is almost the same as one of the Installation locations listed in the database then it should automatically select the best choice in the dropdownbox, if it isn't close like more than 50 metres away from the current location then it should give the message "choose location manually!"
asked
2 answers
0

This is something you'll have to solve using Math, and calculate what the distance is between the two points. The formula to do this is pretty complex, and uses the sinus and inverse tangent. Those aren't functions we currently have in microlfow.

You'll probably want to make a Java action to do this, see this post for the Java function to do the calculation. http://stackoverflow.com/questions/837872/calculate-distance-in-meters-when-you-know-longitude-and-latitude-in-java

answered
0

Maybe best to look for a service that already provides these kind of lookups.

answered