File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,10 @@ export const UNIT = {
4141 * Distance unit in meter.
4242 */
4343 METER : 2 ,
44+ /**
45+ * Distance unit in foot.
46+ */
47+ FOOT : 3 ,
4448} as const ;
4549
4650/**
@@ -56,8 +60,10 @@ export function is4326(crs: ProjectionLike) {
5660function unitFromProj4Unit ( proj : ProjectionDefinition ) {
5761 if ( proj . units === 'degrees' ) {
5862 return UNIT . DEGREE ;
59- } else if ( proj . units === 'm' ) {
63+ } else if ( proj . units === 'm' || proj . units === 'meter' ) {
6064 return UNIT . METER ;
65+ } else if ( proj . units === 'foot' ) {
66+ return UNIT . FOOT ;
6167 } else if ( proj . units === undefined && proj . to_meter === undefined ) {
6268 // See https://proj.org/en/9.4/usage/projections.html [17/10/2024]
6369 // > The default unit for projected coordinates is the meter.
@@ -71,7 +77,7 @@ function unitFromProj4Unit(proj: ProjectionDefinition) {
7177 * Returns the horizontal coordinates system units associated with this CRS.
7278 *
7379 * @param crs - The CRS to extract the unit from.
74- * @returns Either `UNIT.METER`, `UNIT.DEGREE` or `undefined`.
80+ * @returns Either `UNIT.METER`, `UNIT.DEGREE`, `UNIT.FOOT` or `undefined`.
7581 */
7682export function getUnit ( crs : ProjectionLike ) {
7783 mustBeString ( crs ) ;
You can’t perform that action at this time.
0 commit comments