Skip to content

spatialpack crs

Terminal window
spatialpack crs <command> [options]

CRS detection, validation, and normalization commands.

CommandDescription
crs detectDetect CRS from a spatial file.
crs listList supported coordinate reference systems.
crs normalizeNormalize a spatial file to target CRS (default: EPSG:4326).
crs normalize-rasterNormalize a raster file to target CRS (default: EPSG:4326).
crs validateValidate CRS and area-of-use for a spatial file.

Detect CRS from a spatial file.

Analyzes the input file and reports the detected coordinate reference system with confidence level.

Terminal window
spatialpack crs detect FILE_PATH [options]

FILE_PATH — path (required)

Options:

OptionTypeDefaultDescription
--jsonflagfalseOutput as JSON
Terminal window
spatialpack crs detect input.shp
spatialpack crs detect data.geojson --json

List supported coordinate reference systems.

Shows all CRS definitions supported by the normalizer, including Australian datums (GDA94, GDA2020) and MGA zones.

Terminal window
spatialpack crs list [options]

Options:

OptionTypeDefaultDescription
--australian-onlyflagfalseShow only Australian CRS
Terminal window
spatialpack crs list
spatialpack crs list --australian-only

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.

Terminal window
spatialpack crs normalize INPUT_PATH [options]

INPUT_PATH — path (required)

Options:

OptionTypeDefaultDescription
-o, --outputpath-Output file path (default: input_normalized.parquet)
--target-crstextEPSG:4326Target CRS (default: EPSG:4326 WGS84)
--source-crstext-Override source CRS (auto-detected if not specified)
--strictflagfalseFail on validation warnings
--formatparquet | gpkg | geojsonparquetOutput format (default: parquet)
--jsonflagfalseOutput metadata as JSON instead of writing file
--batchflagfalseBatch mode: normalize all matching files in directory
--patterntext*.shp,*.geojson,*.gpkgFile patterns for batch mode (comma-separated)
--include-rasterflagfalseInclude raster files (*.tif, *.tiff) in batch processing
--resamplingnearest | bilinear | cubic | cubicspline | lanczos | average | mode | max | min | med | q1 | q3bilinearResampling method for raster files (default: bilinear)
Terminal window
# Single file mode
spatialpack crs normalize input.shp
spatialpack crs normalize input.shp -o output.parquet
spatialpack crs normalize input.gpkg --target-crs EPSG:7844
spatialpack crs normalize input.shp --source-crs EPSG:28354
# Batch mode (normalize all files in directory)
spatialpack crs normalize ./data/ --batch
spatialpack crs normalize ./data/ --pattern "*.shp,*.geojson"
spatialpack crs normalize ./data/ --include-raster
spatialpack crs normalize ./data/ -o ./output/ --batch --json

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.

Terminal window
spatialpack crs normalize-raster INPUT_PATH [options]

INPUT_PATH — path (required)

Options:

OptionTypeDefaultDescription
-o, --outputpath-Output GeoTIFF path (required)
--target-crstextEPSG:4326Target CRS (default: EPSG:4326 WGS84)
--source-crstext-Override source CRS (auto-detected if not specified)
--resamplingnearest | bilinear | cubic | cubicspline | lanczos | average | mode | max | min | med | q1 | q3bilinearResampling method (default: bilinear)
--nodatafloat-NoData value for output
--strictflagfalseFail on validation warnings
--jsonflagfalseOutput metadata as JSON instead of writing file
Terminal window
spatialpack crs normalize-raster input.tif -o output.tif
spatialpack crs normalize-raster dem_mga50.tif -o dem_wgs84.tif
spatialpack crs normalize-raster input.tif -o output.tif --resampling cubic
spatialpack crs normalize-raster input.tif -o output.tif --source-crs EPSG:28350

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.

Terminal window
spatialpack crs validate FILE_PATH [options]

FILE_PATH — path (required)

Options:

OptionTypeDefaultDescription
--epsginteger-EPSG code to validate against (auto-detected if not specified)
--strictflagfalseTreat warnings as errors
--jsonflagfalseOutput as JSON
Terminal window
spatialpack crs validate input.shp
spatialpack crs validate data.gpkg --epsg 28354
spatialpack crs validate input.shp --strict