https://github.com/terraformer-js/terraformer
A geographic toolkit for dealing with geometry, geography, formats, and building geodatabases
https://github.com/terraformer-js/terraformer
arcgis data-management geojson javascript
Last synced: 2 months ago
JSON representation
A geographic toolkit for dealing with geometry, geography, formats, and building geodatabases
- Host: GitHub
- URL: https://github.com/terraformer-js/terraformer
- Owner: terraformer-js
- License: mit
- Created: 2018-12-27T21:53:17.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2025-03-07T20:47:07.000Z (3 months ago)
- Last Synced: 2025-03-24T05:42:20.634Z (3 months ago)
- Topics: arcgis, data-management, geojson, javascript
- Language: JavaScript
- Homepage:
- Size: 1.83 MB
- Stars: 203
- Watchers: 8
- Forks: 29
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# @terraformer
[![npm][npm-image]][npm-url]
[![travis][travis-image]][travis-url]
[![standard][standard-image]][standard-url][npm-image]: https://img.shields.io/npm/v/@terraformer/arcgis.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/@terraformer/arcgis
[travis-image]: https://app.travis-ci.com/terraformer-js/terraformer.svg?branch=main
[travis-url]: https://app.travis-ci.com/terraformer-js/terraformer
[standard-image]: https://img.shields.io/badge/code%20style-semistandard-brightgreen.svg?style=flat-square
[standard-url]: http://npm.im/semistandard> A geographic toolkit for dealing with geometry, geography, formats, and building geodatabases.
## Packages
* [`@terraformer/spatial`](./packages/spatial/README.md) - Spatial predicates for [GeoJSON](https://tools.ietf.org/html/rfc7946).
* [`@terraformer/arcgis`](./packages/arcgis/README.md) - Convert ArcGIS JSON geometries to GeoJSON geometries and vice versa.
* [`@terraformer/wkt`](./packages/wkt/README.md) - Convert WKT geometries to GeoJSON geometries and vice versa.## FAQ
What's the difference between this and Esri/Terraformer?
Very little!
This project is a standalone [ES Module](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) port of the original Terraformer project _without_ the [Primitives](https://terraformer-js.github.io/core/#terraformerprimitive).
If you found instantiating Primitives tedious or you'd like to [cut down on your bundle size](https://github.com/zakjan/leaflet-lasso/issues/10) by importing only the code from Terraformer that you're actually using, you should consider upgrading.
I'm already using
terraformer
. How do I upgrade?Previously it was necessary to instantiate a Terraformer Primitive in order to execute spatial operations
```bash
npm install terraformer
``````js
const Terraformer = require('terraformer')const polygon = new Terraformer.Primitive({
type: "LineString",
coordinates: [
[ 100, 0 ], [ -45, 122 ], [ 80, -60 ]
]
})polygon.convexHull()
```Now you'll work directly with raw [GeoJSON](https://tools.ietf.org/html/rfc7946)
```
npm install @terraformer/spatial
```
```js
import { convexHull } from '@terraformer/spatial'convexHull({
type: "LineString",
coordinates: [
[ 100, 0 ], [ -45, 122 ], [ 80, -60 ]
]
})
```I'm already using
terraformer-wkt-parser
. How do I upgrade?Instead of this:
```bash
npm install terraformer-wkt-parser
``````js
var wkt = require('terraformer-wkt-parser')// parse a WKT file and turn it into GeoJSON
wkt.parse('LINESTRING (30 10, 10 30, 40 40)')
wkt.convert(/* ... */)
```You'll do this:
```
npm install @terraformer/wkt
```
```js
import { wktToGeoJSON, geojsonToWkt } from '@terraformer/wkt'wktToGeoJSON(/* ... */)
geojsonToWKT(/* ... */)
```I'm already using
terraformer-arcgis-parser
. How do I upgrade?Instead of this:
```bash
npm install terraformer-arcgis-parser
``````js
var ArcGIS = require('terraformer-arcgis-parser')// parse ArcGIS JSON and turn it into GeoJSON
ArcGIS.parse()
ArcGIS.convert()
```You'll do this:
```
npm install @terraformer/arcgis
```
```js
const { arcgisToGeoJSON, geojsonToArcGIS } from '@terraformer/arcgis'arcgisToGeoJSON(/* ... */)
geojsonToArcGIS(/* ... */)
```What about
terraformer-geostore
?This repo does **not** include a port of https://github.com/Esri/terraformer-geostore and there is no plan to tackle it in the future.
Since
terraformer-geostore
ingests plain ol' [GeoJSON](https://tools.ietf.org/html/rfc7946), you're welcome to keep on using the original code.## Contributing
```shell
npm install && npm test
```