How can I export to a shapefile/geojson/csv from feature collection layer?

771
6
09-26-2018 10:36 PM
Highlighted
New Contributor III

Hi,

I have created a feature collection layer using static feature collection. I am working in a completely disconnected environment. How can I export my feature collection layer to a shapefile/geojson/csv format ?? Please provide with some solution.

Thanks in advance

Reply
0 Kudos
6 Replies
Highlighted
Esri Frequent Contributor

The runtime doesn't provide any feature for that.

Highlighted
New Contributor III

Is there any alternative for this ?

Reply
0 Kudos
Highlighted
Esri Frequent Contributor

Hi,

You have several options for this type of functionality. If you're building an app for Windows desktops using WPF, then you can use the ArcGIS Runtime Local Server component to create Shapefiles (defining the geometry type, schema, etc) and then add features to the Shapefile. Exporting features to the Shapefile could be done within the same Python script that runs within the Local Server, or alternatively once the script has created the Shapefile then you can use the ArcGIS Runtime API directly to add features to the Shapefile. Exporting features to GeoJSON is also possible using ArcGIS Runtime Local Server and the 'Features To JSON' tool. Exporting to CSV is relatively straightforward, although note you need to take care over decimal separators (',' versus '.' depending on the culture). For more information on using the Local Server component see:

Local Server—ArcGIS Runtime SDK for .NET (WPF) | ArcGIS for Developers 

Local Server geoprocessing tools support—ArcGIS Runtime SDK for .NET (WPF) | ArcGIS for Developers 

License your app—ArcGIS Runtime SDK for .NET (WPF) | ArcGIS for Developers 

Cheers

Mike

Reply
0 Kudos
Highlighted
New Contributor III

Hi Michael,

I am using a WPF app in a complete disconnected environment. Can you help me with code samples , so i can understand , how can i create shape file and how and when should I run , the python script ?

Thanks in advance

Reply
0 Kudos
Highlighted
New Contributor III

Hi Michael,

I tried running the scripts, but it gave me an error. 

import arcpy

import os

arcpy.env.workspace = "c:/data"

arcpy.FeaturesToJSON_conversion(os.path.join("outgdb.gdb", "myfeatures"), "myjsonfeatures.json")

In the following code , I am unable to understand , what is "myfeatures" ? I assumed it to be the name of feature dataset , but my script did not work ? Can you help me with it ?

I also have one other small doubt , that if once geopackage is created to use this tool , Will I be able to convert features of FeatureCollectionLayer(layer created in runtime) ??

If yes, then how ?

Waiting for a reply

Reply
0 Kudos