# reproject-stream

> reproject a stream of LDJSON into a different projection

Latest version **2.0.0** (published 2014-12-18) · ISC license · 0 weekly downloads

## Install

```sh
npm install reproject-stream
pnpm add reproject-stream
yarn add reproject-stream
bun add reproject-stream
```

Provides the command `reproject-stream`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2014-12-18 |
| First published | 2014-12-02 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Ryan Ramage |
| Maintainers | eckoit |

## Links

- npm: https://www.npmjs.com/package/reproject-stream
- Repository: git@github.com:ryanramage/reproject-stream
- Homepage: https://github.com/ryanramage/reproject-stream
- Issues: https://github.com/ryanramage/reproject-stream/issues
- npm.io page: https://npm.io/package/reproject-stream

## Dependencies (7)

- [proj4](https://npm.io/package/proj4.md) ^2.3.3
- [ndjson](https://npm.io/package/ndjson.md) ^1.3.0
- [pumpify](https://npm.io/package/pumpify.md) ^1.3.3
- [minimist](https://npm.io/package/minimist.md) ^1.1.0
- [through2](https://npm.io/package/through2.md) ^0.6.3
- [reproject](https://npm.io/package/reproject.md) ^0.1.1
- [set-from-path](https://npm.io/package/set-from-path.md) ^2.0.2

## Recent versions

- 2.0.0 (latest) — 2014-12-18
- 1.0.2 — 2014-12-02
- 1.0.1 — 2014-12-02
- 1.0.0 — 2014-12-02

## README

reproject-stream
================

geographic coordinate reproject of LDSON streams


CLI Usage
---------

    npm install reproject-stream -g

Lets assume there is a json file, `something.json` with geo data, in EPSG:3857 projection.


    [
     {"x":-12696407.9691,"y":6644490.815599999", "OBJECTID":16960,"Name":"West Nose Creek Confluence Park","Type":35,"Address_1":"North side of Beddington Tr.","Address_2":"","Geographic_Location":"","Postal_Code":"","Website":"","Status":1,"Reasons":"","Programs_and_Services":"Various pathways","Comment":"","created_user":"cgync","created_date":null,"last_edited_user":"cgync","last_edited_date":1390861153000}
    ]

We can reproject to the default 'WGS84' projection

    cat something.json | reproject-stream "x" "y" "EPSG:3857"

where args are

  - the path on the object to the x coord
  - the patj on the object to the y coord
  - the projection the current lat,lon are in


To reproject to another projection

    cat something.json | reproject-stream "x" "y" "EPSG:3857" "EPSG:4269"

To use a proj or wkt string

    cat something.json | reproject-stream "x" "y" "EPSG:3857" "+proj=gnom +lat_0=90 +lon_0=0 +x_0=6300000 +y_0=6300000 +ellps=WGS84 +datum=WGS84 +units=m +no_defs"


GEOJson objects
----------------

It can also reproject full GEOJson objects without having to specify they x and y. So Polygons and other shapes can be reprojected. Here is a long example of something like that.

    cat assessment.csv | ldjson-csv  | jsonmap "this.geometry = JSON.parse(this.GEOMETRY); delete this.GEOMETRY; this.type = 'Feature'"| reproject-stream "+proj=tmerc +lat_0=0 +lon_0=-114 +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs" --geojson



Module Usage
------------

    npm install reproject-stream --save

then

    var opts = {};
    opts.x_selector = 'x';
    opts.y_selector = 'y';
    opts.from_proj = 'EPSG:3857'
    fs.createReadStream('something.json')
      .pipe(reproject(x_selector, y_selector, from_proj))
      .pipe(process.stdout)

---
_Source: https://npm.io/package/reproject-stream · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
