Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CS Extract

Extract coordinate system metadata from CSLibrary XML files into CSV and JSON — parses projected and geographic coordinate systems, EPSG codes, datums, and units.

Features

  • Parses both ProjectedCoordinateSystem and GeographicCoordinateSystem elements
  • Extracts: category, human-readable name, description, authority, EPSG code, units, datum ID, and additional parameter information
  • Outputs to both CSV and JSON formats
  • Handles the OGC/MapGuide coordinate system XML namespace

Requirements

  • Python 3.6+
  • No third-party dependencies (uses only the Python standard library)

Usage

# Extract to both CSV and JSON (default) — outputs saved in the input folder
python cs_extract.py /path/to/CSLibrary

# Output to a different directory
python cs_extract.py /path/to/CSLibrary --output-dir /path/to/output

# CSV only
python cs_extract.py /path/to/CSLibrary --csv

# JSON only
python cs_extract.py /path/to/CSLibrary --json

Options

folder                Path to folder containing CSLibrary XML files
--output-dir DIR      Directory for output files (default: same as input folder)
--csv                 Write CSV output only
--json                Write JSON output only

If neither --csv nor --json is specified, both formats are written.

Output Fields

Field Description
CS_Category ProjectedCoordinateSystem or GeographicCoordinateSystem
Human_Readable_Name Display name of the coordinate system
Description Detailed description text
Authority Authority reference string
EPSG_Code EPSG identifier (if present in authority text)
Units Unit of measure from the Axis element
DatumId Associated datum identifier
AdditionalInformation Key-value parameter pairs (JSON-serialized in CSV)

Project Structure

CS_Extract/
├── cs_extract.py    # Main script
├── .gitignore
├── .gitattributes
├── LICENSE          # GPL-3.0
└── README.md

License

GPL-3.0 — see LICENSE.

About

Extract coordinate system metadata from CSLibrary XML files into CSV and JSON — parses projected and geographic coordinate systems, EPSG codes, datums, and units.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages