Giter Club home page Giter Club logo

Comments (2)

hoogw avatar hoogw commented on June 17, 2024 1

Got it. I just test, it works. As I read, so far, terraformer does NOT support feature collection, only this module does.

from arcgis-to-geojson-utils.

jgravois avatar jgravois commented on June 17, 2024

Can you add the function to convert arcgis FeatureSet to geojson?

as i explained in Esri/terraformer#104 (comment), support for this is already present.

test('should convert ArcGIS JSON with an array of ArcGIS Features into a GeoJSON FeatureCollection', function (t) {
t.plan(1);
var input = {
'displayFieldName': 'prop0',
'fieldAliases': {'prop0': 'prop0'},
'geometryType': 'esriGeometryPolygon',
'fields': [
{
'name': 'prop0',
'type': 'esriFieldTypeString',
'alias': 'prop0',
'length': 20
},
{
'name': 'OBJECTID',
'type': 'esriFieldTypeOID',
'alias': 'OBJECTID'
},
{
'name': 'FID',
'type': 'esriFieldTypeDouble',
'alias': 'FID'
}
],
'spatialReference': { 'wkid': 4326 },
'features': [
{
'geometry': {
'x': 102,
'y': 0.5
},
'attributes': {
'prop0': 'value0',
'OBJECTID': 0,
'FID': 0
}
}, {
'geometry': {
'paths': [
[[102, 0],
[103, 1],
[104, 0],
[105, 1]]
]
},
'attributes': {
'prop0': null,
'OBJECTID': null,
'FID': 1
}
}, {
'geometry': {
'rings': [
[ [100, 0],
[100, 1],
[101, 1],
[101, 0],
[100, 0] ]
]
},
'attributes': {
'prop0': null,
'OBJECTID': 2,
'FID': 30.25
}
}
]
};
var output = arcgisToGeoJSON(input, 'prop0');
t.deepEqual(output, {
'type': 'FeatureCollection',
'features': [{
'type': 'Feature',
'geometry': {
'type': 'Point',
'coordinates': [102.0, 0.5]
},
'properties': {
'prop0': 'value0',
'OBJECTID': 0,
'FID': 0
},
'id': 'value0'
}, {
'type': 'Feature',
'geometry': {
'type': 'LineString',
'coordinates': [
[102.0, 0.0],
[103.0, 1.0],
[104.0, 0.0],
[105.0, 1.0]
]
},
'properties': {
'prop0': null,
'OBJECTID': null,
'FID': 1
},
'id': 1
}, {
'type': 'Feature',
'geometry': {
'type': 'Polygon',
'coordinates': [
[ [100.0, 0.0],
[101.0, 0.0],
[101.0, 1.0],
[100.0, 1.0],
[100.0, 0.0] ]
]
},
'properties': {
'prop0': null,
'OBJECTID': 2,
'FID': 30.25
},
'id': 2
}]
});
});

from arcgis-to-geojson-utils.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.