spatialpack crs
Synopsis
Section titled “Synopsis”spatialpack crs <command> [options]Description
Section titled “Description”CRS detection, validation, and normalization commands.
Commands
Section titled “Commands”| Command | Description |
|---|---|
crs detect | Detect CRS from a spatial file. |
crs list | List supported coordinate reference systems. |
crs normalize | Normalize a spatial file to target CRS (default: EPSG:4326). |
crs normalize-raster | Normalize a raster file to target CRS (default: EPSG:4326). |
crs validate | Validate CRS and area-of-use for a spatial file. |
Command Details
Section titled “Command Details”crs detect
Section titled “crs detect”Detect CRS from a spatial file.
Analyzes the input file and reports the detected coordinate reference system with confidence level.
spatialpack crs detect FILE_PATH [options]Arguments
Section titled “Arguments”FILE_PATH — path (required)
Options:
| Option | Type | Default | Description |
|---|---|---|---|
--json | flag | false | Output as JSON |
spatialpack crs detect input.shpspatialpack crs detect data.geojson --jsoncrs list
Section titled “crs list”List supported coordinate reference systems.
Shows all CRS definitions supported by the normalizer, including Australian datums (GDA94, GDA2020) and MGA zones.
spatialpack crs list [options]Options:
| Option | Type | Default | Description |
|---|---|---|---|
--australian-only | flag | false | Show only Australian CRS |
spatialpack crs listspatialpack crs list --australian-onlycrs normalize
Section titled “crs normalize”Normalize a spatial file to target CRS (default: EPSG:4326).
Transforms the input file to the target CRS with full provenance tracking. Outputs include transformation metadata.
spatialpack crs normalize INPUT_PATH [options]Arguments
Section titled “Arguments”INPUT_PATH — path (required)
Options:
| Option | Type | Default | Description |
|---|---|---|---|
-o, --output | path | - | Output file path (default: input_normalized.parquet) |
--target-crs | text | EPSG:4326 | Target CRS (default: EPSG:4326 WGS84) |
--source-crs | text | - | Override source CRS (auto-detected if not specified) |
--strict | flag | false | Fail on validation warnings |
--format | parquet | gpkg | geojson | parquet | Output format (default: parquet) |
--json | flag | false | Output metadata as JSON instead of writing file |
--batch | flag | false | Batch mode: normalize all matching files in directory |
--pattern | text | *.shp,*.geojson,*.gpkg | File patterns for batch mode (comma-separated) |
--include-raster | flag | false | Include raster files (*.tif, *.tiff) in batch processing |
--resampling | nearest | bilinear | cubic | cubicspline | lanczos | average | mode | max | min | med | q1 | q3 | bilinear | Resampling method for raster files (default: bilinear) |
# Single file modespatialpack crs normalize input.shpspatialpack crs normalize input.shp -o output.parquetspatialpack crs normalize input.gpkg --target-crs EPSG:7844spatialpack crs normalize input.shp --source-crs EPSG:28354
# Batch mode (normalize all files in directory)spatialpack crs normalize ./data/ --batchspatialpack crs normalize ./data/ --pattern "*.shp,*.geojson"spatialpack crs normalize ./data/ --include-rasterspatialpack crs normalize ./data/ -o ./output/ --batch --jsoncrs normalize-raster
Section titled “crs normalize-raster”Normalize a raster file to target CRS (default: EPSG:4326).
Transforms the input GeoTIFF to the target CRS with full provenance tracking using GDAL’s gdalwarp.
spatialpack crs normalize-raster INPUT_PATH [options]Arguments
Section titled “Arguments”INPUT_PATH — path (required)
Options:
| Option | Type | Default | Description |
|---|---|---|---|
-o, --output | path | - | Output GeoTIFF path (required) |
--target-crs | text | EPSG:4326 | Target CRS (default: EPSG:4326 WGS84) |
--source-crs | text | - | Override source CRS (auto-detected if not specified) |
--resampling | nearest | bilinear | cubic | cubicspline | lanczos | average | mode | max | min | med | q1 | q3 | bilinear | Resampling method (default: bilinear) |
--nodata | float | - | NoData value for output |
--strict | flag | false | Fail on validation warnings |
--json | flag | false | Output metadata as JSON instead of writing file |
spatialpack crs normalize-raster input.tif -o output.tifspatialpack crs normalize-raster dem_mga50.tif -o dem_wgs84.tifspatialpack crs normalize-raster input.tif -o output.tif --resampling cubicspatialpack crs normalize-raster input.tif -o output.tif --source-crs EPSG:28350crs validate
Section titled “crs validate”Validate CRS and area-of-use for a spatial file.
Checks that data coordinates fall within the CRS area of use and suggests alternative CRS if appropriate.
spatialpack crs validate FILE_PATH [options]Arguments
Section titled “Arguments”FILE_PATH — path (required)
Options:
| Option | Type | Default | Description |
|---|---|---|---|
--epsg | integer | - | EPSG code to validate against (auto-detected if not specified) |
--strict | flag | false | Treat warnings as errors |
--json | flag | false | Output as JSON |
spatialpack crs validate input.shpspatialpack crs validate data.gpkg --epsg 28354spatialpack crs validate input.shp --strict