mapbox / mapbox/tippecanoe

filter features by field

Open
#893 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
3.1k
Forks
430
PR merge metrics
No merged PRs in 30d

Description

My data has a "level" field(the start zoom this feature will been shown), I want to filter feature by "$zoom" and "level".

For example,

feature id level
1 10
2 10
3 11
4 11
5 12
6 12

In zoom 10, the tiles only contain feature 1 and 2.
In zoom 11, the tiles contain feature 1, 2, 3 and 4.
In zoom 12, the tiles contain all feature.

I use thne command like 👇:
ippecanoe -Z0 -z18 -o ./example.mbtiles -j '{ "*": [">=", "$zoom", "level"]}' -ps -pn -pt -pk -pf --force ./example.geojson

but it return an warn Warning: mismatched type in comparison: [">=","$zoom","level"], and the generated mbtiles's size is only 33kb, looks like there's no valid tile in mbtiles.

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 by reproducing the ippecanoe command with example.geojson and inspect how the -j filter expression handles "$zoom" and the "level" field. Confirm the expected feature counts at zoom levels 10, 11, and 12, and ensure the mismatched-type warning is resolved.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.