filter features by field
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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