Good day,
I'm trying to create a featureClass, but I'm making a mistake somewhere but I don't know where ...
protected override async void OnClick()
{
await CreateMyLineAsync();
}
private static async Task CreateMyLineAsync()
{
await QueuedTask.Run(async () =>
{
var spatialReference = SpatialReferenceBuilder.CreateSpatialReference(5514);
await CreateFeatureClass(@"D:\classToClass", "Linie.shp", "POLYLINE", "", "DISABLED", "DISABLED", spatialReference);
});
}
private static async Task CreateFeatureClass(string Output, string name, string geometryType, string template, string has_m
, string has_z, SpatialReference spatialReference)
{
var parameters = Geoprocessing.MakeValueArray(Output, name, geometryType, spatialReference);
var selectLayer = "management.CreateFeatureclass";
await FunctionPart(selectLayer, parameters);
}
private static async Task FunctionPart(string stringFunc, IReadOnlyList<string> parameters)
{
try
{
await Geoprocessing.ExecuteToolAsync(stringFunc, parameters).ConfigureAwait(false);
}
catch (Exception ex)
{
Debug.WriteLine(ex.ToString(), Assembly.GetExecutingAssembly().FullName);
throw;
}
}I'll be very happy if someone tells me where the mistake is.The application passes the code but does not create either a shapefile in the file or a layer in the map.
Thank you