heli2caris (and helo2caris.cpp)
Overview
heli2caris (code/hips_goodies/heli2caris.c) and its companion C++ source file helo2caris.cpp (code/hips_goodies/helo2caris.cpp) are interactive command-line utilities developed by Jason Bartlett (CHS Burlington, March 2005) for converting raw helicopter-logged GPS data strings into CARIS (Computer Aided Resource Information System) feature-coded line input files.
In Canadian Hydrographic Service (CHS) shoreline and intertidal surveys, a helicopter flies along coastal features while logging GPS positions. heli2caris reads the resulting ASCII GPS logβsupporting NovAtel OEM4, NovAtel PRTKA, and standard NMEA $GPGGA sentence formatsβand generates a CARIS batch command stream that opens a feature file (opvfof), assigns the vessel/survey ID (opid), projection/unit header (opun94...), elevation (lico), and CHS feature code (clsl, cllwrlltsm, cllw, or user-specified), emits /ge=<Lat>,<Long> geographic vertex directives, and closes the line feature (q, opvfon, oppmcr).
Differences Between heli2caris.c and helo2caris.cpp
Both files implement the exact same CARIS formatting state machine and GPS string tokenizers, differing only in how input/output filenames and file streams are handled:
| Aspect | heli2caris.c (Compiled by makefile) | helo2caris.cpp (Legacy C++ Variant) |
|---|---|---|
| Language & I/O | Standard C (stdio.h, FILE *fin, FILE *fout, fgets) | Legacy C++ (fstream.h, iostream.h, fstream infile, infile.getline) |
| File Arguments | Passed on the command line: heli2caris <infile> <outfile> (argv[1], argv[2]) | Prompted interactively via scanf("%s", input) and scanf("%s", outputfile) |
| Build Status | Built automatically by code/hips_goodies/makefile ($(wildcard *.c)) | Kept in code/hips_goodies/ as original C++ reference source |
Usage & Interactive Prompts
Command-Line Invocation (heli2caris)
heli2caris <input_gps_file> <output_caris_file>
Interactive Session Flow
Once launched, heli2caris prompts the operator on stdin for survey metadata and GPS sentence format:
- Julian Day (
1β366):- Prompt:
Enter the Julian day! - Validated in a
while (day > 366 || day < 1)loop.
- Prompt:
- Survey Year (4-digit year):
- Prompt:
Enter the year! - Subtracted by
2000(year = year - 2000) and zero-padded ifyear < 10when writingopidandopun94headers.
- Prompt:
- Vessel / Platform ID (exact 4-character code):
- Prompt:
Enter the vessel ID(4 characters)! - Validated via
while (strlen(userID) != 4).
- Prompt:
- CARIS Feature Code Selection (
1β4):1:clsl(Coastline / Shoreline)2:cllwrlltsm(Coastline Low Water Rock Ledge / Foreshore)3:cllw(Coastline Low Water Line)4:OTHERβ prompts the user to enter a custom feature code string (char code[15]).
- Feature Elevation (
float Elev):- Prompt:
Enter the Elevation! - Written with
%0.1fprecision immediately following thelicodirective.
- Prompt:
- GPS Format String Type (
1β3):1: OEM4 (NovAtel OEM4 comma/semicolon-delimited log; skips header line, extracts token 11 as decimal degreesLatand token 12 asLong, negatingLong = Long * -1for Western Hemisphere convention).2: PRTKA (Comma-delimited kinematic log; skips header line, extracts token 1 asLatand token 2 asLong, negatingLong = Long * -1).3: GGA (NMEA$GPGGAcomma-delimited sentence; skips first line, extracts token 1 asDDMM.MMMMlatitude and token 3 asDDDMM.MMMMlongitude, converts degrees-minutesLat / 100andLong / 100into decimal degrees via(temp2 * 100) / 60).
Output Format Structure
opvfof
opidHELI05063
opun9405063
oppmba
lico
0.0
clsl
/ge=44.62518420,-63.57192840
/ge=44.62521050,-63.57195110
q
q
opvfon
oppmcr
Architectural Fit
Within the OMG software ecosystem, heli2caris is part of the hips_goodies/ auxiliary toolkit used when exchanging field data between UNB OMG tools and CARIS HIPS/SIPS or GIS packages.