Premium apps Part of RavingDesk
RavingDesk GeoJSON Validator & Inspector
Validate and repair GeoJSON (RFC 7946) and measure areas and lengths on WGS84.
Try an example: Park outline, a street and a monument in Berlin, with a test point · A broken file: open ring, swapped coordinates, missing properties, crs member · A 1 km buffer around a point and a line
How it works
Checks a GeoJSON file against RFC 7946 with a plain-language problem list (open rings, wrong winding order, swapped longitude/latitude, out-of-range positions, obsolete crs, antimeridian edges), repairs what can be repaired without guessing, and reports geodesic polygon areas, perimeters and line lengths on the WGS84 ellipsoid, the bounding box (antimeridian-aware), centroids, which polygons contain a test point, and an optional geodesic buffer around points and lines. It is the GeoJSON engine of RavingDesk’s Data & charts.
- Validation follows RFC 7946: object structure, positions of 2–3 numbers within ±180° longitude and ±90° latitude, lines with ≥ 2 positions, closed rings with ≥ 4 positions, Feature members “geometry” and “properties”, bbox shape. The right-hand rule (counter-clockwise outer rings, clockwise holes) is reported as a warning, as the RFC tells parsers not to reject such files.
- Ring orientation and areas use geodesic polygons on WGS84 (Karney 2013): edges are geodesics, so areas are exact for the polygon with geodesic edges. Holes are subtracted. Line lengths are geodesic too.
- Point-in-polygon tests treat edges as straight lines in longitude/latitude (the usual GIS convention for GeoJSON) with the even–odd rule, holes respected; edges that jump more than 180° are read as crossing the antimeridian.
- The bounding box is the smallest longitude interval around all positions, so it may cross the antimeridian (west > east, RFC 7946 §5.2). The centre is the normalised 3D mean of the positions; the area centroid is area-weighted in degrees.
- Buffers: points get a geodesic circle of 64 vertices; lines get offset vertices at the buffer distance with round joins and caps. They are approximations (the line outline can self-intersect at sharp inner bends) and polygons are not buffered.
Sources
- RFC 7946: The GeoJSON Format (IETF, 2016)
- Algorithms for geodesics (J. Geodesy 87, 43–55) (C. F. F. Karney, 2013)
- GeographicLib (MIT licence) — geodesic routines transcribed by the engine (C. F. F. Karney)
Part of RavingDesk
-
RavingDesk Paper trading & data workspace
Practise trading on paper and chart your data: orders, risk, datasets, analyses, reports.
Related tools
- RavingDesk GPS File Converter (GPX ↔ KML ↔ GeoJSON) – Convert GPX, KML and GeoJSON, simplify tracks and get length, climb, descent and duration.
- RavingDesk Geodesic Distance & Bearing Calculator – Exact distance, bearings and midpoint between coordinates or along a route on WGS84.
- Geo Data Visualizer – Map CSV coordinates or GeoJSON as points, proportional circles, hex-bin heatmaps or choropleths.
How to use the RavingDesk GeoJSON Validator & Inspector
Check a GeoJSON file against RFC 7946, repair open rings and winding order, and measure polygon areas and line lengths on the WGS84 ellipsoid.
What it is for
GeoJSON looks simple, but small mistakes break maps and analyses in confusing ways. A ring is not closed, longitude and latitude are swapped, or a polygon runs the "wrong" way round so that some libraries fill the whole world instead of your field. Files exported from older tools may still carry the crs member that RFC 7946 removed.
Paste a FeatureCollection, a Feature or a bare geometry. The inspector lists every problem in plain words with its JSON path, repairs what can be repaired without guessing, and lets you download the repaired file. It also measures the data on the WGS84 ellipsoid: polygon areas (holes subtracted), perimeters, line lengths, the bounding box and centroids. Optionally, it tells you which polygons contain a test point and draws approximate buffers around points and lines.
It does not invent coordinates. Swapped or out-of-range positions are reported, not changed.
Worked example
An allotment drawn by hand: the outer ring runs clockwise and is not closed, and the pond (a hole) runs counter-clockwise. The test point 47.3705, 8.5407 is inside the pond.
| Result | Value |
|---|---|
| RFC 7946 | not valid (1 error, 2 warnings) |
| Problems | ring not closed; outer ring clockwise; hole counter-clockwise |
| Repairs | closed 1 open ring; reversed 2 rings |
| Polygon area | 0.010916 km² (10,916.3 m²) |
| Perimeter | 0.613 km |
| Bounding box | 8.54, 47.37, 8.5415, 47.371 |
| Polygons containing the test point | none |
The summary says "The repaired file is valid", and the repaired GeoJSON is offered as a download. The test point lies in the pond, so the allotment does not contain it, because holes are respected. The area already excludes the pond.
How to read the result
- Errors make the file invalid GeoJSON. Warnings mean the file is valid but likely to cause trouble, for example the winding order: RFC 7946 tells readers not to reject such files. Notes are information, such as edges that cross the antimeridian.
- Repairable: yes marks problems that the download fixes.
- Polygon area and Perimeter are geodesic on WGS84. Edges are treated as the shortest paths between vertices.
- The bounding box is [west, south, east, north]. When west is larger than east, the box crosses the 180° meridian.
- The Features table gives area, length and position count per feature.
Tips and common mistakes
- GeoJSON lists longitude first:
[13.40, 52.52], not[52.52, 13.40]. A "may be swapped" error usually means exactly this. - Use "Round coordinates" with 6 decimals (about 0.1 m) to shrink files from GPS devices that write 15 decimals.
- The point-in-polygon test uses straight edges in longitude/latitude, as most GIS software does. For huge polygons with long east-west edges, geodesic edges can differ slightly.
- Buffers are approximations. Line buffers can self-intersect at sharp inner bends, and overlapping buffers are not merged.
FAQ
Why is a clockwise polygon only a warning?
RFC 7946 requires counter-clockwise outer rings for new files but tells parsers not to reject old ones. Some software ignores winding, and some fills the wrong side. The repair makes the file safe either way.
How accurate are the areas?
They use Karney's geodesic polygon algorithm on WGS84, which is exact for polygons with geodesic edges and also works around the poles.
What is the difference between the centre and the area centroid?
The centre is the average of all positions on the sphere. The area centroid weights polygons by their area, which is usually what you want for a label position.
Can I convert the repaired file to GPX or KML?
Yes. Download it and use the RavingDesk GPS File Converter.
Guide last updated:
For scripts and AI agents
- JSON API:
POST https://ravingdeskgeojsoninspector.usefulweb.site/api/v1/calculate(same calculation as this page) - Interface description: OpenAPI 3.1 · AI guide: llms.txt
- MCP server (Streamable HTTP):
https://ravingdeskgeojsoninspector.usefulweb.site/mcp· tool nameravingdesk_geojson_inspector
Example request
curl -s -X POST https://ravingdeskgeojsoninspector.usefulweb.site/api/v1/calculate \
-H 'content-type: application/json' \
-d '{…see OpenAPI examples…}'