Convert ArcGIS JSON geometries to GeoJSON geometries and vica-versa.
npm install @terraformer/arcgis[![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
> Convert ArcGIS JSON geometries to GeoJSON geometries and vice versa.
``shell`
npm install @terraformer/arcgis
* Terraformer
* [.arcgisToGeoJSON(JSON, [idAttribute])](#module_Terraformer.arcgisToGeoJSON) ⇒ object
* [.geojsonToArcGIS(GeoJSON, [idAttribute])](#module_Terraformer.geojsonToArcGIS) ⇒ object
Kind: static method of Terraformer
Returns: object - GeoJSON.
`js
import { arcgisToGeoJSON } from "@terraformer/arcgis"
arcgisToGeoJSON({
"x":-122.6764,
"y":45.5165,
"spatialReference": {
"wkid": 4326
}
});
>> { "type": "Point", "coordinates": [ -122.6764, 45.5165 ] }
`
| Param | Type | Description |
| --- | --- | --- |
| JSON | object | The input ArcGIS geometry, feature or feature collection. |
| [idAttribute] | string | When converting an ArcGIS Feature its attributes will contain the ID of the feature. If something other than OBJECTID or FID stores the ID, you should pass through the fieldname explicitly. |
Kind: static method of Terraformer
Returns: object - ArcGIS JSON.
`js
import { geojsonToArcGIS } from "@terraformer/arcgis"
geojsonToArcGIS({
"type": "Point",
"coordinates": [45.5165, -122.6764]
})
>> { "x":-122.6764, "y":45.5165, "spatialReference": { "wkid": 4326 } }
`
| Param | Type | Description |
| --- | --- | --- |
| GeoJSON | object | The input GeoJSON Geometry, Feature, GeometryCollection or FeatureCollection. |
| [idAttribute] | string | When converting GeoJSON features, the id will be set as the OBJECTID unless another fieldname is supplied. |
*
This package is distributed as a UMD module and can also be used in AMD based systems or as a global under the Terraformer namespace.
`html``js`
Terraformer.arcgisToGeoJSON(/ ... /);
`js
const Terraformer = require('@terraformer/arcgis');
Terraformer.geojsonToArcGIS(/ ... /);
`
`html`
Type definitions for @terraformer/arcgis can be found at @types/terraformer__arcgis. To install into your own project:
``
npm install @types/terraformer__arcgis
| Project | Language | Status | Maintainer |
| - | - | - | - |
| arcgis2geojson` | Python | Incomplete | @chris48s |