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
The runtime doesn't provide any feature for that.
Is there any alternative for this ?
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
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
Hi,
Here are some links to documentation topics that will help you:
Python in ArcGIS Pro—ArcPy Get Started | ArcGIS Desktop
A quick tour of creating tools with Python—Geoprocessing and Python | ArcGIS Desktop
Create Feature Class—Data Management toolbox | ArcGIS Desktop
Package Result—Data Management toolbox | ArcGIS Desktop
Local Server—ArcGIS Runtime SDK for .NET (WPF) | ArcGIS for Developers
Cheers
Mike
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