Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
I have two points and their coordinates (lon and lat) expressed in EPSG:32632. I'd like to calculate the distance between them. In my case, distance is really very small.
I've tried to use Euclidean distance but I'm not sure if it is the correct approach. I've seen other approaches such as Haversine formula.
EPSG:32632 is a projected coordinate system and its unit is meter. The coordinates are not expressed as latitude and longitude. How did you get latitude and longitude?
@KadirŞahbaz sorry, you're right. I'm a little confused, I have no experience with these concepts and I'm struggling a bit. So as you suggest, I've x and y and not lat and lon. Considering this and also meter as unit of measure do you think that it make sense using Euclidean distance?
The whole point of using a UTM projection is being able to use Cartesian trigonometry. Note that "x and y" and "lat and lon" are opposite coordinate dimensions (latitude is Y).
Yes, if you have X and Y coordinates in a Cartesian coordinate system that preserves distance (within tolerances), you can use Euclidean distance. Note that Web Mercator (EPSG:3857) does not preserve distance, so just because the units are "meters" does not mean distance calculation is automatically valid. But transverse Mercator projections are valid within their 6-degree zone.