Create a NEW Shapefile?

731
3
04-17-2018 10:47 AM
WesBailes
New Contributor III

I've utilized the ShapefileFeatureTable class to load and create new features within an existing shapefile, but is it possible to create a new shapefile with user defined fields, geometry type, etc?  If this functionality doesn't exist now, is it planned in the future?  Thanks for any suggestions!

0 Kudos
3 Replies
MichaelBranscomb
Esri Frequent Contributor

Hi,

Direct support for creating Shapefiles from scratch via the API is a feature under consideration on the roadmap. In the meantime, it is technically possible using the WPF API within ArcGIS Runtime SDK for .NET in conjunction with the ArcGIS Runtime Local Server. You will need to create a Geoprocessing script/model in ArcMap and share that as a Geoprocessing Package. Because Shapefile support requires a Standard license, adding the Local Server component should not add any additional licensing requirements. You might consider this an interim feature in your application until you're ready to move to the Geodatabase format that provides greater functionality (e.g. no .dbf format limitations) and better performance. 

For more information see:

Create Feature Class—Help | ArcGIS Desktop 

What is a geoprocessing package?—ArcMap | ArcGIS Desktop 

A quick tour of creating a geoprocessing package—ArcMap | ArcGIS Desktop  

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

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

Cheers

Mike

WesBailes
New Contributor III

Thanks Mike!

     I'm using UWP so I don't think local server is an option for that.  We are currently using a downloaded feature service for our offline workflow (.geodatabase).  I assume that this is the geodatabase you speak of?  If it's possible to create an editable offline .geodatabase on the fly without having to download that would be great as well?  Basically looking for a more flexible data model where the ArcGIS Runtime app can create the needed schema on it's own.

Wes

0 Kudos
MichaelBranscomb
Esri Frequent Contributor

Hi Wes,

Yes, the downloaded mobile geodatabase is the new type i was referring to. Unfortunately it's not currently possible to create an editable offline .geodatabase on the fly. That feature is also on the roadmap, but I would expect to see that sooner than the Shapefile creation.

Depending on the data volumes to need to create/write you might be able to use a FeatureCollectionTable for which you can create on the fly and specify the schema. It's effectively in memory unless you call ToJson and persist it yourself (or save to a portal as an item). When mobile geodatabase table creation is supported, it will follow the same workflow/pattern as for the feature collection table above, but will be persisted within a .geodatabase file that you will create.

e.g. arcgis-runtime-samples-dotnet/CreateFeatureCollectionLayer.xaml.cs at master · Esri/arcgis-runtime-s... 

Cheers

Mike

0 Kudos