Project files and point clouds (.ohl)#

A project file is one SQLite database (ADR-0004) holding the line model, its operation log, its users, and its point clouds (ADR-0007). Line files (.ohl.json) stay the open exchange format: import them into a project, export the project back.

The example project#

The examples on this page and on Versions run on a project made from the example line that ships with OpenOHL (an invented line), in the repository's folder:

ohl project import examples/synthetic-line/synthetic-line.ohl.json --into example.ohl --user tester
ohl surface import examples/synthetic-line/synthetic-survey.csv --into example.ohl --user tester
imported "Synthetic example line (invented coordinates)": 7 structures, 3 sections, 1 jumpers into example.ohl
entry 1: 30 object(s) changed; sections to recalculate: S1, S2, S3
  synthetic-survey: 2960 points, 5694 triangles

The first user of a project (tester) is its admin. Then:

ohl project user example.ohl --by tester ben designer      # a second user
ohl project apply example.ohl --user ben '{"op": "move_structure", "id": "T4", "position": [945.0, 52.1, 510.0]}'
ohl project log example.ohl                                # the log, numbered
ohl project export example.ohl --out example.ohl.json      # back to a line file
ohl line example.ohl --temperature 80     # every command taking a line file takes a project too

ohl line and ohl zones read the project's libraries. Given a project file, they take the libraries the project keeps with its current line, as the desktop application does: the wire library, structure types (with their poles and structure models), insulator assemblies and section library — written to a temporary folder for the run and removed at its end. A library given on the command line (--library, --structures, --insulators, --sections) wins; a kind the project holds none of is looked up as for a line file (the shipped wire and insulator libraries, the Structures and Sections folders next to the file). --weather, --load-cases and --rules also take the name of one of the project's own files (--weather cases.ohlwc), and ohl zones falls back on the project's first weather case file. The summary says where each library came from (cables: the project's (2 files)).

Commands that only read or compute open the project read-only (2026-11-15): ohl line, ohl zones, the checks, drawings and every other command taking a project as its line, ohl project export, log, tiles, query, history, status and diff, ohl surface list and export leave the file as it is — its bytes and its modification time unchanged, no project.ohl-wal or project.ohl-shm made next to it. A project file of an older build is upgraded in memory for the run only (the desktop application, or a command that writes, upgrades the file itself). A project file that does not exist is not created. The commands that change the project (import, apply, undo, redo, user, commit, …) open it for writing as before.

Commands#

Every change is a command (JSON with an op), checked before it is applied: the whole line must stay valid (references, geometry rules), or the command is refused and nothing changes. A batch applies all its commands or none.

op Fields Effect
put kind, id, value Create or replace an object: meta (id line: {name, crs, height_datum, display} — the coordinate system and the heights' vertical datum, {"name": "LN02", "epsg": 5728}, are set this way; other line settings have rows of their own), route, alignment, alignment_point, structure (with its attachments), section (with stringing and loads), jumper, spacer, library (a library file of the project line, id kind/name, with its text) — the line's objects with value as in the line file.
delete kind, id, confirm Delete an object; when it takes others with it, confirm is needed — see below.
move_structure id, position Move a structure; its attachments move with it.
set_stringing section, stringing Change a section's stringing.
delete_structure id, confirm Same as delete with kind structure.
delete_attachment structure, set, confirm Delete a wire point set of a structure and what hangs only from it; the sections and jumpers there go with it after confirmation.
replace_structure id, structure (wires, sets, confirm) Replace a structure by another; it keeps its id, position, orientation and routes.
rename kind, id, new_id Rename a structure, section or jumper; what refers to it follows.
rename_attachment structure, set, new_set Renumber a structure's wire point set; sections and jumpers follow.
rename_point kind, id, label, new_label Relabel a point of a section or jumper.
rename_system id, new_id Rename an electrical system; its sections follow.
replace_line line Replace the whole line, as one log entry.
align_under_structures route Replace a route's alignment by points tied under each of its structures.
move_alignment_point route, index, position Move an alignment point (route: the alignment's id; "line", as in older projects, means main); a point shared by other alignments moves on all of them; a tied point is detached.
insert_alignment_point / remove_alignment_point route, index (position, or point) Add a point before index (a free one, or an existing point shared with its other alignments), or remove one.
tie_alignment_point / detach_alignment_point route, index (structure) Tie a point under a structure (it then follows it), or detach it (it stays in place).
change_points cloud, points (from, to) Change points of the project's point cloud cloud: each from, exactly as stored (xyz: integers of the cloud's scale, class, intensity, returns), becomes to (other coordinates, another class); refused when a point is not there — see Changing points.
batch commands Several commands together.

Deleting objects#

One rule for every deletion: an object that takes others with it is not deleted until confirmed. Without confirm nothing changes and the answer lists everything that would go or change:

$ ohl project delete project.ohl --user ana structure T7
Deleting structure T7 would also affect:
  attachments and strings:
    - 1:1 dead-end
  sections:
    - S3
  jumpers:
    - J-T3-branch
  taken out of routes:
    - branch
  alignment points detached (they stay in place):
    - branch #2
Nothing was changed. Repeat with --confirm to apply all of this (it is logged and can be undone).
  • structure: its attachments and strings, the sections through it (a section cannot lose a point), jumpers at its attachments or at points of those sections; routes lose it (or are deleted when fewer than two structures are left); tied alignment points are detached.
  • section: the jumpers at its points.
  • jumper, route: nothing else — deleted directly (still logged).

With --confirm ("confirm": true) everything listed is applied as one log entry with a note of what went. Undo (or an admin rollback) restores all of it, in its original order.

Alignments#

The alignment of a route is the base of its plan and profile drawings, kept apart from the line design. Usually its points sit under the structures, tied to them: they follow when a structure moves. Any point can be moved (which detaches it), detached, re-tied, inserted or removed:

ohl project apply project.ohl --user ana '{"op": "align_under_structures", "route": "main"}'
ohl project apply project.ohl --user ana '{"op": "move_alignment_point", "route": "main", "index": 3, "position": [2600410.0, 1200125.0, 0.0]}'
ohl project apply project.ohl --user ana '{"op": "tie_alignment_point", "route": "main", "index": 3, "structure": "T4"}'

Each applied command is logged with the user, the time, its inverse, the objects it changed and the sections to recalculate (changed sections, sections through changed structures, sections at changed jumpers' ends) — the basis for incremental recalculation.

Join routes from another project on the command line#

Built 2026-11-25, in active development, not approved yet. The command of OHL-Design's File › Join routes from another project…: the main project line of another project file joined into a project — one model for a line and its branches.

ohl project join branch.ohl --into line.ohl --user ana --dry-run
ohl project join branch.ohl --into line.ohl --user ana --merge T3=T3

It prints the plan (routes, objects, ids renamed PREFIX-id, each twin with its height, level and orientation difference, each library entry's mapping, what to look at, what is refused), with the option that would tick each twin (--merge OPEN=OTHER; none by default) and accept each library conflict (--accept KIND/FILE/ENTRY; a conflict not accepted refuses the join). Then — unless --dry-run — it writes the library files and the merged line as one logged command (ohl project undo takes it back) and the revision joined routes from FILE. --prefix sets the prefix of renamed ids (default: from the other file's name), --tolerance the twin distance (0.5 m). The other file is read, never changed.

Incremental solving#

The application keeps the line solved while it is edited: every command, undo or rollback re-solves only the sections it touched (changed sections and sections through changed structures); jumpers are refreshed each time. The result is identical to a full solve (checked by tests after every kind of edit). From the command line:

ohl project apply project.ohl --user ana --solve --temperature 40 \
  '{"op": "move_structure", "id": "T40", "position": [2598496.0, 1120627.6, 649.5]}'

On a real 554-section line, moving a structure carrying 28 sections re-solved those 28 in 4.6 ms (command, log and solve), against 11.7 ms for all 554.

Undo, redo, rollback, users#

  • Undo is per user: undo reverses the user's own last command. It is refused if another user has since changed one of the same objects (judged by content: if they changed it back, undo is allowed) — nobody's work is overwritten silently. redo reverses the user's last undo.
  • Admin rollback: rollback SEQ reverses any log entry (same conflict rule); rollback SEQ --after brings the whole model back to its state just after entry SEQ, as one logged entry.
  • Roles: viewer (read only), designer (edit, own undo), admin (everything, rollback, users). The first user of a project is its admin. Admins can limit a user's or a role's edits to some kinds, objects or a plan area: see Versions, branches and reviews.
  • Revisions, branches, merges and reviews of the project: see Versions, branches and reviews.
ohl project undo example.ohl --user ben              # ben's last command reversed
ohl project redo example.ohl --user ben              # and done again
ohl project rollback example.ohl 4 --user tester     # admin: entry 4 reversed
ohl project rollback example.ohl 1 --after --user tester   # back to just after entry 1

A rollback that would change nothing says nothing to roll back.

Point clouds#

Every point of every tile is imported, except points flagged withheld (deleted by whoever made the survey). A tile more than 2 km from every structure of the line is imported too — it may hold a substation at the line's end or another structure worth having — but the import warns about it, in case it belongs to another project.

On the example project (above), with the invented LiDAR tile of the example line:

ohl pointcloud import examples/synthetic-line/synthetic-lidar.las --into example.ohl
ohl pointcloud info example.ohl
ohl line example.ohl --pointcloud example.ohl --temperature 80 \
  --rules examples/synthetic-line/clearance-rules.ohlr        # its ground from the cloud
imported 38984 points from 1 tiles into "lidar" in example.ohl; cloud now 38984 points
"lidar": 38984 points, 64 m chunks, scale 0.001 m — classes: ASPRS LAS 1.4 standard classes
    2        29884  Ground                                           ground
    5         2160  High vegetation                                  vegetation
   14         5760  Wire - conductor (phase)                         conductor

In general:

ohl pointcloud import TILES_DIR --into project.ohl --name lidar-2025 \
  --classes classes.ohlc --crs EPSG:2056
ohl pointcloud info project.ohl
ohl pointcloud export project.ohl --out survey.laz          # every point
ohl pointcloud export project.ohl --out wires.las --classes 14,15 \
  --area 2600000,1200000,2601000,1201000                     # classes, a rectangle
ohl pointcloud export project.ohl --out survey.copc.laz     # COPC
ohl pointcloud info survey.copc.laz                         # its octree
ohl pointcloud import survey.copc.laz --into other.ohl      # COPC in
ohl pointcloud octree old-project.ohl                       # levels of detail
ohl line project.ohl --pointcloud project.ohl --rules rules.ohlr
ohl line project.ohl --pointcloud survey.copc.laz --rules rules.ohlr

The desktop app does the same from File › Import › LiDAR points (LAS/LAZ)… (files or a folder, into the project's point cloud or a new one, in the background; then its points are read again, also in the background, and shown — the project stays open, the weather cases solved, the windows, the view and the selection kept, and the checks computed from the points marked out of date; before 2026-11-14 the whole project was opened again) and File › Export › LiDAR points (LAS/LAZ)… (every class or the classes shown, the whole survey or around the line).

Export writes LAS 1.4, point format 6 (classes 0–255: schemes with codes above 31 survive), LAZ when the file ends in .laz, with the survey's coordinate scale, intensities and return numbers as imported, and the class scheme next to it (.ohlc) — to share a survey or compare it with other data. Exported and imported again, a survey gives the same points, classes and intensities. On the real line, the 1.09 million points within 150 m of a structure are written in 0.3 s (6.9 MB of LAZ).

LAS/LAZ tiles are only the way in: points are stored in the project in blocks of one 64 m chunk (a quarter of a grid tile, below; --chunk M on import) × one class (coordinates in mm relative to the chunk, delta-encoded, byte-shuffled, zstd), with the class scheme. A check then reads only the blocks of the classes it needs inside its corridor, decompressed in parallel.

On a real 25 km line (99.6 million points, private data checked locally): import 59 s; project file 647 MB against 938 MB of LAZ tiles; a full clearance run (ground TIN from 11.3 million ground points, vegetation, buildings, other lines' wires, phase-to-phase) 25 s from the project against 2 min 44 s from the tiles, with identical results.

Changing points#

Single points of a stored cloud can be changed — their coordinates and their class — by the change_points command (the desktop app's Edit tool on a LiDAR point). A point is named exactly as stored: its integer coordinates (of the cloud's scale, e.g. millimetres), class, intensity and returns. The change takes it out of the block of its chunk and class and puts the new point into the block of its new chunk and class (made when missing; a block left empty is removed); the other points of a block keep their order, and its levels of detail, its compressed data, and the cloud's count and bounds are computed again from the blocks. The command is logged with the points' places in their blocks: undo, redo and an admin's rollback put every stored byte back as it was. It is refused when a point is not there (changed meanwhile), to viewers, and outside the area an admin limited a user to (where the points were and where they go). A command takes at most 10⁶ points; from 100 points on its list is written packed (see the data model). The desktop app's box and lasso selection changes the class of many points this way.

The point clouds belong to the project, not to a project line: a change is logged (and undone) on the line it was made on, every line sees it, and revisions of a line do not hold the points. On a server, every replica applies it in the server's order.

--pointcloud FILE#name chooses a cloud when the project has several. Other point sources (a point database, a web service) will be plugins implementing the same point-source interface.

Levels of detail#

Every block also stores the coordinates of its points of levels 1, 2 and 3 — about a 4th, a 16th and a 64th of them, picked by a hash of the point's place in the block, so they are spread evenly and the same every time; each level holds the coarser ones. They cost a third more coordinate data (intensities and returns are stored once). A view far away reads a level instead of the whole block — the 3D view streams by them under a point budget (see the desktop app's Level of detail), and opening a cloud of more than 20 million points takes the points shown from them (the terrain surface still from every ground point in the corridor).

Imports build the levels. Projects from before (point-cloud schema 1) are read as they are — the levels are then picked from the whole blocks while reading, the same points, only slower — and ohl pointcloud octree FILE builds them once (the schema becomes 2; older versions of OpenOHL then refuse the file's point clouds). ohl pointcloud info says whether they are there.

COPC#

A COPC file (Cloud Optimized Point Cloud, copc.io) is a LAS 1.4 LAZ file whose points are grouped by the nodes of an octree, each node a thinned sample of its cube that its children refine. OpenOHL:

  • reads it directly as a point source — --pointcloud survey.copc.laz for ohl line and the desktop app: a query reads only the nodes of its area (the corridor, a rectangle), down to a depth when it asks for less detail; the class scheme is the .ohlc file next to it (survey.copc.ohlc or survey.ohlc), else ASPRS;
  • imports it like any LAZ file (ohl pointcloud import);
  • writes it (ohl pointcloud export … --out FILE.copc.laz): point format 6, nodes split while they hold more than 100 000 points (each keeping one point per cell of a 128³ grid over its cube), one hierarchy page. The export holds the points in memory (32 bytes each: 10⁸ points need 3.2 GB). Files written are read by other COPC readers (checked with copc-rs), and files written by other tools (copc-rs, hierarchies in several pages) are read by OpenOHL.
  • ohl pointcloud info FILE.copc.laz lists the octree: nodes, points and spacing per level.

Points flagged withheld are left out, as for LAS/LAZ. Point formats 6–8 are read (what COPC allows); colours, GPS times and extra bytes are not kept.

Spatial index and tiles#

The plan of a project is divided into a fixed grid of square tiles (256 m at level 0; level 1 tiles are 512 m, level −1 128 m, and so on; ADR-0008). Every structure, section, jumper and route is indexed in the project file by its plan bounds and its home tile — the finest level whose tiles are as wide as the object — and the index follows every command. This is what partial loading, the viewer and the server stream by.

ohl project tiles project.ohl --level 2        # objects and points per 1 km tile
ohl project query project.ohl --area 2585600,1114880,2585856,1115136
ohl project query project.ohl --tile 0/10100/4355

tiles lists, for each tile of the level, how many objects touch it and how many points each stored point cloud has there. query lists the objects whose bounds touch an area or tile, with their home tile and bounds, read from the index (no model loading needed for the search). Bounds are those of the model (attachment points); wires swinging out under wind can reach a few metres further.

On the real 25 km line (633 objects, 99.6 million points): an area query takes 0.3 ms; listing the 53 level-2 tiles with object and point counts 80 ms.

Inside the file#

The project file is one SQLite database: the objects of every project line, the operation log, the users and their edit rights, the revisions, branches, tags and reviews, the spatial index, the terrain surfaces, the point clouds, the backgrounds (orthophotos, DXF drawings) and the project's settings, each in tables of their own. Every table, its columns and how they fit together, with read-only sqlite3 queries to look inside: Data model › Project file tables.

  • Saved as you go. Every command is written when it is applied; there is no Save. While a program has the project open, two files lie next to it (project.ohl-wal, project.ohl-shm) holding the latest changes: copy or send a project only when no program has it open.
  • Newer files are refused. A program refuses a project file of a newer session schema than it knows, before changing anything in it. Opening an older one upgrades it in place (session schema 6 since 2026-10-23); from then on older programs refuse it.
  • Change it only through the programs. A row changed by hand bypasses the checks, the log and undo.

View this page's source on GitHub