Test files › Geospatial › points.geojson
Sample GeoJSON file (points)
A valid GeoJSON FeatureCollection with Point, LineString and Polygon features and properties.
↓ Download points.geojson| Filename | points.geojson |
| Format | GeoJSON |
| Size | 1.2 KB (1,262 bytes) |
| MIME type | application/geo+json |
| SHA-256 | 99bd7b583968d210f1804002156f079c895c7bab473826aee2128b9c3554ade5 |
What this file catchesMap ingestion and GIS import. Covers all three core geometry types plus a feature with mixed property types, so a viewer that only handles points will visibly drop the rest.
Handle it in code
Each snippet below was run against this exact file with Python 3.14.4 and Node 24.15.0 when this page was built, and the output shown is what it printed.
Python
GeoJSON is [longitude, latitude], polygon rings must close, and RFC 7946 (section 3.1.9) asks for lines that cross the 180th meridian to be split, or a map draws them the long way round the world.
import json
def points(c):
if isinstance(c, list) and c and all(isinstance(v, (int, float)) for v in c):
yield c
elif isinstance(c, list):
for item in c:
yield from points(item)
def check(geom, n):
kind, coords = geom.get("type"), geom.get("coordinates") or []
for p in points(coords):
if len(p) < 2 or not (-180 <= p[0] <= 180 and -90 <= p[1] <= 90):
yield f"feature {n}: {p} is not [longitude, latitude] in range"
if kind == "Polygon":
for ring in coords:
if len(ring) < 4 or ring[0] != ring[-1]:
yield f"feature {n}: polygon ring is not closed (4+ positions, last equal to first)"
if kind in ("LineString", "Polygon"):
line = coords if kind == "LineString" else coords[0]
for a, b in zip(line, line[1:]):
if abs(a[0] - b[0]) > 180:
yield f"feature {n}: {a} to {b} crosses the antimeridian; split it"
with open("points.geojson", encoding="utf-8") as f:
features = json.load(f)["features"]
found = [p for n, feat in enumerate(features, 1) for p in check(feat.get("geometry") or {}, n)]
print(f"{len(features)} features:", "valid" if not found else f"{len(found)} problem{'s' * (len(found) != 1)}")
for p in found:
print(" " + p)Run against this file, it prints: 3 features: valid
Related guides and tools
Download & verify
curl -fsSL -o "points.geojson" "https://files.hexaqa.com/geo/points.geojson"
curl -fsSL "https://files.hexaqa.com/geo/points.geojson" | sha256sum
# expect: 99bd7b583968d210f1804002156f079c895c7bab473826aee2128b9c3554ade5