Skip to content

Commit

Permalink
fix(crs): fix proj4 unit 'meter' and add 'foot'
Browse files Browse the repository at this point in the history
  • Loading branch information
ftoromanoff committed Oct 10, 2024
1 parent a5120f0 commit 781b344
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Core/Geographic/Crs.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ function formatToEPSG(crs) {
const UNIT = {
DEGREE: 1,
METER: 2,
FOOT: 3,
};

function is4326(crs) {
Expand All @@ -48,8 +49,10 @@ function isGeocentric(crs) {
function _unitFromProj4Unit(projunit) {
if (projunit === 'degrees') {
return UNIT.DEGREE;
} else if (projunit === 'm') {
} else if (projunit === 'm' || projunit === 'meter') {
return UNIT.METER;
} else if (projunit === 'foot') {
return UNIT.FOOT;
} else {
return undefined;
}
Expand Down Expand Up @@ -129,7 +132,7 @@ export default {
* Get the unit to use with the CRS.
*
* @param {string} crs - The CRS to get the unit from.
* @return {number} Either `UNIT.METER`, `UNIT.DEGREE` or `undefined`.
* @return {number} Either `UNIT.METER`, `UNIT.DEGREE`, `UNIT.FOOT` or `undefined`.
*/
toUnit,

Expand Down

0 comments on commit 781b344

Please sign in to comment.