Esri / coordinate-conversion-addin-dotnet

Addin for ArcMap and Pro for convenient coordinate conversion in Desktop.
Apache License 2.0
45 stars 20 forks source link

Importing a .csv that uses characters other than commas as delimiters causes ArcGIS Pro to crash #508

Closed ACueva closed 6 years ago

ACueva commented 6 years ago

Environment: ArcGIS Pro 2.2 Final Military Tools 3.0 Final

Data: removed - see comments

Steps to reproduce. Utilize the .csv included above or create a new one with the following values:

Lat Long 
36.605375N  121.399935W
36.474653N  121.348328W
36.583579N  121.498643W
  1. From ArcGIS Pro, load the Military Tools/Coordinate Conversion pane.
  2. Click on Import
  3. Select the .csv file you created/downloaded. (EnemyLocationsDD.csv)
  4. Click "Use two fields"
  5. X Field set to "Lat"
  6. Y Field set to "Long"
  7. ArcGIS Pro will crash.

If you repeat the same steps listed above, this time with the following file: EnemyLocationsDD2.csv

The file should look like this:

Lat,Long
36.605375N,121.399935W
36.474653N,121.348328W
36.583579N,121.498643W

This imports correctly.

The term .csv stands for "Comma Separated Values", however, this is a regional setting and it possible to have a different delimiter set. At the very least the expectation would be for the add-in not to crash ArcGIS Pro

An enhancement would be to allow for multiple delimiters, including:

|
;
(space)
(tab)
lfunkhouser commented 6 years ago

Assigning to @BobBooth to create a test for this added functionality.

BobBooth commented 6 years ago

@lfunkhouser - I have added a bit to test this case to the Coordinate-Conversion_ArcGIS-Pro.md in this PR: https://github.com/ArcGIS/solutions-defense-test-catalog/pull/166

elinz commented 6 years ago

I believe the the approach Pro and ArcMap use when the delimiter is not the default is that you have to create an schema.ini file in the folder that this file resides and specify the new delimiter character. For example, see the first usage bullet for this tool http://pro.arcgis.com/en/pro-app/tool-reference/data-management/xy-table-to-point.htm

elinz commented 6 years ago

To add to my previous comment, see https://docs.microsoft.com/en-us/sql/odbc/microsoft/schema-ini-file-text-file-driver?view=sql-server-2017

BobBooth commented 6 years ago

@elinz - I tested with the sample data file (called EnemyLocationsDD.csv, which I've also added to the test data in \MilitaryToolsTesting\InputData\CSV) and it worked without any additional steps.

dfoll commented 5 years ago

New test data.

The example file given as test data was all stored in a single field. This was causing confusion when trying to test that delimiters other than commas could be used to separate two fields. EnemyLocationsDD.zip