Create a Shapefile

1793
5
Jump to solution
08-05-2016 08:46 AM
JoeMadrigal
New Contributor III

I'm looking for an example to just create a simple shapefile offline (Feature layer from shapefile).  Any examples out there?  Tips?  Seems like a basic thing to do, but I can't seem to find how in the help.

Thanks,

Joe

0 Kudos
1 Solution

Accepted Solutions
MichaelBranscomb
Esri Frequent Contributor

Hi,

In ArcGIS Runtime SDK for .NET 10.2.7 the ShapefileTable class cannot be constructed programmatically (and features are read-only). In a future release we are considering enabling the direct editing of existing Shapefiles via this API. To create Shapefiles from scratch you can use LocalServer component which is available with the ArcGIS Runtime SDK. Functionality such as creating Shapefiles is implemented through LocalGeoprocessingServices in the LocalServer. To start a LocalGeoprocessingService you need to create a geoprocessing package (GPK) using ArcGIS Desktop. That GPK can be created either from a Python script or a Model. For more information see Work with local services—ArcGIS Runtime SDK for .NET | ArcGIS for Developers  

A couple of suggestions:

To create a new Shapefile you can use the Create Feature Class tool in the DataManagemment toolbox.

To update features in an existing Shapefile you could use the ArcPy DataAccess UpdateCursor. 

Cheers

Mike

View solution in original post

5 Replies
MichaelBranscomb
Esri Frequent Contributor

Hi,

Do you mean you simply want to add a Shapefile to the Map? Or you would like to programmatically construct a Shapefile by defining geometry type, fields, etc?

Cheers

Mike

0 Kudos
JoeMadrigal
New Contributor III

I would like to programmatically construct a shapefile.

P.S., is there a way to have the forums notify you when there is a response to your answer? 

Thanks,

Joe

0 Kudos
SalieghAziz
New Contributor II

As far as I know, runtime does not offer this functionality. 

I achieved this by writing an SOE and deploying to my ArcGIS Server that would do this for me.

0 Kudos
JoeMadrigal
New Contributor III

This seems like a basic thing that should be included in the Runtime.  Thanks Saliegh.

0 Kudos
MichaelBranscomb
Esri Frequent Contributor

Hi,

In ArcGIS Runtime SDK for .NET 10.2.7 the ShapefileTable class cannot be constructed programmatically (and features are read-only). In a future release we are considering enabling the direct editing of existing Shapefiles via this API. To create Shapefiles from scratch you can use LocalServer component which is available with the ArcGIS Runtime SDK. Functionality such as creating Shapefiles is implemented through LocalGeoprocessingServices in the LocalServer. To start a LocalGeoprocessingService you need to create a geoprocessing package (GPK) using ArcGIS Desktop. That GPK can be created either from a Python script or a Model. For more information see Work with local services—ArcGIS Runtime SDK for .NET | ArcGIS for Developers  

A couple of suggestions:

To create a new Shapefile you can use the Create Feature Class tool in the DataManagemment toolbox.

To update features in an existing Shapefile you could use the ArcPy DataAccess UpdateCursor. 

Cheers

Mike