Lay of the Land
All methods

Export and import round trip

A design exported as GeoJSON or KML and brought back with "Import a design" comes back as it went, within the tolerances below. apps/web/src/lib/export/round-trip.test.ts checks this on every run, and fails if either tolerance is passed.

What's checked

The test design is a regular system of a main, 3 submains and 24 laterals: 27 pipes and 28 nodes, near Fargo in UTM zone 14 on NAD83(2011). Every pipe is sized from one product line and all but one are named, so one goes by the label the export writes for an unnamed pipe, its kind and the start of its id. One lateral is bent, and one is graded by hand with a grade point between its ends. Inverts fall 0.1% towards the outlet.

For each pipe, matched by that label, which the import reads back as the name, it checks:

  • Where it runs: every point of each line lies within the tolerance of the other line, both ways.
  • Its inverts: at every grade point the import made, the invert matches the original pipe's at that distance along it.
  • Which way it flows, its kind, its size, its product, and that it came back graded by the file.
  • How it connects: the same number of nodes, so pipes that met still meet.

It also checks that nothing came back twice, or came back without having gone.

A third case moves one line by about 0.1 m and raises its inverts by 10 mm, and brings another back twice, and checks that the comparison catches all three.

Tolerances and results

Tolerance GeoJSON KML
Largest change in position 10 mm 0.58 mm 0.58 mm
Largest change in invert 1 mm 0.05 mm 0.05 mm
Pipes missing, extra, reversed or changed none none none
Nodes 28 28 28

Measured on 2026-11-08. Coordinates are written to eight decimal places of a degree, which is about a millimeter, and inverts to a tenth of a millimeter, so these are rounding.

What doesn't round trip yet

  • Nodes come back as plain junctions and pipe ends. The export writes each node's kind as a point, but the import only reads lines, so an imported design needs its outlet, lift stations and other structures placed again.
  • Imported pipes are graded by the file. Their inverts become grade points, so they no longer get the worked-out grade until those are cleared, which is what importing a design is for.
  • Shapefile, GeoPackage and DXF are written in the project's coordinate system, and the import reads longitude and latitude, so they're checked against PROJ in the worker's tests rather than read back here. CSV schedules aren't meant to be read back.