1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-11-13 22:07:15 +00:00

Fix olc-decode and geopoint latitude and longitude order in the geospatial plugin (#8437)

* Reverse latitude and longitude in olc-decode tests to match proper geojson output format

* Reverse latitude and longitude in olc-decode to match proper geojson output format

* Reverse latitude and longitude in geopoint expected results to match proper geojson format

* Reverse latitude and longitude in geolookup expected results to match proper geojson format

* Corrected the Oxford to New York distances

* Oxford is actually 12 miles closer to New York than Winchester

Used calculator at https://www.nhc.noaa.gov/gccalc.shtml to check

Reversed latitude and longitude to correct the geojson

* Reversed the latitude and longitude turf.point arguments in the geopoint function

* Swapped latitude and longitude in geopoint function calls
This commit is contained in:
btheado
2024-07-28 08:44:09 -04:00
committed by GitHub
parent 82bf4480de
commit bb9c64b38e
10 changed files with 24 additions and 24 deletions

View File

@@ -18,7 +18,7 @@ exports.geopoint = function(source,operator,options) {
var lat = $tw.utils.parseNumber(operator.operands[0] || "0"),
long = $tw.utils.parseNumber(operator.operands[1] || "0"),
alt = $tw.utils.parseNumber(operator.operands[2] || "0");
return [JSON.stringify(turf.point([lat,long,alt]))];
return [JSON.stringify(turf.point([long,lat,alt]))];
};
})();

View File

@@ -27,14 +27,14 @@ exports["olc-decode"] = function(source,operator,options) {
obj;
if(suffixes.indexOf("bounds") !== -1) {
obj = turf.polygon([[
[olc.latitudeLo, olc.longitudeLo],
[olc.latitudeHi, olc.longitudeLo],
[olc.latitudeHi, olc.longitudeHi],
[olc.latitudeLo, olc.longitudeHi],
[olc.latitudeLo, olc.longitudeLo]
[olc.longitudeLo, olc.latitudeLo],
[olc.longitudeLo, olc.latitudeHi],
[olc.longitudeHi, olc.latitudeHi],
[olc.longitudeHi, olc.latitudeLo],
[olc.longitudeLo, olc.latitudeLo]
]]);
} else {
obj = turf.point([olc.latitudeCenter,olc.longitudeCenter]);
obj = turf.point([olc.longitudeCenter,olc.latitudeCenter]);
}
return [JSON.stringify(obj)];
};