Skip to content

turf.truncate without rounding #2834

@olsp

Description

@olsp

I would like to compare two GeoJSON Features to find out if they are very similar. I use truncate and then compare the geometry. The problem is, that truncate not just cuts the values at the specified decimal but also rounds.

As an example the values 48.022774 and 48.022775 when truncated to 5 decimals lead to 48.02277 and 48.02278.

Is there a way to disable rouding when using truncate?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions