1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-01-31 17:15:14 +01:00

Properly handle axis order in geo URIs

This commit is contained in:
Martin Tůma 2025-01-21 21:45:49 +01:00
parent db2d81042b
commit 213ab73ceb

View File

@ -158,8 +158,7 @@ Data::Data(const QString &fileName, bool tryUnknown)
Data::Data(const QUrl &url) Data::Data(const QUrl &url)
{ {
bool caOk, cbOk, ccOk; bool caOk, cbOk, ccOk;
Coordinates c; Projection proj(GCS::WGS84());
Projection proj;
_valid = false; _valid = false;
@ -205,7 +204,9 @@ Data::Data(const QUrl &url)
} }
} }
c = proj.isValid() ? proj.xy2ll(PointD(ca, cb)) : Coordinates(cb, ca); CoordinateSystem::AxisOrder ao = proj.coordinateSystem().axisOrder();
PointD p(ao == CoordinateSystem::XY ? PointD(ca, cb) : PointD(cb, ca));
Coordinates c(proj.xy2ll(p));
if (!c.isValid()) { if (!c.isValid()) {
_errorString = "Invalid coordinates"; _errorString = "Invalid coordinates";
return; return;