From c0fb852d419e380845524bb167b71d83fac5cd9f Mon Sep 17 00:00:00 2001 From: pietervdvn Date: Sun, 18 Apr 2021 18:23:59 +0200 Subject: [PATCH] Fix length, update docs --- Docs/CalculatedTags.md | 4 ++++ Logic/GeoOperations.ts | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Docs/CalculatedTags.md b/Docs/CalculatedTags.md index 3393737..38fa2f7 100644 --- a/Docs/CalculatedTags.md +++ b/Docs/CalculatedTags.md @@ -11,6 +11,10 @@ The latitude and longitude of the point (or centerpoint in the case of a way/are The surface area of the feature, in square meters and in hectare. Not set on points and ways +### \_length, \_length:km + +The total length of a feature in meters (and in kilometers, rounded to one decimal for '\_length:km'). For a surface, the length of the perimeter + ### \_country The country code of the property (with latlon2country) diff --git a/Logic/GeoOperations.ts b/Logic/GeoOperations.ts index 6697fb4..43dd45a 100644 --- a/Logic/GeoOperations.ts +++ b/Logic/GeoOperations.ts @@ -15,7 +15,8 @@ export class GeoOperations { return newFeature; } - static centerpointCoordinates(feature: any){ + static centerpointCoordinates(feature: any): [number, number]{ + // @ts-ignore return turf.center(feature).geometry.coordinates; }