Open SPAMLab opened 5 years ago
Sorry for the long time to answer,
OS currently uses these formulas https://www.movable-type.co.uk/scripts/latlong.html To calculate length of segments and bearing from geographic coordinates, as a way of avoiding the distortions inherent to the UTM projection. When I first implemented the feature I tried to find a good way to detect the coordinate system of the input file, but it seemed at the time that the only way would be to add proj4 or something like that. A possible heuristic to detect would be to check the range of the input numbers, and complain if they are larger than what's possible for lat/lon. Either that or actually consider the projection of the input data and transform to geographical before the operation. Any other suggestion?
https://www.movable-type.co.uk/scripts/latlong-vincenty.html Would probably be nice to add this as well, by the way.
Added a new method for converting lineaments from UTM shapefiles on the tools menu, and made clearer that the one that was already available was for geographic. Could you test it with your data? From my tests it was off by about 2 degrees, probably because of grid convergence. Do you believe this would be enough for now or would it be better to just convert to geographic? Maybe using this https://www.movable-type.co.uk/scripts/latlong-utm-mgrs.html in the case of utm before calculating would be better. Still have to set the decimal places.
Calculating azimuth and length from a lineament shapefile gives completely wrong results. I run a test on a shapefile with lines oriented NE-SW only, and the resulting azimuths are in the SE quadrant.. lengths are also wrong, instead of tens of meters (the shp is in UTM projection), I got thousands of kilometers! Plus, teh output could use just 2 decimal places for azimuth and 3 for length.
example of OS output:
what it should be: