This tool generates valid GeoJSON — a FeatureCollection of random Point, LineString, or Polygon features with fake property data — for testing mapping libraries without hand-writing fixtures. The output follows RFC 7946 exactly, including the spec’s longitude-first coordinate order and properly closed polygon rings.
How it works
GeoJSON wraps geometry in Feature objects, which are collected into a FeatureCollection. The tool builds each feature around the center point you provide:
- Point — a single
[lon, lat]position jittered near the center. - LineString — a chain of 2 to 5 connected positions that wander from the center.
- Polygon — a ring of vertices placed around the center on a small circle, with the first vertex repeated at the end to close the ring as the spec requires.
Each feature also receives a properties object with an id, name, category, numeric value, and active flag so you can exercise popups, styling, and filtering.
The coordinate order gotcha
The single most common GeoJSON bug is swapping latitude and longitude. The GeoJSON specification (RFC 7946, section 3.1.1) requires position arrays in [longitude, latitude] order — the opposite of the everyday convention of “latitude, longitude” that most people learn first. This tool always outputs longitude first, so if your data appears plotted on the wrong side of the world, the culprit is almost certainly the consuming code reversing the pair, not the GeoJSON itself.
What the properties object tests
Every feature carries:
- id — a numeric identifier, useful for testing selection and hover state.
- name — a short generated string, good for popup labels.
- category — one of a few fixed options, letting you verify style rules that branch on property values.
- value — a numeric field for testing choropleth coloring or data-driven circle radius.
- active — a boolean, useful for filter queries such as “show only active features.”
This variety means a single batch lets you exercise popups, fill expressions, filter predicates, and click handlers all at once.
Practical example
For example, to test a Leaflet onEachFeature popup, generate 10 Points centered on London (51.5, -0.12), paste the output into your layer loader, and verify that each marker’s popup displays name and value without errors. Then switch to Mixed mode and confirm your renderer does not throw when a FeatureCollection mixes geometry types — a common failure point in typed GIS clients.
Tips
- Set the center to coordinates inside your map’s default viewport so features are immediately visible without panning.
- Use Polygon mode when testing fill rendering and click-within-polygon detection.
- LineString mode is ideal for testing route rendering, stroke-width expressions, and line-click event handling.
- Paste the output directly into geojson.io to do a quick visual sanity check before loading it into your application.