Filter GeoJSON features
Keep only the features you want. Filter by a property — equals, contains, starts with, a numeric comparison, a comma-separated list, or a regular expression — and by geometry type, with one tick to invert the whole thing.
Filter GeoJSON features
What this tool does
It tests every feature against one property condition and one geometry-type condition, and returns a FeatureCollection of the ones that pass. Properties and ids are preserved untouched — this only ever removes features, never edits them.
The intent it closes: "this file has 4,000 features and I need the 40 in one category." That is the usual shape of an open-data download: one national file where you want one region, one land-use class, or everything above a population threshold.
You do not have to know the property names. Paste the file and every property in it is listed above the panes with how many features carry it — click one and it fills the filter, together with a value when the field has few enough distinct ones to guess. A property present on only some features is marked, because that is usually the interesting one and also the usual reason a filter unexpectedly returns nothing.
How this tool works
One pass, two conditions, both optional.
1. Read the conditions
If a property name is given, its value is compared using the test you picked. Leaving the property blank skips the property test entirely, which lets you filter on geometry type alone. Both conditions must pass for a feature to be kept.
2. Compare
String tests (equals, contains, starts with, in-list) compare text, respecting the ignore case tick. Numeric tests parse both sides as numbers, so a value stored as the string "42" still compares correctly, and a non-numeric value simply fails the test. has a value and is empty or absent ignore the value box — they test presence. matches regex compiles your pattern (case-insensitively when the tick is on) and reports a clear error if it is invalid.
3. Collect and report
Surviving features go into a new collection in their original order. The status line reports how many of how many were kept, which is the fastest way to tell a too-narrow filter from a misspelled property name — a typo keeps nothing at all.
Options
Test
in list takes comma-separated values and is the compact way to keep several categories at once. matches regex handles the cases the simple tests cannot — a prefix pattern, an alternation, an anchored match. The numeric comparisons work on any value that parses as a number, whatever its JSON type.
Geometry
Restricts to one geometry type. Combine it with a property test to pull, say, only the Polygon features tagged as parks out of a mixed layer. Features with a null geometry never match a specific type.
invert
Flips the whole condition — the fastest way to remove a category rather than isolate it. Run the filter once normally to see the count, then tick invert to keep the complement.
Example
Input, filtering type in list park,forest:
{"type":"FeatureCollection","features":[
{"type":"Feature","properties":{"type":"park"},"geometry":{"type":"Point","coordinates":[0,0]}},
{"type":"Feature","properties":{"type":"road"},"geometry":{"type":"Point","coordinates":[1,1]}},
{"type":"Feature","properties":{"type":"forest"},"geometry":{"type":"Point","coordinates":[2,2]}}
]}
Output:
{
"type": "FeatureCollection",
"features": [
{ "type": "Feature", "properties": { "type": "park" }, "geometry": { "type": "Point", "coordinates": [0, 0] } },
{ "type": "Feature", "properties": { "type": "forest" }, "geometry": { "type": "Point", "coordinates": [2, 2] } }
]
}
The status line reads Kept 2 of 3 features. Ticking invert would return the single road feature instead.
Tips & common pitfalls
- Nothing kept usually means a misspelled key. Property names are case-sensitive;
Nameandnameare different keys. Run stats to list the exact keys the file uses. - One condition at a time. For an AND of two property tests, filter twice — the second run takes the first run's output, which the session hand-off makes automatic.
- Nested properties are not addressable. The test looks at top-level keys only. Flatten nested attributes upstream if you need to filter on them.
- Filtering does not shrink geometries. If the goal is a smaller file, follow up with precision or simplify.
FAQ
Can I filter by location instead of attributes?
Not here — this is an attribute and geometry-type filter. For a spatial window, compute a bbox and filter in a GIS tool or PostGIS, where a real spatial index applies.
Are numbers compared as numbers or text?
The four comparison operators parse both sides as numbers, so "9" is correctly less than 10. The string tests compare text, where "9" sorts after "10".
What regex flavour is supported?
JavaScript regular expressions, since it runs in your browser — character classes, groups, alternation, anchors and lookahead all work. An invalid pattern is reported in the status bar rather than silently matching nothing.
Is my data uploaded?
No. Filtering happens in the page.