Skip to content
Novus Examples
topojson1.5 KB

TopoJSON — Zero-Length Arc

A topology whose fourth arc repeats the same position twice, giving a line of zero length. Quantization produces these routinely when two vertices land in the same grid cell, and simplification code that divides by segment length fails on them.

Preview — first 50 linestopojson
{
  "type": "Topology",
  "objects": {
    "parcels": {
      "type": "GeometryCollection",
      "geometries": [
        {
          "type": "Polygon",
          "id": "P-010",
          "properties": {
            "name": "West Field",
            "areaHa": 1.31
          },
          "arcs": [
            [
              0,
              1
            ]
          ]
        },
        {
          "type": "Polygon",
          "id": "P-011",
          "properties": {
            "name": "East Field",
            "areaHa": 1.31
          },
          "arcs": [
            [
              -1,
              2
            ]
          ]
        },
        {
          "type": "LineString",
          "id": "Z-001",
          "properties": {
            "name": "Zero-length survey leg",
            "defect": "arc has no extent"
          },
          "arcs": [
            3
          ]
        }
      ]
    }
  },
  "arcs": [
    [
108 lines total — download for the full file.

Specifications

Format
TopoJSON 1.0
Crs
WGS 84 (EPSG:4326)
Encoding
UTF-8
Line Endings
LF
Objects
1
Arcs
4
Degenerate Arcs
1
Arc Length Degrees
0
Quantization
none
Note
arc 3 repeats a single position

Testing contract

Expected to pass
Scenario
Decode the topology and simplify or measure the resulting geometries.
Expected result
The zero-length line decodes without a division-by-zero; it is either dropped with a note or kept as a degenerate LineString, never turned into NaN coordinates.

What is a .topojson file?

TopoJSON is an extension of GeoJSON that encodes topology. Shared boundaries are stored once as arcs and referenced by the geometries that use them, coordinates are quantised to an integer grid and delta-encoded, and a transform object records the scale and translation needed to recover real positions. For data with many adjacent polygons — administrative boundaries especially — files are dramatically smaller than the equivalent GeoJSON.

How to use this file

Use an example .topojson file to test TopoJSON readers and GeoJSON converters, verifying that arcs are dereferenced in the right direction, that negative arc indices are handled, and that the quantisation transform is reversed exactly.

How to use this file for testing

“TopoJSON — Zero-Length Arc” is a deterministic Novus Examples fixture for Geospatial, Error handling, Conversion testing. GeoJSON, GPX, and KML files with points, lines, polygons, and tracks — for testing map tools, route parsers, and geo importers.

Documented properties for this file: UTF-8 · LF · TopoJSON 1.0. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.

Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such — expect parsers to fail loudly rather than silently accept them.

Geospatial fixtures publish one invented territory across formats, with the coordinate reference system and feature counts documented in specs. Convert or reproject and diff against the twin in the same group; edge-case geometries state exactly which assumption they are built to break.

Generated by generation/geospatial.py. Free for any use, no attribution required — license.