@esri/arcgis-to-geojson-utils
Advanced tools
Comparing version 1.1.1 to 1.2.0
@@ -6,2 +6,8 @@ # Change log | ||
## [1.2.0] - 2018-03-29 | ||
### Added | ||
* its now possible to convert an array of ArcGIS JSON features to a GeoJSON [FeatureCollection](https://tools.ietf.org/html/rfc7946#section-3.3). (🙏chris48s🙏 [#28](https://github.com/Esri/arcgis-to-geojson-utils/pull/28)) | ||
## [1.1.1] - 2018-03-08 | ||
@@ -60,3 +66,4 @@ | ||
[Unreleased]: https://github.com/Esri/arcgis-to-geojson-utils/compare/v1.1.1...HEAD | ||
[Unreleased]: https://github.com/Esri/arcgis-to-geojson-utils/compare/v1.2.0...HEAD | ||
[1.2.0]: https://github.com/Esri/arcgis-to-geojson-utils/compare/v1.1.1...v1.2.0 | ||
[1.1.1]: https://github.com/Esri/arcgis-to-geojson-utils/compare/v1.1.0...v1.1.1 | ||
@@ -63,0 +70,0 @@ [1.1.0]: https://github.com/Esri/arcgis-to-geojson-utils/compare/v1.0.5...v1.1.0 |
@@ -271,2 +271,10 @@ (function (global, factory) { | ||
if (arcgis.features) { | ||
geojson.type = 'FeatureCollection'; | ||
geojson.features = []; | ||
for (var i = 0; i < arcgis.features.length; i++) { | ||
geojson.features.push(arcgisToGeoJSON(arcgis.features[i], idAttribute)); | ||
} | ||
} | ||
if (typeof arcgis.x === 'number' && typeof arcgis.y === 'number') { | ||
@@ -273,0 +281,0 @@ geojson.type = 'Point'; |
@@ -265,2 +265,10 @@ /* | ||
if (arcgis.features) { | ||
geojson.type = 'FeatureCollection'; | ||
geojson.features = []; | ||
for (var i = 0; i < arcgis.features.length; i++) { | ||
geojson.features.push(arcgisToGeoJSON(arcgis.features[i], idAttribute)); | ||
} | ||
} | ||
if (typeof arcgis.x === 'number' && typeof arcgis.y === 'number') { | ||
@@ -267,0 +275,0 @@ geojson.type = 'Point'; |
{ | ||
"name": "@esri/arcgis-to-geojson-utils", | ||
"description": "Tools to convert ArcGIS JSON geometries to GeoJSON geometries and vica-versa.", | ||
"version": "1.1.1", | ||
"version": "1.2.0", | ||
"author": "Patrick Arlt <patrick.arlt@gmail.com>", | ||
@@ -6,0 +6,0 @@ "bugs": { |
@@ -7,4 +7,4 @@ # arcgis-to-geojson-utils | ||
[npm-image]: https://img.shields.io/npm/v/arcgis-to-geojson-utils.svg?style=flat-square | ||
[npm-url]: https://www.npmjs.com/package/arcgis-to-geojson-utils | ||
[npm-image]: https://img.shields.io/npm/v/@esri/arcgis-to-geojson-utils.svg?style=flat-square | ||
[npm-url]: https://www.npmjs.com/package/@esri/arcgis-to-geojson-utils | ||
[travis-image]: https://img.shields.io/travis/Esri/arcgis-to-geojson-utils/master.svg?style=flat-square | ||
@@ -26,7 +26,7 @@ [travis-url]: https://travis-ci.org/Esri/arcgis-to-geojson-utils | ||
```js | ||
var arcgisToGeoJSON = require('@esri/arcgis-to-geojson-utils').arcgisToGeoJSON; | ||
var geojsonToArcGIS = require('@esri/arcgis-to-geojson-utils').geojsonToArcGIS; | ||
import { arcgisToGeoJSON } from '@esri/arcgis-to-geojson-utils'; | ||
import { geojsonToArcGIS } from '@esri/arcgis-to-geojson-utils'; | ||
// parse ArcGIS JSON, convert it to GeoJSON | ||
var geojson = arcgisToGeoJSON({ | ||
const geojson = arcgisToGeoJSON({ | ||
"x":-122.6764, | ||
@@ -40,3 +40,3 @@ "y":45.5165, | ||
// take GeoJSON and convert it to ArcGIS JSON | ||
var arcgis = geojsonToArcGIS({ | ||
const arcgis = geojsonToArcGIS({ | ||
"type": "Point", | ||
@@ -49,3 +49,3 @@ "coordinates": [45.5165, -122.6764] | ||
// this way works too | ||
var esriUtils = require('@esri/arcgis-to-geojson-utils'); | ||
const esriUtils = require('@esri/arcgis-to-geojson-utils'); | ||
@@ -56,3 +56,3 @@ esriUtils.geojsonToArcGIS(/* ... */); | ||
This package is distributed as a [UMD]() module and can also be used in AMD based systems or as a global under the `ArcgisToGeojsonUtils` namespace. | ||
This package is distributed as a [UMD](https://github.com/umdjs/umd) module and can also be used in AMD based systems or as a global under the `ArcgisToGeojsonUtils` namespace. | ||
@@ -59,0 +59,0 @@ |
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
64255
697
0