Error: "Invalid argument : wkt.size() == 0" when open shapefile

11-10-2015 08:32 AM
New Contributor III

The code that raises the exception:

   private async Task LoadShapefile(string path)



  FeatureOverlay.Visibility = Visibility.Collapsed;


   // open shapefile table

   var shapefile = await ShapefileTable.OpenAsync(path);


   // clear existing map and spatial reference

   if (Map1.Map.Layers.Any())


  Map1.Map = new Map();


   // create feature layer based on the shapefile

   var flayer = new FeatureLayer(shapefile)


   // Add the feature layer to the map

  txtInfo.Visibility = Visibility.Visible;


   catch (Exception ex)


   MessageBox.Show("Error creating feature layer: " + ex.Message, "Sample Error");

  txtInfo.Visibility = Visibility.Collapsed;


Any idea ?

0 Kudos
1 Reply
Regular Contributor II

Hi Jean,

This error appears to be related to the custom coordinate system. From looking at your projection it appears that you're using 2154 : RGF_1993_Lambert_93. In your shapefile you've renamed this coordinate system to RGF93_Lambert_93, which makes the system treat this as a custom coordinate system even though it appears that you've only only changed the name and none of the other values within the system's definition.

I've been able to replicate this issue using the developer sample for loading shapefiles, which I've included in the attachments. Is there a reason why you're needing to use the custom name for this system? Everything appears to work fine if I use the exact definition as shown in the documentation.

Projected Coordinate Systems

Projected coordinate systems—ArcGIS Runtime SDK for .NET | ArcGIS for Developers


0 Kudos