Skip to content
ixhlbxi edited this page Apr 13, 2026 · 2 revisions

CS Extract

Extract coordinate system metadata from CSLibrary XML files into CSV and JSON.

CS Extract parses OGC/MapGuide coordinate system XML files, pulling projected and geographic coordinate system definitions into structured, machine-readable formats. It requires only the Python standard library (3.6+) and produces two output files by default: a flat CSV and a nested JSON document.


Table of Contents

Page Description
Usage CLI options, parameter reference, and usage examples
Output Reference CSV column and JSON key schemas with detailed field descriptions

Quick Start

  1. Ensure Python 3.6 or later is installed.
  2. Clone the repository:
    git clone https://github.com/ixhlbxi/CS_Extract.git
    cd CS_Extract
  3. Run the extractor against a folder of CSLibrary XML files:
    python cs_extract.py /path/to/CSLibrary
  4. Two files are created in the input folder:
    • coordinate_systems_extended.csv
    • coordinate_systems_extended.json

What Gets Extracted

CS Extract processes every .xml file in the target folder and collects:

  • ProjectedCoordinateSystem elements (State Plane, UTM, etc.)
  • GeographicCoordinateSystem elements (lat/lon-based systems)

For each coordinate system it records the name, description, authority string, EPSG code, units, datum, and any additional parameter key-value pairs.

See the Output Reference for the full field-by-field breakdown.


Requirements

Requirement Detail
Python 3.6+
Dependencies None (standard library only: csv, json, argparse, xml.etree.ElementTree)
Input format OGC/MapGuide CSLibrary XML (namespace http://www.osgeo.org/mapguide/coordinatesystem)

License

GPL-3.0 -- see LICENSE.

Clone this wiki locally