Overview
Introduction
Sometimes you don't want to convert, validate, or query GeoJSON, you just want to look at it, and actually see the shapes it describes, without pasting it into a full mapping application.
GeoJSON Viewer is exactly that: paste GeoJSON, get an instant SVG preview of its points, lines, and polygons, plus a quick legend of what's in there.
What Is GeoJSON Viewer?
A read-only GeoJSON geometry previewer built on this category's shared SVG-rendering helper, which fits your data's longitude/latitude bounding box to a fixed viewBox and draws lines and polygons as SVG paths, points as small circles.
It's the central 'look at your geo data' tool in this category, every other geo tool that converts to or from GeoJSON links back here, the same way CSV Viewer anchors the CSV tools.
How GeoJSON Viewer Works
The pasted text is JSON.parse'd and normalized to a FeatureCollection: a FeatureCollection passes through as-is, a bare Feature or raw geometry object gets wrapped in one automatically.
That FeatureCollection is handed to the shared geoJsonToSvgPaths helper, which walks every coordinate to find the overall bounding box, then linearly projects each geometry into SVG path/point coordinates ready to render directly.
When To Use GeoJSON Viewer
Use this whenever you have GeoJSON, from an API response, a converted KML/GPX/shapefile, or hand-written test data, and want to quickly confirm it looks like what you expect.
It's especially useful right after using any of this category's converters, as the last sanity check before trusting the converted output.
Often used alongside KML to GeoJSON Converter, GPX to GeoJSON Converter and Shapefile Viewer.
Features
Advantages
- Runs entirely client-side, your GeoJSON never leaves your browser and no map tiles are fetched.
- Accepts FeatureCollections, bare Features, and raw geometry objects without requiring manual wrapping.
- A feature-count and geometry-type legend gives an at-a-glance summary alongside the visual preview.
Limitations
- No panning, zooming, or interactivity, it's a static preview fit to the data's bounding box.
- No basemap imagery (roads, place names, terrain), by deliberate design, see the FAQ above.
- GeometryCollection members and any unrecognized geometry types are skipped rather than rendered.
Examples
Best Practices & Notes
Best Practices
- Use this right after any conversion (KML, GPX, or shapefile to GeoJSON) as a quick visual sanity check before trusting the output.
- Check the legend's geometry-type list if the preview looks emptier than expected, an unsupported geometry type may be present in your data.
- Paste a bare geometry object directly when you just want to check one shape, no need to wrap it in a Feature or FeatureCollection yourself.
Developer Notes
`parseGeoJsonForViewer` in `geojson-viewer.ts` normalizes three possible top-level GeoJSON shapes (FeatureCollection, Feature, or a raw Geometry) into a single FeatureCollection before the component ever calls the shared `geoJsonToSvgPaths` from `geo-svg-render.ts`, keeping the projection math itself completely shape-agnostic and shared with `shapefile-viewer.ts`.
GeoJSON Viewer Use Cases
- Sanity-checking GeoJSON right after converting it from KML, GPX, or a shapefile
- Quickly previewing an API response's geometry without pasting it into a full mapping application
- Visually inspecting hand-written or generated GeoJSON test data before using it elsewhere
Common Mistakes
- Expecting to see roads, place names, or imagery behind the shapes, this viewer deliberately draws only your GeoJSON's own geometry, never fetched basemap tiles.
- Pasting invalid JSON (a trailing comma, unquoted keys) and expecting the geometry to render anyway, valid JSON is required before geometry parsing even starts.
Tips
- If the preview looks stretched, remember the bounding-box fit maps your data's actual lon/lat extent to the viewBox regardless of aspect ratio, that's expected for a simple fit, not a bug.
- Pair with Lat/Lng Point Finder if you need to manually add a reference coordinate alongside geometry you're previewing here.