Turfjs / Turfjs/turf

turf-tag: Allow specifying feature level attributes as fields

Open
#1,841 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

@turf/tag enhancement
Dominant language
TypeScript
Stars
10.5k
Forks
1k
Avg merge
1h 11m
Merged PRs (30d)
4

Description

turf-tag currently takes a field and outField which it expects to be an an attribute of the properties object.

In some cases however, the desired field may be a feature level attribute not part of the property object like id in this example:

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "id": 12345,
      "properties": {},
      "geometry": {
       ...
      }
    }
  ]
}

Its currently not possible to target such attributes.

A way to specify the field refers to a feature level attribute will be very useful, especially while working with Mapbox vector tiles which commonly has feature level ids.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the turf-tag implementation and documentation to understand how field and outField currently read from properties. Define how callers identify feature-level attributes such as id, then verify that property-based fields continue to work and that the documented example is supported.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
data
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.