Socket
Socket
Sign inDemoInstall

@terraformer/arcgis

Package Overview
Dependencies
1
Maintainers
4
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @terraformer/arcgis

Convert ArcGIS JSON geometries to GeoJSON geometries and vica-versa.


Version published
Weekly downloads
31K
decreased by-12.29%
Maintainers
4
Install size
37.9 kB
Created
Weekly downloads
 

Changelog

Source

[2.1.2]

Fixed

  • @terraformer/spatial
    • fix intersects for multipolygons
    • start exporting applyConverter

Readme

Source

@terraformer/arcgis

npm travis standard

Convert ArcGIS JSON geometries to GeoJSON geometries and vice versa.

Install

npm install @terraformer/arcgis

API Reference

Terraformer

Terraformer.arcgisToGeoJSON(JSON, [idAttribute]) ⇒ object

Converts ArcGIS JSON into GeoJSON.

Kind: static method of Terraformer
Returns: object - GeoJSON.

import { arcgisToGeoJSON } from "@terraformer/arcgis"

arcgisToGeoJSON({
  "x":-122.6764,
  "y":45.5165,
  "spatialReference": {
    "wkid": 4326
  }
});

>> { "type": "Point", "coordinates": [ -122.6764, 45.5165 ] }
ParamTypeDescription
JSONobjectThe input ArcGIS geometry, feature or feature collection.
[idAttribute]stringWhen 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.

Terraformer.geojsonToArcGIS(GeoJSON, [idAttribute]) ⇒ object

Converts GeoJSON into ArcGIS JSON.

Kind: static method of Terraformer
Returns: object - ArcGIS JSON.

import { geojsonToArcGIS } from "@terraformer/arcgis"

geojsonToArcGIS({
  "type": "Point",
  "coordinates": [45.5165, -122.6764]
})

>> { "x":-122.6764, "y":45.5165, "spatialReference": { "wkid": 4326 } }
ParamTypeDescription
GeoJSONobjectThe input GeoJSON Geometry, Feature, GeometryCollection or FeatureCollection.
[idAttribute]stringWhen converting GeoJSON features, the id will be set as the OBJECTID unless another fieldname is supplied.

Usage

Browser (from CDN)

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.

<script src="https://unpkg.com/@terraformer/arcgis"></script>
Terraformer.arcgisToGeoJSON(/* ... */);

Node.js

const Terraformer = require('@terraformer/arcgis');

Terraformer.geojsonToArcGIS(/* ... */);

ES module in the browser

<script type='module'>
  import { arcgisToGeoJSON } from 'https://unpkg.com/@terraformer/arcgis?module';

  // look ma, no build step!
  arcgisToGeoJSON(/* ... */);
</script>

Contributing

TypeScript

Type definitions for @terraformer/arcgis can be found at @types/terraformer__arcgis. To install into your own project:

npm install @types/terraformer__arcgis

Ports

ProjectLanguageStatusMaintainer
arcgis2geojsonPythonIncomplete@chris48s

LICENSE

Keywords

FAQs

Last updated on 02 Aug 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc