Exporting Data
Export Formats
Section titled “Export Formats”Sonar Catalog supports exporting data through the plugin hook system. Built-in formats:
| Format | Description | Use Case |
|---|---|---|
csv | Comma-separated values | Spreadsheets, data analysis |
geojson | GeoJSON FeatureCollection | GIS tools (QGIS, ArcGIS) |
json | JSON array | Scripting, custom processing |
List Available Formats
Section titled “List Available Formats”sonar-catalog export --list-formatsPlugins can add additional export formats (e.g., Shapefile, KML).
Export Commands
Section titled “Export Commands”Export all files to CSV
Section titled “Export all files to CSV”sonar-catalog export --format csv --output catalog.csvExport with geographic data
Section titled “Export with geographic data”sonar-catalog export --format geojson --geo --output survey_tracks.geojsonThe --geo flag exports geographic point data (files with nav tracks) instead of the full file listing.
Export to stdout
Section titled “Export to stdout”sonar-catalog export --format jsonOmit --output to write to stdout, useful for piping:
sonar-catalog export --format json | jq '.[] | select(.sonar_format == "xtf")'Limit and filter
Section titled “Limit and filter”sonar-catalog export --format csv --limit 1000GeoJSON Output
Section titled “GeoJSON Output”The GeoJSON export produces a FeatureCollection compatible with any GIS tool:
{ "type": "FeatureCollection", "features": [ { "type": "Feature", "geometry": { "type": "Point", "coordinates": [3.456, 56.123] }, "properties": { "content_hash": "abc123...", "file_name": "line_001.xtf", "file_size": 524288000, "sonar_format": "xtf", "nfs_server": "sonar-nas-01" } } ]}Adding Custom Export Formats
Section titled “Adding Custom Export Formats”Plugins can register new export formats via the export_data and get_export_formats hooks. See Writing a Plugin.