Skip to content
scotteifelPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XYZ to GeoJSON Converter - Proof of Concept

A Node.js function that converts survey coordinate data (XYZ format) to standard GeoJSON FeatureCollection with coordinate system transformation using proj4js.

Quick Start

npm install
node main.js

What This Demonstrates

  • Parsing: Handles space/comma/tab-separated XYZ data
  • Transformation: Uses proj4js for coordinate system conversion
  • Output: Standard GeoJSON FeatureCollection format
  • Robustness: Error handling, validation, preserves source data

Example

Input (XYZ - UTM Zone 15N):

440287.50 4431748.25 125.3
440291.20 4431752.80 126.1
440295.10 4431757.50 124.8

Output (GeoJSON - WGS84):

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "geometry": {
        "type": "Point",
        "coordinates": [-93.699, 40.033, 125.3]
      },
      "properties": {
        "originalX": 440287.5,
        "originalY": 4431748.25,
        "originalZ": 125.3
      }
    }
  ]
}

Technical Approach

Core Function

xyzToGeoJSON(xyzData, fromProjection, toProjection, options)

Architecture

  1. Parse: Multi-format support (space, comma, tab delimiters)
  2. Validate: Skip invalid lines with warnings
  3. Transform: Batch process using proj4js
  4. Output: Standard GeoJSON with source data preservation

Performance Features

  • Batch processing for large datasets (configurable chunk size)
  • Memory-efficient streaming approach
  • Error handling per point (doesn't fail entire dataset)

Next Steps for Production

  • Vertical datum transformation (NAVD88 → WGS84 using geoid models)
  • Support for additional CRS formats (PROJ.4 strings, WKT)
  • Performance optimization for million+ point datasets
  • Comprehensive test suite
  • CLI interface for batch file processing

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages