diff --git a/Plugin/ProDataReader/Config.daml b/Plugin/ProDataReader/Config.daml
deleted file mode 100644
index 343c61b4..00000000
--- a/Plugin/ProDataReader/Config.daml
+++ /dev/null
@@ -1,101 +0,0 @@
-
-
-
-
-
- ProDataReader
- ProDataReader description
- Images\AddinDesktop32.png
- ArcGIS Pro SDK Team, arcgisprosdk@esri.com
- esri, http://www.esri.com
- 5/9/2019 5:35:42 AM, 2019
- Framework
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Plugin/ProDataReader/DarkImages/AddInDesktop16.png b/Plugin/ProDataReader/DarkImages/AddInDesktop16.png
deleted file mode 100644
index 0118942a..00000000
Binary files a/Plugin/ProDataReader/DarkImages/AddInDesktop16.png and /dev/null differ
diff --git a/Plugin/ProDataReader/DarkImages/AddInDesktop32.png b/Plugin/ProDataReader/DarkImages/AddInDesktop32.png
deleted file mode 100644
index 9713e3b1..00000000
Binary files a/Plugin/ProDataReader/DarkImages/AddInDesktop32.png and /dev/null differ
diff --git a/Plugin/ProDataReader/DarkImages/BexDog16.png b/Plugin/ProDataReader/DarkImages/BexDog16.png
deleted file mode 100644
index aabfd1d6..00000000
Binary files a/Plugin/ProDataReader/DarkImages/BexDog16.png and /dev/null differ
diff --git a/Plugin/ProDataReader/DarkImages/BexDog32.png b/Plugin/ProDataReader/DarkImages/BexDog32.png
deleted file mode 100644
index 67e82694..00000000
Binary files a/Plugin/ProDataReader/DarkImages/BexDog32.png and /dev/null differ
diff --git a/Plugin/ProDataReader/DarkImages/Folder16.png b/Plugin/ProDataReader/DarkImages/Folder16.png
deleted file mode 100644
index 049a3120..00000000
Binary files a/Plugin/ProDataReader/DarkImages/Folder16.png and /dev/null differ
diff --git a/Plugin/ProDataReader/DarkImages/Folder32.png b/Plugin/ProDataReader/DarkImages/Folder32.png
deleted file mode 100644
index ce4303be..00000000
Binary files a/Plugin/ProDataReader/DarkImages/Folder32.png and /dev/null differ
diff --git a/Plugin/ProDataReader/DarkImages/FolderWithGISData16.png b/Plugin/ProDataReader/DarkImages/FolderWithGISData16.png
deleted file mode 100644
index ae56a1aa..00000000
Binary files a/Plugin/ProDataReader/DarkImages/FolderWithGISData16.png and /dev/null differ
diff --git a/Plugin/ProDataReader/DarkImages/FolderWithGISData32.png b/Plugin/ProDataReader/DarkImages/FolderWithGISData32.png
deleted file mode 100644
index 4de95027..00000000
Binary files a/Plugin/ProDataReader/DarkImages/FolderWithGISData32.png and /dev/null differ
diff --git a/Plugin/ProDataReader/DarkImages/GenericButtonBlue16.png b/Plugin/ProDataReader/DarkImages/GenericButtonBlue16.png
deleted file mode 100644
index 20b11875..00000000
Binary files a/Plugin/ProDataReader/DarkImages/GenericButtonBlue16.png and /dev/null differ
diff --git a/Plugin/ProDataReader/DarkImages/GenericButtonBlue32.png b/Plugin/ProDataReader/DarkImages/GenericButtonBlue32.png
deleted file mode 100644
index e3b26ab9..00000000
Binary files a/Plugin/ProDataReader/DarkImages/GenericButtonBlue32.png and /dev/null differ
diff --git a/Plugin/ProDataReader/DarkImages/Mdb16.png b/Plugin/ProDataReader/DarkImages/Mdb16.png
deleted file mode 100644
index 62208547..00000000
Binary files a/Plugin/ProDataReader/DarkImages/Mdb16.png and /dev/null differ
diff --git a/Plugin/ProDataReader/DarkImages/Mdb32.png b/Plugin/ProDataReader/DarkImages/Mdb32.png
deleted file mode 100644
index 14995a23..00000000
Binary files a/Plugin/ProDataReader/DarkImages/Mdb32.png and /dev/null differ
diff --git a/Plugin/ProDataReader/DarkImages/ZipDetail16.png b/Plugin/ProDataReader/DarkImages/ZipDetail16.png
deleted file mode 100644
index 06d94d38..00000000
Binary files a/Plugin/ProDataReader/DarkImages/ZipDetail16.png and /dev/null differ
diff --git a/Plugin/ProDataReader/DarkImages/ZipDetail32.png b/Plugin/ProDataReader/DarkImages/ZipDetail32.png
deleted file mode 100644
index 7ac04a74..00000000
Binary files a/Plugin/ProDataReader/DarkImages/ZipDetail32.png and /dev/null differ
diff --git a/Plugin/ProDataReader/ImageMetadata/ImageMetadata.csproj b/Plugin/ProDataReader/ImageMetadata/ImageMetadata.csproj
deleted file mode 100644
index 695d58e3..00000000
--- a/Plugin/ProDataReader/ImageMetadata/ImageMetadata.csproj
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-
-
- Debug
- AnyCPU
- {270B962C-93E5-473F-B502-D05D639CC51D}
- Library
- Properties
- ImageMetadata
- ImageMetadata
- v4.7.2
- 512
- true
-
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
- 1591
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Plugin/ProDataReader/ImageMetadata/Properties/AssemblyInfo.cs b/Plugin/ProDataReader/ImageMetadata/Properties/AssemblyInfo.cs
deleted file mode 100644
index 7a9c3127..00000000
--- a/Plugin/ProDataReader/ImageMetadata/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-
- Copyright 2017 Esri
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-
- See the License for the specific language governing permissions and
- limitations under the License.
-
-*/
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("ImageMetadata")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("ImageMetadata")]
-[assembly: AssemblyCopyright("Copyright © 2019")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("270b962c-93e5-473f-b502-d05d639cc51d")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Plugin/ProDataReader/ImageMetadata/XimgDataTypes.cs b/Plugin/ProDataReader/ImageMetadata/XimgDataTypes.cs
deleted file mode 100644
index ff1c0622..00000000
--- a/Plugin/ProDataReader/ImageMetadata/XimgDataTypes.cs
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
-
- Copyright 2017 Esri
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-
- See the License for the specific language governing permissions and
- limitations under the License.
-
-*/
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace ImageMetadata
-{
-
- public class XimgRational
- {
- private Int32 _num;
- private Int32 _denom;
-
- public XimgRational(byte[] bytes)
- {
- byte[] n = new byte[4];
- byte[] d = new byte[4];
- Array.Copy(bytes, 0, n, 0, 4);
- Array.Copy(bytes, 4, d, 0, 4);
- _num = BitConverter.ToInt32(n, 0);
- _denom = BitConverter.ToInt32(d, 0);
- }
-
- public double ToDouble()
- {
- return Convert.ToDouble(_num) / Convert.ToDouble(_denom);
- }
-
- public string ToString(string separator = "/")
- {
- return _num.ToString() + separator + _denom.ToString();
- }
- }
-
- public class XimgURational
- {
- private UInt32 _num;
- private UInt32 _denom;
-
- public XimgURational(byte[] bytes)
- {
- byte[] n = new byte[4];
- byte[] d = new byte[4];
- Array.Copy(bytes, 0, n, 0, 4);
- Array.Copy(bytes, 4, d, 0, 4);
- _num = BitConverter.ToUInt32(n, 0);
- _denom = BitConverter.ToUInt32(d, 0);
- }
-
- public double ToDouble()
- {
- return Math.Round(Convert.ToDouble(_num) / Convert.ToDouble(_denom), 2);
- }
-
- public override string ToString()
- {
- return this.ToString("/");
- }
-
- public string ToString(string separator)
- {
- return _num.ToString() + separator + _denom.ToString();
- }
- }
-
- public class XimgGPSRational
- {
- private XimgRational _hours;
- private XimgRational _minutes;
- private XimgRational _seconds;
- private double _degrees;
-
- public XimgRational Hours => _hours;
-
- public XimgRational Minutes => _minutes;
-
- public XimgRational Seconds => _seconds;
-
- public double Degrees => _degrees;
-
- public XimgGPSRational(byte[] bytes)
- {
- byte[] h = new byte[8]; byte[] m = new byte[8]; byte[] s = new byte[8];
-
- Array.Copy(bytes, 0, h, 0, 8); Array.Copy(bytes, 8, m, 0, 8); Array.Copy(bytes, 16, s, 0, 8);
-
- _hours = new XimgRational(h);
- _minutes = new XimgRational(m);
- _seconds = new XimgRational(s);
- _degrees = _hours.ToDouble() + (_minutes.ToDouble() / 60) + (_seconds.ToDouble() / 3600);
- }
-
- public override string ToString()
- {
- return _hours.ToDouble() + "° "
- + _minutes.ToDouble() + "\' "
- + _seconds.ToDouble() + "\"";
- }
-
- public string ToString(string separator)
- {
- return _hours.ToDouble() + separator
- + _minutes.ToDouble() + separator +
- _seconds.ToDouble();
- }
- }
-}
diff --git a/Plugin/ProDataReader/ImageMetadata/XimgInfo.cs b/Plugin/ProDataReader/ImageMetadata/XimgInfo.cs
deleted file mode 100644
index 3ba166e7..00000000
--- a/Plugin/ProDataReader/ImageMetadata/XimgInfo.cs
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
-
- Copyright 2017 Esri
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-
- See the License for the specific language governing permissions and
- limitations under the License.
-
-*/
-using System;
-using System.Collections.Generic;
-using System.Drawing;
-using System.IO;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace ImageMetadata
-{
- public class XimgInfo
- {
- private XimgParse _ximgParse = null;
- //private Image _image = null;
-
- ///
- /// Used to parse the metadata from an image stream
- /// see: https://www.exiv2.org/tags.html
- ///
- /// the path to an image
- public XimgInfo(string fileName)
- {
- try
- {
- Path = fileName;
- var image = System.Drawing.Image.FromFile(fileName);
- _ximgParse = new XimgParse(image);
- IsImage = true;
- }
- catch (Exception ex)
- {
- IsImage = false;
- Error = ex.ToString();
- }
- }
-
- public string Path { get; set; }
-
- public string Name
- {
- get
- {
- return !String.IsNullOrEmpty(Path) ? System.IO.Path.GetFileName(Path) : "n/a";
- }
- }
-
- public bool IsFolder
- {
- get
- {
- return Directory.Exists(Path);
- }
- }
-
- public bool IsImage { get; set; }
-
- public bool IsGpsEnabled {
- get {
- var sLat = Latitude.ToString("0.000");
- var sLng = Longitude.ToString("0.000");
- return !(double.IsNaN(Latitude) || double.IsNaN(Longitude))
- && !(sLat.Equals ("0.000") || sLng.Equals ("0.000"));
- }
- }
-
- ///
- /// Always returns 1 = point geometry
- ///
- public int GeometryType => 1;
-
- //public byte[] Image
- //{
- // get
- // {
- // byte[] imgData = System.IO.File.ReadAllBytes(Path);
- // return imgData;
- // }
- //}
-
- public string Error { get; set; }
-
- public double Longitude => _ximgParse.Longitude;
-
- public double Latitude => _ximgParse.Latitude;
-
- public double Altitude => _ximgParse.Altitude;
-
- public double ImageBearing => _ximgParse.ImageBearing;
-
- public DateTime DateTimeOriginal => _ximgParse.DateTimeOriginal;
- }
-}
diff --git a/Plugin/ProDataReader/ImageMetadata/XimgParse.cs b/Plugin/ProDataReader/ImageMetadata/XimgParse.cs
deleted file mode 100644
index 1a2f59c9..00000000
--- a/Plugin/ProDataReader/ImageMetadata/XimgParse.cs
+++ /dev/null
@@ -1,793 +0,0 @@
-/*
-
- Copyright 2017 Esri
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-
- See the License for the specific language governing permissions and
- limitations under the License.
-
-*/
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace ImageMetadata
-{
- public class XimgParse
- {
- private Dictionary _parseTags;
-
- public XimgParse(System.Drawing.Image image)
- {
- Encoding ascii = Encoding.ASCII;
- _parseTags = new Dictionary();
- foreach (System.Drawing.Imaging.PropertyItem pitem in image.PropertyItems)
- {
- if (!ParseTags.ContainsKey(pitem.Id)) continue;
- XimgTag xTag = ParseTags[pitem.Id].Clone();
- string strValue = "";
- object value = null;
- switch (pitem.Type)
- {
- case 0x1:
- {
- #region BYTE (8-bit unsigned int)
- value = pitem.Value[0];
- if (pitem.Value.Length == 4)
- strValue = "Version " + pitem.Value[0].ToString() + "." + pitem.Value[1].ToString();
- else if (pitem.Id == 0x5 && pitem.Value[0] == 0)
- strValue = "Sea level";
- else
- strValue = pitem.Value[0].ToString();
- #endregion
- }
- break;
- case 0x2:
- {
- #region ASCII (8 bit ASCII code)
-
- strValue = ascii.GetString(pitem.Value).Trim('\0');
- value = strValue;
- if (pitem.Id == 0x1 || pitem.Id == 0x13)
- if (strValue == "N") strValue = "North latitude";
- else if (strValue == "S") strValue = "South latitude";
- else strValue = "n/a";
-
- if (pitem.Id == 0x3 || pitem.Id == 0x15)
- if (strValue == "E") strValue = "East longitude";
- else if (strValue == "W") strValue = "West longitude";
- else strValue = "n/a";
-
- if (pitem.Id == 0x9)
- if (strValue == "A") strValue = "Measurement in progress";
- else if (strValue == "V") strValue = "Measurement Interoperability";
- else strValue = "n/a";
-
- if (pitem.Id == 0xA)
- if (strValue == "2") strValue = "2-dimensional measurement";
- else if (strValue == "3") strValue = "3-dimensional measurement";
- else strValue = "n/a";
-
- if (pitem.Id == 0xC || pitem.Id == 0x19)
- if (strValue == "K") strValue = "Kilometers per hour";
- else if (strValue == "M") strValue = "Miles per hour";
- else if (strValue == "N") strValue = "Knots";
- else strValue = "n/a";
-
- if (pitem.Id == 0xE || pitem.Id == 0x10 || pitem.Id == 0x17)
- if (strValue == "T") strValue = "True direction";
- else if (strValue == "M") strValue = "Magnetic direction";
- else strValue = "n/a";
- #endregion
- }
- break;
- case 0x3:
- {
- #region 3 = SHORT (16-bit unsigned int)
- UInt16 uintval = BitConverter.ToUInt16(pitem.Value, 0);
- value = uintval;
-
- // orientation // lookup table
- switch (pitem.Id)
- {
- case 0x8827: // ISO speed rating
- strValue = "ISO-" + uintval.ToString();
- break;
- case 0xA217: // sensing method
- {
- switch (uintval)
- {
- case 1: strValue = "Not defined"; break;
- case 2: strValue = "One-chip color area sensor"; break;
- case 3: strValue = "Two-chip color area sensor"; break;
- case 4: strValue = "Three-chip color area sensor"; break;
- case 5: strValue = "Color sequential area sensor"; break;
- case 7: strValue = "Trilinear sensor"; break;
- case 8: strValue = "Color sequential linear sensor"; break;
- default: strValue = " reserved"; break;
- }
- }
- break;
- case 0x8822: // Exposure program
- switch (uintval)
- {
- case 0: strValue = "Not defined"; break;
- case 1: strValue = "Manual"; break;
- case 2: strValue = "Normal program"; break;
- case 3: strValue = "Aperture priority"; break;
- case 4: strValue = "Shutter priority"; break;
- case 5: strValue = "Creative program (biased toward depth of field)"; break;
- case 6: strValue = "Action program (biased toward fast shutter speed)"; break;
- case 7: strValue = "Portrait mode (for closeup photos with the background out of focus)"; break;
- case 8: strValue = "Landscape mode (for landscape photos with the background in focus)"; break;
- default: strValue = "n/a"; break;
- }
- break;
- case 0x9207: // metering mode
- switch (uintval)
- {
- case 0: strValue = "unknown"; break;
- case 1: strValue = "Average"; break;
- case 2: strValue = "Center Weighted Average"; break;
- case 3: strValue = "Spot"; break;
- case 4: strValue = "MultiSpot"; break;
- case 5: strValue = "Pattern"; break;
- case 6: strValue = "Partial"; break;
- case 255: strValue = "Other"; break;
- default: strValue = "n/a"; break;
- }
- break;
- case 0x9208: // Light source
- {
- switch (uintval)
- {
- case 0: strValue = "unknown"; break;
- case 1: strValue = "Daylight"; break;
- case 2: strValue = "Fluorescent"; break;
- case 3: strValue = "Tungsten (incandescent light)"; break;
- case 4: strValue = "Flash"; break;
- case 9: strValue = "Fine weather"; break;
- case 10: strValue = "Cloudy weather"; break;
- case 11: strValue = "Shade"; break;
- case 12: strValue = "Daylight fluorescent (D 5700 – 7100K)"; break;
- case 13: strValue = "Day white fluorescent (N 4600 – 5400K)"; break;
- case 14: strValue = "Cool white fluorescent (W 3900 – 4500K)"; break;
- case 15: strValue = "White fluorescent (WW 3200 – 3700K)"; break;
- case 17: strValue = "Standard light A"; break;
- case 18: strValue = "Standard light B"; break;
- case 19: strValue = "Standard light C"; break;
- case 20: strValue = "D55"; break;
- case 21: strValue = "D65"; break;
- case 22: strValue = "D75"; break;
- case 23: strValue = "D50"; break;
- case 24: strValue = "ISO studio tungsten"; break;
- case 255: strValue = "ISO studio tungsten"; break;
- default: strValue = "other light source"; break;
- }
- }
- break;
- case 0x9209: // Flash
- {
- switch (uintval)
- {
- case 0x0: strValue = "Flash did not fire"; break;
- case 0x1: strValue = "Flash fired"; break;
- case 0x5: strValue = "Strobe return light not detected"; break;
- case 0x7: strValue = "Strobe return light detected"; break;
- case 0x9: strValue = "Flash fired, compulsory flash mode"; break;
- case 0xD: strValue = "Flash fired, compulsory flash mode, return light not detected"; break;
- case 0xF: strValue = "Flash fired, compulsory flash mode, return light detected"; break;
- case 0x10: strValue = "Flash did not fire, compulsory flash mode"; break;
- case 0x18: strValue = "Flash did not fire, auto mode"; break;
- case 0x19: strValue = "Flash fired, auto mode"; break;
- case 0x1D: strValue = "Flash fired, auto mode, return light not detected"; break;
- case 0x1F: strValue = "Flash fired, auto mode, return light detected"; break;
- case 0x20: strValue = "No flash function"; break;
- case 0x41: strValue = "Flash fired, red-eye reduction mode"; break;
- case 0x45: strValue = "Flash fired, red-eye reduction mode, return light not detected"; break;
- case 0x47: strValue = "Flash fired, red-eye reduction mode, return light detected"; break;
- case 0x49: strValue = "Flash fired, compulsory flash mode, red-eye reduction mode"; break;
- case 0x4D: strValue = "Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected"; break;
- case 0x4F: strValue = "Flash fired, compulsory flash mode, red-eye reduction mode, return light detected"; break;
- case 0x59: strValue = "Flash fired, auto mode, red-eye reduction mode"; break;
- case 0x5D: strValue = "Flash fired, auto mode, return light not detected, red-eye reduction mode"; break;
- case 0x5F: strValue = "Flash fired, auto mode, return light detected, red-eye reduction mode"; break;
- default: strValue = "n/a"; break;
- }
- }
- break;
- case 0x0128: //ResolutionUnit
- {
- switch (uintval)
- {
- case 2: strValue = "Inch"; break;
- case 3: strValue = "Centimeter"; break;
- default: strValue = "No Unit"; break;
- }
- }
- break;
- case 0xA409: // Saturation
- {
- switch (uintval)
- {
- case 0: strValue = "Normal"; break;
- case 1: strValue = "Low saturation"; break;
- case 2: strValue = "High saturation"; break;
- default: strValue = "n/a"; break;
- }
- }
- break;
-
- case 0xA40A: // Sharpness
- {
- switch (uintval)
- {
- case 0: strValue = "Normal"; break;
- case 1: strValue = "Soft"; break;
- case 2: strValue = "Hard"; break;
- default: strValue = "n/a"; break;
- }
- }
- break;
- case 0xA408: // Contrast
- {
- switch (uintval)
- {
- case 0: strValue = "Normal"; break;
- case 1: strValue = "Soft"; break;
- case 2: strValue = "Hard"; break;
- default: strValue = "n/a"; break;
- }
- }
- break;
- case 0x103: // Compression
- {
- switch (uintval)
- {
- case 1: strValue = "Uncompressed"; break;
- case 6: strValue = "JPEG compression (thumbnails only)"; break;
- default: strValue = "n/a"; break;
- }
- }
- break;
- case 0x106: // PhotometricInterpretation
- {
- switch (uintval)
- {
- case 2: strValue = "RGB"; break;
- case 6: strValue = "YCbCr"; break;
- default: strValue = "n/a"; break;
- }
- }
- break;
- case 0x112: // Orientation
- {
- switch (uintval)
- {
- case 1: strValue = "The 0th row is at the visual top of the image, and the 0th column is the visual left-hand side."; break;
- case 2: strValue = "The 0th row is at the visual top of the image, and the 0th column is the visual right-hand side."; break;
- case 3: strValue = "The 0th row is at the visual bottom of the image, and the 0th column is the visual right-hand side."; break;
- case 4: strValue = "The 0th row is at the visual bottom of the image, and the 0th column is the visual left-hand side."; break;
- case 5: strValue = "The 0th row is the visual left-hand side of the image, and the 0th column is the visual top."; break;
- case 6: strValue = "The 0th row is the visual right-hand side of the image, and the 0th column is the visual top."; break;
- case 7: strValue = "The 0th row is the visual right-hand side of the image, and the 0th column is the visual bottom."; break;
- case 8: strValue = "The 0th row is the visual left-hand side of the image, and the 0th column is the visual bottom."; break;
- default: strValue = "n/a"; break;
- }
- }
- break;
- case 0x213: // YCbCrPositioning
- {
- switch (uintval)
- {
- case 1: strValue = "centered"; break;
- case 6: strValue = "co-sited"; break;
- default: strValue = "n/a"; break;
- }
- }
- break;
- case 0xA001: // ColorSpace
- {
- switch (uintval)
- {
- case 1: strValue = "sRGB"; break;
- case 0xFFFF: strValue = "Uncalibrated"; break;
- default: strValue = "n/a"; break;
- }
- }
- break;
- case 0xA401: // CustomRendered
- {
- switch (uintval)
- {
- case 0: strValue = "Normal process"; break;
- case 1: strValue = "Custom process"; break;
- default: strValue = "n/a"; break;
- }
- }
- break;
- case 0xA402: // ExposureMode
- {
- switch (uintval)
- {
- case 0: strValue = "Auto exposure"; break;
- case 1: strValue = "Manual exposure"; break;
- case 2: strValue = "Auto bracket"; break;
- default: strValue = "n/a"; break;
- }
- }
- break;
- case 0xA403: // WhiteBalance
- {
- switch (uintval)
- {
- case 0: strValue = "Auto white balance"; break;
- case 1: strValue = "Manual white balance"; break;
- default: strValue = "n/a"; break;
- }
- }
- break;
- case 0xA406: // SceneCaptureType
- {
- switch (uintval)
- {
- case 0: strValue = "Standard"; break;
- case 1: strValue = "Landscape"; break;
- case 2: strValue = "Portrait"; break;
- case 3: strValue = "Night scene"; break;
- default: strValue = "n/a"; break;
- }
- }
- break;
-
- case 0xA40C: // SubjectDistanceRange
- {
- switch (uintval)
- {
- case 0: strValue = "unknown"; break;
- case 1: strValue = "Macro"; break;
- case 2: strValue = "Close view"; break;
- case 3: strValue = "Distant view"; break;
- default: strValue = "n/a"; break;
- }
- }
- break;
- case 0x1E: // GPSDifferential
- {
- switch (uintval)
- {
- case 0: strValue = "Measurement without differential correction"; break;
- case 1: strValue = "Differential correction applied"; break;
- default: strValue = "n/a"; break;
- }
- }
- break;
- case 0xA405: // FocalLengthIn35mmFilm
- strValue = uintval.ToString() + " mm";
- break;
- default://
- strValue = uintval.ToString();
- break;
- }
- #endregion
- }
- break;
- case 0x4:
- {
- #region 4 = LONG (32-bit unsigned int)
- value = BitConverter.ToUInt32(pitem.Value, 0);
- strValue = value.ToString();
- #endregion
- }
- break;
- case 0x5:
- {
- #region 5 = RATIONAL (Two LONGs, unsigned)
-
- XimgURational rat = new XimgURational(pitem.Value);
- value = rat;
- switch (pitem.Id)
- {
- case 0x9202: // ApertureValue
- strValue = "F/" + Math.Round(Math.Pow(Math.Sqrt(2), rat.ToDouble()), 2).ToString();
- break;
- case 0x9205: // MaxApertureValue
- strValue = "F/" + Math.Round(Math.Pow(Math.Sqrt(2), rat.ToDouble()), 2).ToString();
- break;
- case 0x920A: // FocalLength
- strValue = rat.ToDouble().ToString() + " mm";
- break;
- case 0x829D: // F-number
- strValue = "F/" + rat.ToDouble().ToString();
- break;
- case 0x11A: // Xresolution
- strValue = rat.ToDouble().ToString();
- break;
- case 0x11B: // Yresolution
- strValue = rat.ToDouble().ToString();
- break;
- case 0x829A: // ExposureTime
- strValue = rat.ToString() + " sec";
- break;
- case 0x2: // GPSLatitude
- value = new XimgGPSRational(pitem.Value);
- strValue = value.ToString();
- break;
- case 0x4: // GPSLongitude
- value = new XimgGPSRational(pitem.Value);
- strValue = value.ToString();
- break;
- case 0x6: // GPSAltitude
- strValue = rat.ToDouble() + " meters";
- break;
- case 0xA404: // Digital Zoom Ratio
- strValue = rat.ToDouble().ToString();
- if (strValue == "0") strValue = "none";
- break;
- case 0xB: // GPSDOP
- strValue = rat.ToDouble().ToString();
- break;
- case 0xD: // GPSSpeed
- strValue = rat.ToDouble().ToString();
- break;
- case 0xF: // GPSTrack
- strValue = rat.ToDouble().ToString();
- break;
- case 0x11: // GPSImgDir
- strValue = rat.ToDouble().ToString();
- break;
- case 0x14: // GPSDestLatitude
- value = new XimgGPSRational(pitem.Value);
- strValue = value.ToString();
- break;
- case 0x16: // GPSDestLongitude
- value = new XimgGPSRational(pitem.Value);
- strValue = value.ToString();
- break;
- case 0x18: // GPSDestBearing
- strValue = rat.ToDouble().ToString();
- break;
- case 0x1A: // GPSDestDistance
- strValue = rat.ToDouble().ToString();
- break;
- case 0x7: // GPSTimeStamp
- value = new XimgGPSRational(pitem.Value);
- strValue = (value as XimgGPSRational).ToString(":");
- break;
-
- default:
- strValue = rat.ToString();
- break;
- }
-
- #endregion
- }
- break;
- case 0x7:
- {
- #region UNDEFINED (8-bit)
- value = pitem.Value[0];
- switch (pitem.Id)
- {
- case 0xA300: //FileSource
- {
- if (pitem.Value[0] == 3)
- strValue = "DSC";
- else
- strValue = "n/a";
- break;
- }
- case 0xA301: //SceneType
- if (pitem.Value[0] == 1)
- strValue = "A directly photographed image";
- else
- strValue = "n/a";
- break;
- case 0x9000:// Exif Version
- strValue = ascii.GetString(pitem.Value).Trim('\0');
- break;
- case 0xA000: // Flashpix Version
- strValue = ascii.GetString(pitem.Value).Trim('\0');
- if (strValue == "0100")
- strValue = "Flashpix Format Version 1.0";
- else strValue = "n/a";
- break;
- case 0x9101: //ComponentsConfiguration
- strValue = GetComponentsConfig(pitem.Value);
- break;
- case 0x927C: //MakerNote
- strValue = ascii.GetString(pitem.Value).Trim('\0');
- break;
- case 0x9286: //UserComment
- strValue = ascii.GetString(pitem.Value).Trim('\0');
- break;
- case 0x1B: //GPS Processing Method
- strValue = ascii.GetString(pitem.Value).Trim('\0');
- break;
- case 0x1C: //GPS Area Info
- strValue = ascii.GetString(pitem.Value).Trim('\0');
- break;
- default:
- strValue = "-";
- break;
- }
- #endregion
- }
- break;
- case 0x9:
- {
- #region 9 = SLONG (32-bit int)
- value = BitConverter.ToInt32(pitem.Value, 0);
- strValue = value.ToString();
- #endregion
- }
- break;
- case 0xA:
- {
- #region 10 = SRATIONAL (Two SLONGs, signed)
-
- XimgRational rat = new XimgRational(pitem.Value);
- value = rat;
- switch (pitem.Id)
- {
- case 0x9201: // ShutterSpeedValue
- strValue = "1/" + Math.Round(Math.Pow(2, rat.ToDouble()), 2).ToString();
- break;
- case 0x9203: // BrightnessValue
- strValue = Math.Round(rat.ToDouble(), 4).ToString();
- break;
- case 0x9204: // ExposureBiasValue
- strValue = Math.Round(rat.ToDouble(), 2).ToString() + " eV";
- break;
- default:
- strValue = rat.ToString();
- break;
- }
- #endregion
- }
- break;
- }
- xTag.Value = value;
- xTag.StrValue = strValue;
- xTag.ItemType = pitem.Type;
- _parseTags.Add(xTag.Id, xTag);
- }
- }
-
- ///
- /// get data from 0x4, "GPSLongitude" and 0x3, "GPSLongitudeRef", "East or West Longitude"
- ///
- public double Longitude
- {
- get
- {
- if (_parseTags.ContainsKey(0x3) && _parseTags.ContainsKey(0x4))
- {
- var value = (_parseTags[0x4].Value as XimgGPSRational).Degrees;
- if (_parseTags[0x3].StrValue.ToLower().StartsWith ("w"))
- {
- value = -value;
- }
- return value;
- }
- return double.NaN;
- }
- }
-
- ///
- /// get value from 0x2, "GPSLatitude" and 0x1, "GPSLatitudeRef", "North or South Latitude")
- ///
- public double Latitude
- {
- get
- {
- if (_parseTags.ContainsKey(0x1) && _parseTags.ContainsKey(0x2))
- {
- var value = (_parseTags[0x2].Value as XimgGPSRational).Degrees;
- if (_parseTags[0x1].StrValue.ToLower().StartsWith("s"))
- {
- value = -value;
- }
- return value;
- }
- return double.NaN;
- }
- }
-
- ///
- /// get value from 0x6, "GPSAltitude"
- ///
- public double Altitude
- {
- get
- {
- if (_parseTags.ContainsKey(0x6))
- {
- return (_parseTags[0x6].Value as XimgURational).ToDouble();
- }
- return double.NaN;
- }
- }
-
- ///
- /// get value from 0x11, "GPSImgDirection", "Direction of image"
- ///
- public double ImageBearing
- {
- get
- {
- if (_parseTags.ContainsKey(0x11))
- {
- return (_parseTags[0x11].Value as XimgURational).ToDouble();
- }
- return double.NaN;
- }
- }
-
- ///
- /// get value from 0x9003, "DateTimeOriginal"
- ///
- public DateTime DateTimeOriginal
- {
- get
- {
- var dateStr = string.Empty;
- DateTime dateValue = DateTime.Now;
- try
- {
- if (_parseTags.ContainsKey(0x132))
- {
- dateStr = _parseTags[0x132].Value.ToString();
- }
- dateValue = DateTime.Parse(dateStr);
- Console.WriteLine("'{0}' converted to {1}.", dateStr, dateValue);
- }
- catch (FormatException)
- {
- Console.WriteLine("Unable to convert '{0}'.", dateStr);
- }
- return dateValue;
- }
- }
-
- private static Dictionary ParseTags
- {
- get
- {
- var parseTags = new Dictionary
- {
- { 0x100, new XimgTag(0x100, "ImageWidth", "Image width") },
- { 0x101, new XimgTag(0x101, "ImageHeight", "Image height") },
- { 0x0, new XimgTag(0x0, "GPSVersionID", "GPS tag version") },
- { 0x5, new XimgTag(0x5, "GPSAltitudeRef", "Altitude reference") },
- { 0x111, new XimgTag(0x111, "StripOffsets", "Image data location") },
- { 0x116, new XimgTag(0x116, "RowsPerStrip", "Number of rows per strip") },
- { 0x117, new XimgTag(0x117, "StripByteCounts", "Bytes per compressed strip") },
- { 0xA002, new XimgTag(0xA002, "PixelXDimension", "Valid image width") },
- { 0xA003, new XimgTag(0xA003, "PixelYDimension", "Valid image height") },
- { 0x102, new XimgTag(0x102, "BitsPerSample", "Number of bits per component") },
- { 0x103, new XimgTag(0x103, "Compression", "Compression scheme") },
- { 0x106, new XimgTag(0x106, "PhotometricInterpretation", "Pixel composition") },
- { 0x112, new XimgTag(0x112, "Orientation", "Orientation of image") },
- { 0x115, new XimgTag(0x115, "SamplesPerPixel", "Number of components") },
- { 0x11C, new XimgTag(0x11C, "PlanarConfiguration", "Image data arrangement") },
- { 0x212, new XimgTag(0x212, "YCbCrSubSampling", "Subsampling ratio of Y to C") },
- { 0x213, new XimgTag(0x213, "YCbCrPositioning", "Y and C positioning") },
- { 0x128, new XimgTag(0x128, "ResolutionUnit", "Unit of X and Y resolution") },
- { 0x12D, new XimgTag(0x12D, "TransferFunction", "Transfer function") },
- { 0xA001, new XimgTag(0xA001, "ColorSpace", "Color space information") },
- { 0x8822, new XimgTag(0x8822, "ExposureProgram", "Exposure program") },
- { 0x8827, new XimgTag(0x8827, "ISOSpeedRatings", "ISO speed rating") },
- { 0x9207, new XimgTag(0x9207, "MeteringMode", "Metering mode") },
- { 0x9208, new XimgTag(0x9208, "LightSource", "Light source") },
- { 0x9209, new XimgTag(0x9209, "Flash", "Flash") },
- { 0x9214, new XimgTag(0x9214, "SubjectArea", "Subject area") },
- { 0xA210, new XimgTag(0xA210, "FocalPlaneResolutionUnit", "Focal plane resolution unit") },
- { 0xA214, new XimgTag(0xA214, "SubjectLocation", "Subject location") },
- { 0xA217, new XimgTag(0xA217, "SensingMethod", "Sensing method") },
- { 0xA401, new XimgTag(0xA401, "CustomRendered", "Custom image processing") },
- { 0xA402, new XimgTag(0xA402, "ExposureMode", "Exposure mode") },
- { 0xA403, new XimgTag(0xA403, "WhiteBalance", "White balance") },
- { 0xA405, new XimgTag(0xA405, "FocalLengthIn35mmFilm", "Focal length in 35 mm film") },
- { 0xA406, new XimgTag(0xA406, "SceneCaptureType", "Scene capture type") },
- { 0xA408, new XimgTag(0xA408, "Contrast", "Contrast") },
- { 0xA409, new XimgTag(0xA409, "Saturation", "Saturation") },
- { 0xA40A, new XimgTag(0xA40A, "Sharpness", "Sharpness") },
- { 0xA40C, new XimgTag(0xA40C, "SubjectDistanceRange", "Subject distance range") },
- { 0x1E, new XimgTag(0x1E, "GPSDifferential", "GPS differential correction") },
- { 0x9201, new XimgTag(0x9201, "ShutterSpeedValue", "Shutter speed") },
- { 0x9203, new XimgTag(0x9203, "BrightnessValue", "Brightness") },
- { 0x9204, new XimgTag(0x9204, "ExposureBiasValue", "Exposure bias") },
- { 0x201, new XimgTag(0x201, "JPEGInterchangeFormat", "Offset to JPEG SOI") },
- { 0x202, new XimgTag(0x202, "JPEGInterchangeFormatLength", "Bytes of JPEG data") },
- { 0x11A, new XimgTag(0x11A, "XResolution", "Image resolution in width direction") },
- { 0x11B, new XimgTag(0x11B, "YResolution", "Image resolution in height direction") },
- { 0x13E, new XimgTag(0x13E, "WhitePoint", "White point chromaticity") },
- { 0x13F, new XimgTag(0x13F, "PrimaryChromaticities", "Chromaticities of primaries") },
- { 0x211, new XimgTag(0x211, "YCbCrCoefficients", "Color space transformation matrix coefficients") },
- { 0x214, new XimgTag(0x214, "ReferenceBlackWhite", "Pair of black and white reference values") },
- { 0x9102, new XimgTag(0x9102, "CompressedBitsPerPixel", "Image compression mode") },
- { 0x829A, new XimgTag(0x829A, "ExposureTime", "Exposure time") },
- { 0x829D, new XimgTag(0x829D, "FNumber", "F number") },
- { 0x9202, new XimgTag(0x9202, "ApertureValue", "Aperture") },
- { 0x9205, new XimgTag(0x9205, "MaxApertureValue", "Maximum lens aperture") },
- { 0x9206, new XimgTag(0x9206, "SubjectDistance", "Subject distance") },
- { 0x920A, new XimgTag(0x920A, "FocalLength", "Lens focal length") },
- { 0xA404, new XimgTag(0xA404, "DigitalZoomRatio", "Digital zoom ratio") },
- { 0x2, new XimgTag(0x2, "GPSLatitude", "Latitude") },
- { 0x4, new XimgTag(0x4, "GPSLongitude", "Longitude") },
- { 0x6, new XimgTag(0x6, "GPSAltitude", "Altitude") },
- { 0x7, new XimgTag(0x7, "GPSTimeStamp", "GPS time (atomic clock)") },
- { 0xB, new XimgTag(0xB, "GPSDOP", "Measurement precision") },
- { 0xD, new XimgTag(0xD, "GPSSpeed", "Speed of GPS receiver") },
- { 0xF, new XimgTag(0xF, "GPSTrack", "Direction of movement") },
- { 0x11, new XimgTag(0x11, "GPSImgDirection", "Direction of image") },
- { 0x14, new XimgTag(0x14, "GPSDestLatitude", "Latitude of destination") },
- { 0x16, new XimgTag(0x16, "GPSDestLongitude", "Longitude of destination") },
- { 0x18, new XimgTag(0x18, "GPSDestBearing", "Bearing of destination") },
- { 0x1A, new XimgTag(0x1A, "GPSDestDistance", "Distance to destination") },
- { 0x132, new XimgTag(0x132, "DateTime", "File change date and time") },
- { 0x10E, new XimgTag(0x10E, "ImageDescription", "Image title") },
- { 0x10F, new XimgTag(0x10F, "Make", "Image input equipment manufacturer") },
- { 0x110, new XimgTag(0x110, "Model", "Image input equipment model") },
- { 0x131, new XimgTag(0x131, "Software", "Software used") },
- { 0x13B, new XimgTag(0x13B, "Artist", "Person who created the image") },
- { 0x8298, new XimgTag(0x8298, "Copyright", "Copyright holder") },
- { 0xA004, new XimgTag(0xA004, "RelatedSoundFile", "Related audio file") },
- { 0x9003, new XimgTag(0x9003, "DateTimeOriginal", "Date and time of original data generation") },
- { 0x9004, new XimgTag(0x9004, "DateTimeDigitized", "Date and time of digital data generation") },
- { 0x9290, new XimgTag(0x9290, "SubSecTime", "DateTime subseconds") },
- { 0x9291, new XimgTag(0x9291, "SubSecTimeOriginal", "DateTimeOriginal subseconds") },
- { 0x9292, new XimgTag(0x9292, "SubSecTimeDigitized", "DateTimeDigitized subseconds") },
- { 0xA420, new XimgTag(0xA420, "ImageUniqueID", "Unique image ID") },
- { 0x8824, new XimgTag(0x8824, "SpectralSensitivity", "Spectral sensitivity") },
- { 0x1, new XimgTag(0x1, "GPSLatitudeRef", "North or South Latitude") },
- { 0x3, new XimgTag(0x3, "GPSLongitudeRef", "East or West Longitude") },
- { 0x8, new XimgTag(0x8, "GPSSatellites", "GPS satellites used for measurement") },
- { 0x9, new XimgTag(0x9, "GPSStatus", "GPS receiver status") },
- { 0xA, new XimgTag(0xA, "GPSMeasureMode", "GPS measurement mode") },
- { 0xC, new XimgTag(0xC, "GPSSpeedRef", "Speed unit") },
- { 0xE, new XimgTag(0xE, "GPSTrackRef", "Reference for direction of movement") },
- { 0x10, new XimgTag(0x10, "GPSImgDirectionRef", "Reference for direction of image") },
- { 0x12, new XimgTag(0x12, "GPSMapDatum", "Geodetic survey data used") },
- { 0x13, new XimgTag(0x13, "GPSDestLatitudeRef", "Reference for latitude of destination") },
- { 0x15, new XimgTag(0x15, "GPSDestLongitudeRef", "Reference for longitude of destination") },
- { 0x17, new XimgTag(0x17, "GPSDestBearingRef", "Reference for bearing of destination") },
- { 0x19, new XimgTag(0x19, "GPSDestDistanceRef", "Reference for distance to destination") },
- { 0x1D, new XimgTag(0x1D, "GPSDateStamp", "GPS date") },
- { 0xA40B, new XimgTag(0xA40B, "DeviceSettingDescription", "Device settings description") },
- { 0x9000, new XimgTag(0x9000, "ExifVersion", "Exif version") },
- { 0x9286, new XimgTag(0x9286, "UserComment", "User comments") },
- { 0x1B, new XimgTag(0x1B, "GPSProcessingMethod", "Name of GPS processing method") },
- { 0x1C, new XimgTag(0x1C, "GPSAreaInformation", "Name of GPS area") }
- };
- return parseTags;
- }
- }
-
- #region Private members
- private static string GetComponentsConfig(byte[] bytes)
- {
- string s = "";
- string[] vals = new string[] { "", "Y", "Cb", "Cr", "R", "G", "B" };
-
- foreach (byte b in bytes)
- s += vals[b];
-
- return s;
- }
-
- #endregion
- }
-}
diff --git a/Plugin/ProDataReader/ImageMetadata/XimgTag.cs b/Plugin/ProDataReader/ImageMetadata/XimgTag.cs
deleted file mode 100644
index 458c7e12..00000000
--- a/Plugin/ProDataReader/ImageMetadata/XimgTag.cs
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
-
- Copyright 2017 Esri
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-
- See the License for the specific language governing permissions and
- limitations under the License.
-
-*/
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace ImageMetadata
-{
- public class XimgTag
- {
- public XimgTag(int id, string fieldName, string description)
- {
- Id = id;
- Description = description;
- FieldName = fieldName;
- }
- public int Id { get; set; }
- public string Description { get; set; }
- public string FieldName { get; set; }
- public object Value { get; set; }
- public string StrValue { get; set; }
- public int ItemType { get; set; }
-
- public override string ToString()
- {
- return $@"{Description} ({FieldName}) = {StrValue}";
- }
-
- public XimgTag Clone() => new XimgTag (Id, Description, FieldName);
- }
-}
diff --git a/Plugin/ProDataReader/Images/AddInDesktop16.png b/Plugin/ProDataReader/Images/AddInDesktop16.png
deleted file mode 100644
index 5910bbf3..00000000
Binary files a/Plugin/ProDataReader/Images/AddInDesktop16.png and /dev/null differ
diff --git a/Plugin/ProDataReader/Images/AddInDesktop32.png b/Plugin/ProDataReader/Images/AddInDesktop32.png
deleted file mode 100644
index 1d19084a..00000000
Binary files a/Plugin/ProDataReader/Images/AddInDesktop32.png and /dev/null differ
diff --git a/Plugin/ProDataReader/Images/BexDog16.png b/Plugin/ProDataReader/Images/BexDog16.png
deleted file mode 100644
index 64f05ef4..00000000
Binary files a/Plugin/ProDataReader/Images/BexDog16.png and /dev/null differ
diff --git a/Plugin/ProDataReader/Images/BexDog32.png b/Plugin/ProDataReader/Images/BexDog32.png
deleted file mode 100644
index 461fe914..00000000
Binary files a/Plugin/ProDataReader/Images/BexDog32.png and /dev/null differ
diff --git a/Plugin/ProDataReader/Images/Folder16.png b/Plugin/ProDataReader/Images/Folder16.png
deleted file mode 100644
index 049a3120..00000000
Binary files a/Plugin/ProDataReader/Images/Folder16.png and /dev/null differ
diff --git a/Plugin/ProDataReader/Images/Folder32.png b/Plugin/ProDataReader/Images/Folder32.png
deleted file mode 100644
index ce4303be..00000000
Binary files a/Plugin/ProDataReader/Images/Folder32.png and /dev/null differ
diff --git a/Plugin/ProDataReader/Images/FolderWithGISData16.png b/Plugin/ProDataReader/Images/FolderWithGISData16.png
deleted file mode 100644
index ae56a1aa..00000000
Binary files a/Plugin/ProDataReader/Images/FolderWithGISData16.png and /dev/null differ
diff --git a/Plugin/ProDataReader/Images/FolderWithGISData32.png b/Plugin/ProDataReader/Images/FolderWithGISData32.png
deleted file mode 100644
index 4de95027..00000000
Binary files a/Plugin/ProDataReader/Images/FolderWithGISData32.png and /dev/null differ
diff --git a/Plugin/ProDataReader/Images/GenericButtonBlue16.png b/Plugin/ProDataReader/Images/GenericButtonBlue16.png
deleted file mode 100644
index ab6cad35..00000000
Binary files a/Plugin/ProDataReader/Images/GenericButtonBlue16.png and /dev/null differ
diff --git a/Plugin/ProDataReader/Images/GenericButtonBlue32.png b/Plugin/ProDataReader/Images/GenericButtonBlue32.png
deleted file mode 100644
index 4a573fd6..00000000
Binary files a/Plugin/ProDataReader/Images/GenericButtonBlue32.png and /dev/null differ
diff --git a/Plugin/ProDataReader/Images/Mdb16.png b/Plugin/ProDataReader/Images/Mdb16.png
deleted file mode 100644
index 62208547..00000000
Binary files a/Plugin/ProDataReader/Images/Mdb16.png and /dev/null differ
diff --git a/Plugin/ProDataReader/Images/Mdb32.png b/Plugin/ProDataReader/Images/Mdb32.png
deleted file mode 100644
index 14995a23..00000000
Binary files a/Plugin/ProDataReader/Images/Mdb32.png and /dev/null differ
diff --git a/Plugin/ProDataReader/Images/ZipDetail16.png b/Plugin/ProDataReader/Images/ZipDetail16.png
deleted file mode 100644
index 06d94d38..00000000
Binary files a/Plugin/ProDataReader/Images/ZipDetail16.png and /dev/null differ
diff --git a/Plugin/ProDataReader/Images/ZipDetail32.png b/Plugin/ProDataReader/Images/ZipDetail32.png
deleted file mode 100644
index 7ac04a74..00000000
Binary files a/Plugin/ProDataReader/Images/ZipDetail32.png and /dev/null differ
diff --git a/Plugin/ProDataReader/Module1.cs b/Plugin/ProDataReader/Module1.cs
deleted file mode 100644
index f35dff88..00000000
--- a/Plugin/ProDataReader/Module1.cs
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
-
- Copyright 2017 Esri
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-
- See the License for the specific language governing permissions and
- limitations under the License.
-
-*/
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Windows.Input;
-using System.Threading.Tasks;
-using ArcGIS.Core.CIM;
-using ArcGIS.Core.Data;
-using ArcGIS.Core.Geometry;
-using ArcGIS.Desktop.Catalog;
-using ArcGIS.Desktop.Core;
-using ArcGIS.Desktop.Editing;
-using ArcGIS.Desktop.Extensions;
-using ArcGIS.Desktop.Framework;
-using ArcGIS.Desktop.Framework.Contracts;
-using ArcGIS.Desktop.Framework.Dialogs;
-using ArcGIS.Desktop.Framework.Threading.Tasks;
-using ArcGIS.Desktop.Mapping;
-
-namespace ProDataReader
-{
- ///
- /// ProDataReader implements a three plugin datasources to read the following:
- /// - Classic ArcGIS Personal Geodatabase: A personal geodatabase is a Microsoft Access database that can store, query, and manage both spatial and nonspatial data. ProMdbPluginDatasource implements read-only access to personal geodatabase feature class data.
- /// - Jpg photos with GPS metadata: smart phone and digital cameras have the option to capture GPS information when a photo is taken. ProJpgPluginDatasource allows to access these GPS enable photos as a read-only feature class.
- /// - Gpx data: GPX (the GPS eXchange Format) is a data format for exchanging GPS data between programs and implemented by many GPS tracking devices. ProGpxPluginDatasource allows to access Gpx files as a read-only feature class.
- ///
- ///
- /// 1. Download the Community Sample data (see under the 'Resources' section for downloading sample data)
- /// 1. Make sure that the Sample data is unzipped in c:\data
- /// 1. The data used in this sample is located in this folder 'C:\Data\TestPersonalGdb'
- /// 1. Also in order to access Microsoft Access database files you need to download a 64 bit driver which can be downloaded from Microsoft here: https://www.microsoft.com/en-us/download/details.aspx?id=13255
- /// 1. In Visual Studio click the Build menu. Then select Build Solution.
- /// 1. Click Start button to open ArcGIS Pro.
- /// 1. In ArcGIS Pro create a new Map using the Empty Map Template.
- /// 1. Open the Catalog Dockpane and add new Folder Connection to connect this folder 'C:\Data\TestPersonalGdb'
- /// ![UI](Screenshots/Screen1.png)
- /// 1. On the Catalog Dockpane open the TestPersonalGdg folder to explore the ProMdb Project Item which allows you to 'drill-down' to the feature class content of ArcGIS personal geodatabases.
- /// 1. Open the TestPersonalGdg folder to find the TestPGdb.arcgismdb personal geodatabase. The Personal Geodatabase file extension is usually .mdb, however, ArcGIS Pro doesn't allow project custom items with that extension, hence the renaming of the file extension to ArcGISMdb.
- /// ![UI](Screenshots/Screen2.png)
- /// 1. In the source code look at the ProMdbProjectItem class, which is used to implement the TestPGdb.arcgismdb node.
- /// ![UI](Screenshots/Screen3.png)
- /// 1. Under the TestPGdb.arcgismdb node you can see all point/line/polygon feature classes of the personal geodatabase. In source code, the ProMdbTable class is used to prepresent each table.
- /// 1. Right clicking on the TestPGdb.arcgismdb node allows to add TestPGdb.arcgismdb as a Project Item. In the source code this is done in AddToProject button class.
- /// 1. Right clicking on any of the feature classes allows the feature class to be added to the current map. In the source code this is done in the AddToCurrentMap button class.
- /// 1. After you add a ProMdbTable item to the current map, the ProMdbPluginDatasource plug-in is used to convert the MS access table content into a feature class that can be added to a map and displayed as an attribute table.
- /// ![UI](Screenshots/Screen5.png)
- ///
- internal class Module1 : Module
- {
- private static Module1 _this = null;
-
- ///
- /// Retrieve the singleton instance to this module here
- ///
- public static Module1 Current
- {
- get
- {
- return _this ?? (_this = (Module1)FrameworkApplication.FindModule("ProDataReader_Module"));
- }
- }
-
- #region Overrides
- ///
- /// Called by Framework when ArcGIS Pro is closing
- ///
- /// False to prevent Pro from closing, otherwise True
- protected override bool CanUnload()
- {
- //TODO - add your business logic
- //return false to ~cancel~ Application close
- return true;
- }
-
- #endregion Overrides
-
- }
-}
diff --git a/Plugin/ProDataReader/ProDataProjectItem.cs b/Plugin/ProDataReader/ProDataProjectItem.cs
deleted file mode 100644
index d5f3cc83..00000000
--- a/Plugin/ProDataReader/ProDataProjectItem.cs
+++ /dev/null
@@ -1,433 +0,0 @@
-/*
-
- Copyright 2017 Esri
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-
- See the License for the specific language governing permissions and
- limitations under the License.
-
-*/
-using System;
-using System.Collections.Generic;
-using System.IO.Compression;
-using System.Linq;
-using System.Text;
-using System.Drawing.Imaging;
-using System.Threading.Tasks;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using ArcGIS.Desktop.Core;
-using ArcGIS.Desktop.Editing;
-using ESRI.ArcGIS.ItemIndex;
-using MetadataExtractor.Formats.Exif;
-using MetadataExtractor.Formats.Iptc;
-using MetadataExtractor.Formats.Jpeg;
-using MetadataExtractor;
-using ImageMetadata;
-using ProMdbAccessDb;
-using System.Runtime.InteropServices;
-
-namespace ProDataReader
-{
-
- internal class ProDataProjectItem : CustomProjectItemBase
- {
- [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
- [DllImport("kernel32.dll")]
-
- internal static extern uint GetCurrentThreadId();
-
- internal static List FileExtensions = new List { ".mdb", ".gpx", ".jpg" };
-
- List _proMdbAccessDbs = new List();
-
- protected ProDataProjectItem() : base()
- {
- }
-
- protected ProDataProjectItem(ItemInfoValue iiv) : base(FlipBrowseDialogOnly(iiv))
- {
-
- }
-
- private static ItemInfoValue FlipBrowseDialogOnly(ItemInfoValue iiv)
- {
- iiv.browseDialogOnly = "FALSE";
- return iiv;
- }
-
- //TODO: Overload for use in your container create item
- public ProDataProjectItem(string name, string catalogPath, string typeID, string containerTypeID) :
- base(name, catalogPath, typeID, containerTypeID)
- {
-
- }
-
- public ProDataProjectItem Clone() => new ProDataProjectItem(this.Name, this.Path, this.TypeID, this.ContainerType);
-
- ///
- /// Dtor
- ///
- ~ProDataProjectItem()
- {
- foreach (var db in _proMdbAccessDbs)
- {
- db.Close();
- }
- }
-
- public override ImageSource LargeImage
- {
- get
- {
- var largeImg = new BitmapImage(new Uri(@"pack://application:,,,/ProDataReader;component/Images/ZipDetail32.png")) as ImageSource;
- return largeImg;
- }
- }
-
- public override Task SmallImage
- {
- get
- {
- var smallImage = new BitmapImage(new Uri(@"pack://application:,,,/ProDataReader;component/Images/ZipDetail16.png")) as ImageSource;
- if (smallImage == null) throw new ArgumentException("SmallImage for CustomProjectItem doesn't exist");
- return Task.FromResult(smallImage as ImageSource);
- }
- }
- public override ProjectItemInfo OnGetInfo()
- {
- var projectItemInfo = new ProjectItemInfo
- {
- Name = this.Name,
- Path = this.Path,
- Type = ProDataProjectItemContainer.ContainerName
- };
-
- return projectItemInfo;
- }
-
- public override bool IsContainer => true;
-
-
-
- //TODO: Fetch is required if IsContainer = true
- public override void Fetch()
- {
- // Retrieve your child items
- // child items must also derive from CustomItemBase
- // the CustomDataLink file contains lineitems with link to other folder where our customdata
- // is stored
- var alreadyProcessedPath = new List();
- var children = new List();
- var dataFolders = System.IO.File.ReadAllLines(this.Path);
- for (var idx = 0; idx < dataFolders.Length; idx++)
- {
- dataFolders[idx] = dataFolders[idx].TrimEnd(new char [] { '\\', '/' });
- }
- foreach (var ext in FileExtensions)
- {
- foreach (var dataFolder in dataFolders)
- {
- if (string.IsNullOrEmpty(dataFolder)) continue;
- var files = System.IO.Directory.GetFiles(dataFolder, $@"*{ext}", System.IO.SearchOption.AllDirectories);
- foreach (var fullName in files)
- {
- var fileName = System.IO.Path.GetFileNameWithoutExtension(fullName);
- var fileExt = System.IO.Path.GetExtension(fullName).ToLower();
- switch (fileExt)
- {
- case ".gpx":
- {
- var uniquePath = fullName;
- var child = new ProDataSubItem(fileName, uniquePath, this.TypeID,
- null, ProDataSubItem.EnumSubItemType.GpxType);
- children.Add(GetParentFolder(dataFolder, child));
- }
- break;
- case ".mdb":
- {
- ProMdbAccessDb.ProMdbAccessDb accessDb = null;
- var dbChildren = new List();
- try
- {
- var fileMdbPath = $@"{fullName}";
- accessDb = new ProMdbAccessDb.ProMdbAccessDb(fileMdbPath);
- _proMdbAccessDbs.Add(accessDb);
- // child items must also derive from CustomItemBase
- var lstTbl = accessDb.GetSpatialTables();
- foreach (var tblName in lstTbl.Keys)
- {
- // the path has to be 'unique' for each entry otherwise the UI
- // will not treat the enumeration as a real enumeration
- var uniqueDbPath = System.IO.Path.Combine(fileMdbPath, tblName);
- var dbChild = new ProDataSubItem(tblName, uniqueDbPath, this.TypeID,
- lstTbl[tblName], ProDataSubItem.EnumSubItemType.MdbType);
- dbChildren.Add(dbChild);
- }
- }
- catch (Exception ex)
- {
- accessDb = null;
- throw new Exception($@"Check this download: https://www.microsoft.com/en-us/download/details.aspx?id=13255 Error: {ex.Message}");
- }
- if (dbChildren.Count() == 0) break;
- var uniquePath = fullName;
- var child = new ProDataSubItem(fileName, uniquePath, this.TypeID,
- null, ProDataSubItem.EnumSubItemType.MdbType, dbChildren);
- children.Add(GetParentFolder(dataFolder, child));
- }
- break;
- case ".jpg":
- {
- var ximgInfo = new XimgInfo(fullName);
- System.Diagnostics.Debug.WriteLine($@"Image {ximgInfo.IsImage}");
- if (!ximgInfo.IsImage || !ximgInfo.IsGpsEnabled) continue;
-
- //// Get the PropertyItems property from image.
- // the path has to be 'unique' for each entry otherwise the UI
- // will not treat the enumeration as a real enumeration
- // However in this case we only have one single item
-
- var parentFolder = System.IO.Path.GetDirectoryName(fullName);
- if (dataFolder.Equals(parentFolder))
- {
- System.Diagnostics.Debug.WriteLine($@"Lat: {ximgInfo.Latitude} Lon: {ximgInfo.Longitude} Alt: {ximgInfo.Altitude}");
- var uniquePath = fullName;
- var child = new ProDataSubItem(fileName, uniquePath, this.TypeID, null, ProDataSubItem.EnumSubItemType.ImgType);
- children.Add(GetParentFolder(dataFolder, child));
- }
- else
- {
- // directory full of photos
- if (alreadyProcessedPath.Contains(parentFolder))
- {
- // already processed this parent folder
-
- }
- else
- {
- alreadyProcessedPath.Add(parentFolder);
- var jpgChildren = new List();
- var jpgFiles = System.IO.Directory.GetFiles(parentFolder, $@"*{ext}", System.IO.SearchOption.TopDirectoryOnly);
- foreach (var jpgFullName in jpgFiles)
- {
- var xInfo = new XimgInfo(jpgFullName);
- System.Diagnostics.Debug.WriteLine($@"Image {xInfo.IsImage}");
- if (!xInfo.IsImage || !xInfo.IsGpsEnabled) continue;
- jpgChildren.Add(new ProDataSubItem(jpgFullName, jpgFullName, this.TypeID, null, ProDataSubItem.EnumSubItemType.ImgType));
- }
- var uniquePath = System.IO.Path.Combine (parentFolder, $@"{System.IO.Path.GetFileName(parentFolder)} Jpgs");
- var name = System.IO.Path.GetFileName(uniquePath);
- var rootNode = new ProDataSubItem(name, uniquePath, this.TypeID, null, ProDataSubItem.EnumSubItemType.ImgDirType, jpgChildren);
- children.Add(GetParentFolder(dataFolder, rootNode));
- }
- }
- //var img = System.Drawing.Image.FromStream (fs);
- //var propItems = img.PropertyItems;
- //foreach (var propItem in propItems)
- //{
- // System.Diagnostics.Debug.WriteLine($@"iD: 0x{propItem.Id.ToString("x")}");
- //}
- //// see: https://www.exiv2.org/tags.html
- //System.Diagnostics.Debug.WriteLine($@"Image Aspect = {img.Width} x {img.Height}");
- //System.Diagnostics.Debug.WriteLine($@"Make = {ReadImageProperty(img, 0x110)}");
- //System.Diagnostics.Debug.WriteLine($@"Date = {ReadImageProperty(img, 0x0132)}");
-
- //var gps = ImageMetadataReader.ReadMetadata(fs).OfType().FirstOrDefault();
- //var location = gps.GetGeoLocation();
- //System.Diagnostics.Debug.WriteLine($@"Location: {location.Longitude} {location.Latitude}");
- }
- break;
- }
- }
- }
- }
- this.AddRangeToChildren(children);
- }
-
- ///
- /// subItem has a path that needs to be parsed (from the back) in order to build the
- /// directory tree. Only the top node of the directory tree (at topNodeName) will be
- /// returned and then added to the root.
- ///
- /// top directory where all data is located
- /// Item to be inserted at the end of the branch
- /// top node that needs to be added to the root 'data folder'
- private ProDataSubItem GetParentFolder(string topNodeName, ProDataSubItem subItem)
- {
- var parts = topNodeName.Split(new char [] { '/','\\'});
- var rootPartsCnt = parts.Length;
- parts = subItem.Path.Split(new char[] { '/', '\\' });
- var topNode = subItem;
- for (int idx = parts.Length - 2; idx >= rootPartsCnt; idx--)
- {
- var completeFolderPath = string.Empty;
- for (int iidx = 0; iidx <= idx; iidx++)
- {
- if (iidx > 0) completeFolderPath += @"\";
- completeFolderPath += parts[iidx];
- }
- var uniquePath = System.IO.Path.Combine(Path, completeFolderPath);
- topNode = new ProDataSubItem(parts[idx], uniquePath, this.TypeID,
- null, ProDataSubItem.EnumSubItemType.DirType, new List { topNode });
- }
- return topNode;
- }
-
- private static readonly ASCIIEncoding ASCIIencoding = new ASCIIEncoding();
-
- private static string ReadImageProperty(System.Drawing.Image image, int ID)
- {
- try
- {
- var pi = image.GetPropertyItem(ID);
- if (pi.Type == 2) //ASCII
- {
- return ASCIIencoding.GetString(pi.Value, 0, pi.Len - 1);
- }
- if (pi.Type == 5) //rational
- {
- byte[] bb = pi.Value;
- uint uNominator = BitConverter.ToUInt32(bb, 0);
- uint uDenominator = BitConverter.ToUInt32(bb, 4);
- if (uDenominator == 1) return uNominator.ToString();
- return uNominator.ToString() + "/" + uDenominator.ToString();
- }
- }
- catch
- {
- }
- return "Not Found";
- }
- }
-
-
- internal class ProDataSubItem : CustomItemBase
- {
- public enum EnumSubItemType
- {
- DirType = 0,
- GpxType = 1,
- ImgType = 2,
- MdbType = 3,
- GpxDirType = 4,
- ImgDirType = 5
- }
-
- public ProDataSubItem(string name, string catalogPath,
- string typeID, object specialization,
- EnumSubItemType zipSubItemType,
- List children = null) :
- base(System.IO.Path.GetFileNameWithoutExtension(name), catalogPath, typeID, DateTime.Now.ToString())
- {
- ComboPath = name;
- SubItemType = zipSubItemType;
- this.DisplayType = "Misc GIS Feature Class";
- this.ContextMenuID = "ProDataSubItem_ContextMenu";
- if (children != null)
- {
- this.AddRangeToChildren(children);
- }
- Specialization = specialization;
- }
-
- public override bool IsContainer => GetChildren().Count() > 0;
-
- public string ComboPath { get; set; }
-
- public object Specialization { get; set; }
-
- public EnumSubItemType SubItemType { get; set; }
-
- public override ImageSource LargeImage
- {
- get
- {
- var imgSrc = GetIconImage(false);
- return imgSrc;
- }
- }
-
- public override Task SmallImage
- {
- get
- {
- var imgSrc = GetIconImage(true);
- return Task.FromResult(imgSrc);
- }
- }
-
- private ImageSource GetIconImage(bool bSmall)
- {
- var size = bSmall ? "16" : "32";
- var imgSrc = System.Windows.Application.Current.Resources[$@"T-Rex{size}"] as ImageSource;
- switch (SubItemType)
- {
- case EnumSubItemType.DirType:
- imgSrc = System.Windows.Application.Current.Resources[$@"Folder{size}"] as ImageSource;
- break;
- case EnumSubItemType.GpxType:
- imgSrc = System.Windows.Application.Current.Resources[$@"GeodatabaseFeatureClassLine{size}"] as ImageSource;
- break;
- case EnumSubItemType.GpxDirType:
- break;
- case EnumSubItemType.ImgType:
- imgSrc = System.Windows.Application.Current.Resources[$@"Image{size}"] as ImageSource;
- break;
- case EnumSubItemType.ImgDirType:
- {
- imgSrc = System.Windows.Application.Current.Resources[$@"GeodatabaseMosaicDataset{size}"] as ImageSource;
- var fcType = 0;
- var proGpxInfo = Specialization as XimgInfo;
- if (proGpxInfo != null) fcType = proGpxInfo.GeometryType;
- switch (fcType)
- {
- case 1:
- imgSrc = System.Windows.Application.Current.Resources[$@"GeodatabaseFeatureClassPoint{size}"] as ImageSource;
- break;
- }
- }
- break;
- case EnumSubItemType.MdbType:
- {
- var fcType = 0;
- var proMdbTableInfo = Specialization as ProMdbTableInfo;
- if (proMdbTableInfo != null) fcType = proMdbTableInfo.GeometryType;
- switch (fcType)
- {
- case 1:
- imgSrc = System.Windows.Application.Current.Resources[$@"GeodatabaseFeatureClassPoint{size}"] as ImageSource;
- break;
- case 2:
- imgSrc = System.Windows.Application.Current.Resources[$@"GeodatabaseFeatureClassMultipoint{size}"] as ImageSource;
- break;
- case 3:
- imgSrc = System.Windows.Application.Current.Resources[$@"GeodatabaseFeatureClassLine{size}"] as ImageSource;
- break;
- case 4:
- imgSrc = System.Windows.Application.Current.Resources[$@"GeodatabaseFeatureClassPolygon{size}"] as ImageSource;
- break;
- default:
- imgSrc = new BitmapImage(new Uri($@"pack://application:,,,/ProDataReader;component/Images/Mdb{size}.png"));
- break;
- }
- }
- break;
- default:
- imgSrc = System.Windows.Application.Current.Resources[$@"T-Rex{size}"] as ImageSource;
- break;
- }
- if (imgSrc == null) throw new ArgumentException($@"Unable to find small image for ProMdbTable");
- return imgSrc;
- }
- }
-}
diff --git a/Plugin/ProDataReader/ProDataProjectItemContainer.cs b/Plugin/ProDataReader/ProDataProjectItemContainer.cs
deleted file mode 100644
index 671785f5..00000000
--- a/Plugin/ProDataReader/ProDataProjectItemContainer.cs
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
-
- Copyright 2017 Esri
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-
- See the License for the specific language governing permissions and
- limitations under the License.
-
-*/
-using ArcGIS.Desktop.Core;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-
-namespace ProDataReader
-{
- internal class ProDataProjectItemContainer : CustomProjectItemContainer
- {
- //This should be an arbitrary unique string. It must match your
- /// Create item is called whenever a custom item, registered with the container,
- /// is browsed or fetched (eg the user is navigating through different folders viewing
- /// content in the catalog pane).
- ///
- ///
- ///
- ///
- ///
- /// A custom item created from the input parameters
- public override Item CreateItem(string name, string path, string containerType, string data)
- {
- var item = ItemFactory.Instance.Create(path);
- if (item is ProDataProjectItemContainer)
- {
- this.Add(item as ProDataProjectItem);
- }
- return item;
- }
-
- public override ImageSource LargeImage
- {
- get
- {
- var largeImg = new BitmapImage(new Uri(@"pack://application:,,,/ProDataReader;component/Images/FolderWithGISData32.png"));
- return largeImg;
- }
- }
-
- public override Task SmallImage
- {
- get
- {
- var smallImage = new BitmapImage(new Uri(@"pack://application:,,,/ProDataReader;component/Images/FolderWithGISData16.png"));
- if (smallImage == null) throw new ArgumentException("SmallImage for CustomProjectContainer doesn't exist");
- return Task.FromResult(smallImage as ImageSource);
- }
- }
-
- }
-}
diff --git a/Plugin/ProDataReader/ProDataReader (C#).md b/Plugin/ProDataReader/ProDataReader (C#).md
deleted file mode 100644
index 2e328ed5..00000000
--- a/Plugin/ProDataReader/ProDataReader (C#).md
+++ /dev/null
@@ -1,71 +0,0 @@
-## ProDataReader
-
-
-ProDataReader implements a three plugin datasources to read the following:
-- Classic ArcGIS Personal Geodatabase: A personal geodatabase is a Microsoft Access database that can store, query, and manage both spatial and nonspatial data. ProMdbPluginDatasource implements read-only access to personal geodatabase feature class data.
-- Jpg photos with GPS metadata: smart phone and digital cameras have the option to capture GPS information when a photo is taken. ProJpgPluginDatasource allows to access these GPS enable photos as a read-only feature class.
-- Gpx data: GPX (the GPS eXchange Format) is a data format for exchanging GPS data between programs and implemented by many GPS tracking devices. ProGpxPluginDatasource allows to access Gpx files as a read-only feature class.
-
-
-
-View it live
-
-
-```
-Language: C#
-Subject: Framework
-Contributor: ArcGIS Pro SDK Team
-Organization: Esri, http://www.esri.com
-Date: 6/27/2019
-ArcGIS Pro: 2.4
-Visual Studio: 2019
-.NET Target Framework: 4.7.2
-```
-
-## Resources
-
-* [API Reference online](https://pro.arcgis.com/en/pro-app/sdk/api-reference)
-* ArcGIS Pro SDK for .NET (pro.arcgis.com)
-* [arcgis-pro-sdk-community-samples](https://github.com/Esri/arcgis-pro-sdk-community-samples)
-* [ArcGIS Pro DAML ID Reference](https://github.com/Esri/arcgis-pro-sdk/wiki/ArcGIS-Pro-DAML-ID-Reference)
-* [FAQ](https://github.com/Esri/arcgis-pro-sdk/wiki/FAQ)
-* [ArcGIS Pro SDK icons](https://github.com/Esri/arcgis-pro-sdk/releases/tag/2.4.0.19948)
-
-![ArcGIS Pro SDK for .NET Icons](https://Esri.github.io/arcgis-pro-sdk/images/Home/Image-of-icons.png "ArcGIS Pro SDK Icons")
-
-### Samples Data
-
-* Sample data for ArcGIS Pro SDK Community Samples can be downloaded from the [repo releases](https://github.com/Esri/arcgis-pro-sdk-community-samples/releases) page.
-
-## How to use the sample
-
-1. Download the Community Sample data (see under the 'Resources' section for downloading sample data)
-1. Make sure that the Sample data is unzipped in c:\data
-1. The data used in this sample is located in this folder 'C:\Data\TestPersonalGdb'
-1. Also in order to access Microsoft Access database files you need to download a 64 bit driver which can be downloaded from Microsoft here: https://www.microsoft.com/en-us/download/details.aspx?id=13255
-1. In Visual Studio click the Build menu. Then select Build Solution.
-1. Click Start button to open ArcGIS Pro.
-1. In ArcGIS Pro create a new Map using the Empty Map Template.
-1. Open the Catalog Dockpane and add new Folder Connection to connect this folder 'C:\Data\TestPersonalGdb'
-![UI](Screenshots/Screen1.png)
-
-1. On the Catalog Dockpane open the TestPersonalGdg folder to explore the ProMdb Project Item which allows you to 'drill-down' to the feature class content of ArcGIS personal geodatabases.
-1. Open the TestPersonalGdg folder to find the TestPGdb.arcgismdb personal geodatabase. The Personal Geodatabase file extension is usually .mdb, however, ArcGIS Pro doesn't allow project custom items with that extension, hence the renaming of the file extension to ArcGISMdb.
-![UI](Screenshots/Screen2.png)
-
-1. In the source code look at the ProMdbProjectItem class, which is used to implement the TestPGdb.arcgismdb node.
-![UI](Screenshots/Screen3.png)
-
-1. Under the TestPGdb.arcgismdb node you can see all point/line/polygon feature classes of the personal geodatabase. In source code, the ProMdbTable class is used to prepresent each table.
-1. Right clicking on the TestPGdb.arcgismdb node allows to add TestPGdb.arcgismdb as a Project Item. In the source code this is done in AddToProject button class.
-1. Right clicking on any of the feature classes allows the feature class to be added to the current map. In the source code this is done in the AddToCurrentMap button class.
-1. After you add a ProMdbTable item to the current map, the ProMdbPluginDatasource plug-in is used to convert the MS access table content into a feature class that can be added to a map and displayed as an attribute table.
-![UI](Screenshots/Screen5.png)
-
-
-
-
-
-
-
-[Home](https://github.com/Esri/arcgis-pro-sdk/wiki) | API Reference | [Requirements](https://github.com/Esri/arcgis-pro-sdk/wiki#requirements) | [Download](https://github.com/Esri/arcgis-pro-sdk/wiki#installing-arcgis-pro-sdk-for-net) | Samples
diff --git a/Plugin/ProDataReader/ProDataReader.csproj b/Plugin/ProDataReader/ProDataReader.csproj
deleted file mode 100644
index ec626853..00000000
--- a/Plugin/ProDataReader/ProDataReader.csproj
+++ /dev/null
@@ -1,245 +0,0 @@
-
-
-
- Debug
- AnyCPU
- 8.0.30703
- 2.0
- {E74A0802-C331-4183-806D-0757122D8733}
- Library
- Properties
- ProDataReader
- ProDataReader
- v4.7.2
- 512
- {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
-
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
- Program
- C:\Program Files\ArcGIS\Pro\bin\ArcGISPro.exe
- AnyCPU
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
- Program
- C:\Program Files\ArcGIS\Pro\bin\ArcGISPro.exe
- AnyCPU
-
-
- $([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\ESRI\ArcGISPro', 'InstallDir', null, RegistryView.Registry64))
- $(registry:HKEY_CURRENT_USER\SOFTWARE\ESRI\ArcGISPro@InstallDir)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- C:\Program Files\ArcGIS\Pro\bin\ArcGIS.Desktop.Framework.dll
- False
-
-
- C:\Program Files\ArcGIS\Pro\bin\ArcGIS.Core.dll
- False
-
-
- C:\Program Files\ArcGIS\Pro\bin\Extensions\Core\ArcGIS.Desktop.Core.dll
- False
-
-
- C:\Program Files\ArcGIS\Pro\bin\Extensions\Mapping\ArcGIS.Desktop.Mapping.dll
- False
-
-
- C:\Program Files\ArcGIS\Pro\bin\Extensions\Catalog\ArcGIS.Desktop.Catalog.dll
- False
-
-
- C:\Program Files\ArcGIS\Pro\bin\Extensions\Editing\ArcGIS.Desktop.Editing.dll
- False
-
-
- C:\Program Files\ArcGIS\Pro\bin\Extensions\DesktopExtensions\ArcGIS.Desktop.Extensions.dll
- False
-
-
- C:\Program Files\ArcGIS\Pro\bin\Extensions\GeoProcessing\ArcGIS.Desktop.GeoProcessing.dll
- False
-
-
- C:\Program Files\ArcGIS\Pro\bin\Extensions\Layout\ArcGIS.Desktop.Layouts.dll
- False
-
-
- C:\Program Files\ArcGIS\Pro\bin\ArcGIS.Desktop.Shared.Wpf.dll
- False
-
-
- C:\Program Files\ArcGIS\Pro\bin\ArcGIS.Desktop.Ribbon.Wpf.dll
- False
-
-
- C:\Program Files\ArcGIS\Pro\bin\ArcGIS.Desktop.DataGrid.Contrib.Wpf.dll
- False
-
-
- C:\Program Files\ArcGIS\Pro\bin\ArcGIS.Desktop.Resources.dll
- False
-
-
- C:\Program Files\ArcGIS\Pro\bin\ArcGIS.Desktop.Resources.dll
- False
-
-
- C:\Program Files\ArcGIS\Pro\bin\ESRI.ArcGIS.ItemIndex.dll
- False
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {270b962c-93e5-473f-b502-d05d639cc51d}
- ImageMetadata
-
-
- {00b0aac0-bf42-44d6-8638-15b563782ce2}
- MdbAccessDb
-
-
-
-
-
-
-
-
-
-
-
-
- 2.1.0
-
-
-
-
-
-
-
-
-
-
-
- BuildDefault
- bin\Debug\ProDataReader.xml
- 1591
-
-
- BuildDefault
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Plugin/ProDataReader/ProDataReader.sln b/Plugin/ProDataReader/ProDataReader.sln
deleted file mode 100644
index 782b6f0e..00000000
--- a/Plugin/ProDataReader/ProDataReader.sln
+++ /dev/null
@@ -1,60 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 16
-VisualStudioVersion = 16.0.28803.352
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProDataReader", "ProDataReader.csproj", "{E74A0802-C331-4183-806D-0757122D8733}"
- ProjectSection(ProjectDependencies) = postProject
- {3DE57E08-5EF4-47E7-9C11-569061FDA3D5} = {3DE57E08-5EF4-47E7-9C11-569061FDA3D5}
- {6E6E1223-1FCC-45AF-AB6F-AA65299EC84B} = {6E6E1223-1FCC-45AF-AB6F-AA65299EC84B}
- {98666CC8-996F-49CF-81F4-03EFB4C941FC} = {98666CC8-996F-49CF-81F4-03EFB4C941FC}
- EndProjectSection
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProGpxPluginDatasource", "ProGfxPluginDatasource\ProGpxPluginDatasource.csproj", "{98666CC8-996F-49CF-81F4-03EFB4C941FC}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImageMetadata", "ImageMetadata\ImageMetadata.csproj", "{270B962C-93E5-473F-B502-D05D639CC51D}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProJpgPluginDatasource", "ProJpgPluginDatasource\ProJpgPluginDatasource.csproj", "{3DE57E08-5EF4-47E7-9C11-569061FDA3D5}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MdbAccessDb", "ProMdbAccessDb\MdbAccessDb.csproj", "{00B0AAC0-BF42-44D6-8638-15B563782CE2}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ProMdbPluginDatasource", "ProMdbPluginDatasource\ProMdbPluginDatasource.csproj", "{6E6E1223-1FCC-45AF-AB6F-AA65299EC84B}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {E74A0802-C331-4183-806D-0757122D8733}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {E74A0802-C331-4183-806D-0757122D8733}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {E74A0802-C331-4183-806D-0757122D8733}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {E74A0802-C331-4183-806D-0757122D8733}.Release|Any CPU.Build.0 = Release|Any CPU
- {98666CC8-996F-49CF-81F4-03EFB4C941FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {98666CC8-996F-49CF-81F4-03EFB4C941FC}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {98666CC8-996F-49CF-81F4-03EFB4C941FC}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {98666CC8-996F-49CF-81F4-03EFB4C941FC}.Release|Any CPU.Build.0 = Release|Any CPU
- {270B962C-93E5-473F-B502-D05D639CC51D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {270B962C-93E5-473F-B502-D05D639CC51D}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {270B962C-93E5-473F-B502-D05D639CC51D}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {270B962C-93E5-473F-B502-D05D639CC51D}.Release|Any CPU.Build.0 = Release|Any CPU
- {3DE57E08-5EF4-47E7-9C11-569061FDA3D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {3DE57E08-5EF4-47E7-9C11-569061FDA3D5}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {3DE57E08-5EF4-47E7-9C11-569061FDA3D5}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {3DE57E08-5EF4-47E7-9C11-569061FDA3D5}.Release|Any CPU.Build.0 = Release|Any CPU
- {00B0AAC0-BF42-44D6-8638-15B563782CE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {00B0AAC0-BF42-44D6-8638-15B563782CE2}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {00B0AAC0-BF42-44D6-8638-15B563782CE2}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {00B0AAC0-BF42-44D6-8638-15B563782CE2}.Release|Any CPU.Build.0 = Release|Any CPU
- {6E6E1223-1FCC-45AF-AB6F-AA65299EC84B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {6E6E1223-1FCC-45AF-AB6F-AA65299EC84B}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {6E6E1223-1FCC-45AF-AB6F-AA65299EC84B}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {6E6E1223-1FCC-45AF-AB6F-AA65299EC84B}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- SolutionGuid = {C63C718E-DC20-4B01-8177-F5DF27BC01BB}
- EndGlobalSection
-EndGlobal
diff --git a/Plugin/ProDataReader/ProGfxPluginDatasource/Config.xml b/Plugin/ProDataReader/ProGfxPluginDatasource/Config.xml
deleted file mode 100644
index 5a91dcc9..00000000
--- a/Plugin/ProDataReader/ProGfxPluginDatasource/Config.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
- ProGpxPluginDatasource
- {98666cc8-996f-49cf-81f4-03efb4c941fc}
- ProGpxPluginDatasource description
- 1.0
- ArcGIS Pro SDK Team, arcgisprosdk@esri.com
- esri, http://www.esri.com
- 5/9/2019 5:44:44 AM, 2019
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Plugin/ProDataReader/ProGfxPluginDatasource/ProGpxPluginCursorTemplate.cs b/Plugin/ProDataReader/ProGfxPluginDatasource/ProGpxPluginCursorTemplate.cs
deleted file mode 100644
index 11b6b0d7..00000000
--- a/Plugin/ProDataReader/ProGfxPluginDatasource/ProGpxPluginCursorTemplate.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
-
- Copyright 2017 Esri
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-
- See the License for the specific language governing permissions and
- limitations under the License.
-
-*/
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using ArcGIS.Core.Data;
-using ArcGIS.Core.Data.PluginDatastore;
-using ArcGIS.Core.Geometry;
-
-namespace ProGpxPluginDatasource
-{
- public class ProGpxPluginCursorTemplate : PluginCursorTemplate
- {
- private Queue _oids;
- private IEnumerable _columns;
- private SpatialReference _srout;
- private IPluginRowProvider _provider;
- private int CurrentId { get; set; }
- private static readonly object _lock = new object();
-
- internal ProGpxPluginCursorTemplate(IPluginRowProvider provider, IEnumerable oids,
- IEnumerable columns, SpatialReference srout)
- {
- _provider = provider;
- _oids = new Queue(oids);
- _columns = columns;
- _srout = srout;
- CurrentId = -1;
- }
- public override PluginRow GetCurrentRow()
- {
- int id = -1;
- //The lock shouldn't be necessary if your cursor is a per thread instance
- //(like the sample is)
- lock (_lock)
- {
- id = CurrentId;
- }
- return _provider.FindRow(id, _columns, _srout);
- }
-
- public override bool MoveNext()
- {
- if (_oids.Count == 0)
- return false;
-
- //The lock shouldn't be necessary if your cursor is a per thread instance
- //(like the sample is)
- lock (_lock)
- {
- CurrentId = _oids.Dequeue();
- }
- return true;
- }
- }
-}
diff --git a/Plugin/ProDataReader/ProGfxPluginDatasource/ProGpxPluginDatasource.csproj b/Plugin/ProDataReader/ProGfxPluginDatasource/ProGpxPluginDatasource.csproj
deleted file mode 100644
index 4476c0a3..00000000
--- a/Plugin/ProDataReader/ProGfxPluginDatasource/ProGpxPluginDatasource.csproj
+++ /dev/null
@@ -1,101 +0,0 @@
-
-
-
- Debug
- AnyCPU
- 8.0.30703
- 2.0
- {98666CC8-996F-49CF-81F4-03EFB4C941FC}
- Library
- Properties
- ProGpxPluginDatasource
- ProGpxPluginDatasource
- v4.7.2
- 512
-
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
- Program
- C:\Program Files\ArcGIS\Pro\bin\ArcGISPro.exe
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
- Program
- C:\Program Files\ArcGIS\Pro\bin\ArcGISPro.exe
-
-
- $([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\ESRI\ArcGISPro', 'InstallDir', null, RegistryView.Registry64))
- $(registry:HKEY_CURRENT_USER\SOFTWARE\ESRI\ArcGISPro@InstallDir)
-
-
-
-
-
-
-
-
-
-
- C:\Program Files\ArcGIS\Pro\bin\ArcGIS.Core.dll
- False
-
-
- C:\Program Files\ArcGIS\Pro\bin\ArcGIS.CoreHost.dll
- False
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- BuildDefault
- 1591
-
-
- BuildDefault
-
-
- Plugin
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Plugin/ProDataReader/ProGfxPluginDatasource/ProGpxPluginDatasourceTemplate.cs b/Plugin/ProDataReader/ProGfxPluginDatasource/ProGpxPluginDatasourceTemplate.cs
deleted file mode 100644
index 9b3321ac..00000000
--- a/Plugin/ProDataReader/ProGfxPluginDatasource/ProGpxPluginDatasourceTemplate.cs
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
-
- Copyright 2017 Esri
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-
- See the License for the specific language governing permissions and
- limitations under the License.
-
-*/
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Runtime.InteropServices;
-using System.Text;
-using System.Threading.Tasks;
-using ArcGIS.Core.Data;
-using ArcGIS.Core.Data.PluginDatastore;
-using ArcGIS.Core.Geometry;
-
-namespace ProGpxPluginDatasource
-{
- public class ProGpxPluginDatasourceTemplate : PluginDatasourceTemplate
- {
- [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
- [DllImport("kernel32.dll")]
-
- internal static extern uint GetCurrentThreadId();
-
- private string _filePath = "";
- private uint _threadId;
-
- private Dictionary _tables;
-
- public override void Open(Uri connectionPath)
- {
- //TODO Initialize your plugin instance. Individual instances
- //of your plugin may be initialized on different threads
- if (!System.IO.File.Exists(connectionPath.LocalPath))
- {
- throw new System.IO.FileNotFoundException(connectionPath.LocalPath);
- }
- //initialize
- //Strictly speaking, tracking your thread id is only necessary if
- //your implementation uses internals that have thread affinity.
- _threadId = GetCurrentThreadId();
- _tables = new Dictionary();
- _filePath = connectionPath.LocalPath;
- }
-
- public override void Close()
- {
- if (_tables == null) return;
- //Dispose of any cached table instances here
- foreach (var table in _tables.Values)
- {
- ((ProGpxPluginTableTemplate)table).Dispose();
- }
- _tables.Clear();
- }
-
- public override PluginTableTemplate OpenTable(string tableName)
- {
- if (!this.GetTableNames().Contains(tableName))
- throw new GeodatabaseTableException($"The table {tableName} was not found");
- return _tables[tableName];
- }
-
- public override IReadOnlyList GetTableNames()
- {
- if (_tables.Count > 0) return _tables.Keys.ToList();
- var tableName = System.IO.Path.GetFileNameWithoutExtension(_filePath);
- if (System.IO.File.Exists(_filePath))
- {
- // there is only one 'table' which is the one gpx file
- _tables.Add(tableName, new ProGpxPluginTableTemplate(_filePath));
- }
- return _tables.Keys.ToList();
- }
-
- public override bool IsQueryLanguageSupported()
- {
- //default is false
- return true;
- }
- }
-}
diff --git a/Plugin/ProDataReader/ProGfxPluginDatasource/ProGpxPluginTableTemplate.cs b/Plugin/ProDataReader/ProGfxPluginDatasource/ProGpxPluginTableTemplate.cs
deleted file mode 100644
index 868a4660..00000000
--- a/Plugin/ProDataReader/ProGfxPluginDatasource/ProGpxPluginTableTemplate.cs
+++ /dev/null
@@ -1,457 +0,0 @@
-/*
-
- Copyright 2017 Esri
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-
- See the License for the specific language governing permissions and
- limitations under the License.
-
-*/
-using System;
-using System.Collections.Generic;
-using System.Data;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Xml;
-using ArcGIS.Core.Data;
-using ArcGIS.Core.Data.PluginDatastore;
-using ArcGIS.Core.Geometry;
-
-namespace ProGpxPluginDatasource
-{
- ///
- /// (Custom) interface the sample uses to extract row information from the
- /// plugin table
- ///
- internal interface IPluginRowProvider
- {
- PluginRow FindRow(int oid, IEnumerable columnFilter, SpatialReference sr);
- }
-
-
- public class ProGpxPluginTableTemplate : PluginTableTemplate, IDisposable, IPluginRowProvider
- {
- private readonly DataTable _dataTable = new DataTable();
- private readonly string _gpxFilePath;
- private readonly SpatialReference _spatialReference;
- private readonly string _tableName;
- private Envelope _gisExtent;
-
- private const string GeometryFieldName = "Shape";
- private const string ObjectIdFieldName = "ObjectId";
- private const string LongFieldName = "Longitude";
- private const string LatFieldName = "Latitude";
- private const string AltFieldName = "Altitude";
- private const string NameFieldName = "Name";
- private const string CreatorFieldName = "Creator";
- private const string CreatorVersionFieldName = "CreatorVersion";
- private const string TypeFieldName = "ActivityType";
- private const string DateTimeFieldName = "ActivityDate";
-
- private List _pluginFields = null;
-
- ///
- /// Ctor using path that points to the gdf file
- ///
- /// path to gdx file
- public ProGpxPluginTableTemplate(string gpxFilePath)
- {
- this._gpxFilePath = gpxFilePath;
- this._tableName = System.IO.Path.GetFileNameWithoutExtension (gpxFilePath);
- this._spatialReference = SpatialReferences.WGS84;
- CreateTable(this._tableName, this._gpxFilePath);
- }
-
- public override IReadOnlyList GetFields()
- {
- if (_pluginFields == null)
- {
- _pluginFields = new List();
- foreach (var col in _dataTable.Columns.Cast())
- {
- // TODO: process all field types here ... this list is not complete
- var fieldType = FieldType.String;
- System.Diagnostics.Debug.WriteLine($@"{col.ColumnName} {col.DataType}");
- if (col.ColumnName == ObjectIdFieldName ||
- col.ColumnName == GeometryFieldName)
- {
- fieldType = col.ColumnName == GeometryFieldName ? FieldType.Geometry : FieldType.OID;
- }
- else
- {
- switch (col.DataType.Name)
- {
- case nameof(DateTime):
- fieldType = FieldType.Date;
- break;
- case nameof(Double):
- fieldType = FieldType.Double;
- break;
- case nameof(Int16):
- fieldType = FieldType.Integer;
- break;
- case nameof(Int32):
- fieldType = FieldType.Integer;
- break;
- case nameof(Guid):
- fieldType = FieldType.GUID;
- break;
- case nameof(String):
- fieldType = FieldType.String;
- break;
- case nameof(Single):
- fieldType = FieldType.Single;
- break;
- default:
- System.Diagnostics.Debug.WriteLine($@"Unsupported datatype: {col.DataType.Name} not mapped");
- break;
- }
- }
- _pluginFields.Add(new PluginField()
- {
- Name = col.ColumnName,
- AliasName = col.ColumnName,
- FieldType = fieldType
- });
- }
- }
- return _pluginFields;
- }
-
- public override string GetName()
- {
- return _tableName;
- }
-
- public override PluginCursorTemplate Search(QueryFilter queryFilter) =>
- this.SearchInternal(queryFilter);
-
- public override PluginCursorTemplate Search(SpatialQueryFilter spatialQueryFilter) =>
- this.SearchInternal(spatialQueryFilter);
-
- public override GeometryType GetShapeType()
- {
- return GeometryType.Polyline;
- }
-
- ///
- /// Get the extent for the dataset (if it has one)
- ///
- /// Ideally, your plugin table should return an extent even if it is
- /// empty
- ///
- public override Envelope GetExtent() { return _gisExtent; }
-
- #region Internal Functions
-
- private void CreateTable(string tableName, string filePath)
- {
- _dataTable.TableName = tableName;
- var oidCol = new DataColumn(ObjectIdFieldName, typeof(Int32))
- {
- AutoIncrement = true,
- AutoIncrementSeed = 1
- };
- _dataTable.Columns.Add(oidCol);
- _dataTable.PrimaryKey = new DataColumn[] { oidCol };
- _dataTable.Columns.Add(new DataColumn(GeometryFieldName, typeof(ArcGIS.Core.Geometry.Geometry)));
- _dataTable.Columns.Add(new DataColumn(LongFieldName, typeof(Double)));
- _dataTable.Columns.Add(new DataColumn(LatFieldName, typeof(Double)));
- _dataTable.Columns.Add(new DataColumn(AltFieldName, typeof(Double)));
- _dataTable.Columns.Add(new DataColumn(TypeFieldName, typeof(string)));
- _dataTable.Columns.Add(new DataColumn(DateTimeFieldName, typeof(DateTime)));
- _dataTable.Columns.Add(new DataColumn(NameFieldName, typeof(string)));
- _dataTable.Columns.Add(new DataColumn(CreatorFieldName, typeof(string)));
- _dataTable.Columns.Add(new DataColumn(CreatorVersionFieldName, typeof(string)));
-
- XmlDocument xmlDoc = new XmlDocument();
- xmlDoc.Load(filePath);
- string xmlns = xmlDoc.DocumentElement.NamespaceURI;
- XmlNamespaceManager nmsp = new XmlNamespaceManager(xmlDoc.NameTable);
- nmsp.AddNamespace("x", xmlns);
- DateTime dateValue = DateTime.Now;
- XmlNodeList nodeList = xmlDoc.DocumentElement.SelectNodes(@"//x:gpx/x:metadata/x:time", nmsp);
- if (nodeList.Count > 0)
- {
- var dateStr = nodeList[0].InnerText;
- try
- {
- dateValue = DateTime.Parse(dateStr);
- Console.WriteLine("'{0}' converted to {1}.", dateStr, dateValue);
- }
- catch (FormatException)
- {
- Console.WriteLine("Unable to convert '{0}'.", dateStr);
- }
- }
- var creator = string.Empty;
- var creatorVersion = string.Empty;
- nodeList = xmlDoc.DocumentElement.SelectNodes(@"//x:gpx", nmsp);
- if (nodeList.Count > 0)
- {
- var node = nodeList[0];
- foreach (XmlAttribute attr in node.Attributes)
- {
- switch (attr.Name) {
- case "creator":
- creator = attr.Value;
- break;
- case "version":
- creatorVersion = attr.Value;
- break;
- }
-
- }
- }
- var activityName = string.Empty;
- var activityType = string.Empty;
- nodeList = xmlDoc.DocumentElement.SelectNodes("/x:gpx/x:trk/x:name", nmsp);
- if (nodeList.Count > 0) activityName = nodeList[0].InnerText;
- nodeList = xmlDoc.DocumentElement.SelectNodes("/x:gpx/x:trk/x:type", nmsp);
- if (nodeList.Count > 0) activityType = nodeList[0].InnerText;
-
- var newRow = _dataTable.NewRow();
- newRow[ObjectIdFieldName] = 1;
- // let's make a 3d line shape
- List lst3DCoords = new List();
- double lng = 0.0, lat = 0.0, ele = 0.0;
- nodeList = xmlDoc.DocumentElement.SelectNodes("/x:gpx/x:trk/x:trkseg/x:trkpt", nmsp);
- foreach (XmlNode node in nodeList)
- {
- lng = double.Parse(node.Attributes["lon"].Value);
- lat = double.Parse(node.Attributes["lat"].Value);
- foreach (XmlNode childNode in node.ChildNodes)
- {
- if (childNode.Name.Equals("ele"))
- {
- ele = double.Parse(childNode.InnerText);
- }
- }
- lst3DCoords.Add(new Coordinate3D(lng, lat, ele));
- }
- var pl = PolylineBuilder.CreatePolyline(lst3DCoords, _spatialReference);
- newRow[GeometryFieldName] = pl;
- newRow[LongFieldName] = lng;
- newRow[LatFieldName] = lat;
- newRow[AltFieldName] = ele;
- newRow[DateTimeFieldName] = dateValue;
- newRow[TypeFieldName] = activityType;
- newRow[NameFieldName] = activityName;
- newRow[CreatorFieldName] = creator;
- newRow[CreatorVersionFieldName] = creatorVersion;
- _dataTable.Rows.Add(newRow);
- _gisExtent = _gisExtent == null
- ? pl.Extent : _gisExtent.Union(pl.Extent);
- }
-
- private PluginCursorTemplate SearchInternal(QueryFilter qf)
- {
- var oids = this.ExecuteQuery(qf);
- var columns = this.GetQuerySubFields(qf);
-
- return new ProGpxPluginCursorTemplate(this,
- oids,
- columns,
- qf.OutputSpatialReference);
- }
-
- ///
- /// Implement querying with a query filter
- ///
- ///
- ///
- private List ExecuteQuery(QueryFilter qf)
- {
- List result = new List();
- SpatialQueryFilter sqf = null;
- if (qf is SpatialQueryFilter)
- {
- sqf = qf as SpatialQueryFilter;
- }
- var whereClause = string.Empty;
- if (!string.IsNullOrEmpty(qf.WhereClause))
- {
- whereClause = qf.WhereClause;
- }
- else
- {
- if (qf.ObjectIDs.Count() > 0)
- {
- whereClause = $@"{ObjectIdFieldName} in ({string.Join(",", qf.ObjectIDs)})";
- }
- }
- var subFields = string.IsNullOrEmpty(qf.SubFields) ? "*" : qf.SubFields;
- var selectRows = _dataTable.Select(whereClause, qf.PostfixClause);
- int recCount = selectRows.Length;
- if (sqf == null)
- {
- result = _dataTable.AsEnumerable().Select(row => (int)row[ObjectIdFieldName]).ToList();
- }
- else
- {
- result = _dataTable.AsEnumerable().Where(Row => CheckSpatialQuery(sqf, Row[GeometryFieldName] as Geometry)).Select(row => (int)row[ObjectIdFieldName]).ToList();
- }
- return result;
- }
-
- private bool CheckSpatialQuery(SpatialQueryFilter sqf, Geometry geom)
- {
- if (geom == null)
- {
- return false;
- }
- return HasRelationship(GeometryEngine.Instance,
- sqf.FilterGeometry, geom, sqf.SpatialRelationship);
- }
-
- internal static bool HasRelationship(IGeometryEngine engine,
- Geometry geom1,
- Geometry geom2,
- SpatialRelationship relationship)
- {
- switch (relationship)
- {
- case SpatialRelationship.Intersects:
- return engine.Intersects(geom1, geom2);
- case SpatialRelationship.IndexIntersects:
- return engine.Intersects(geom1, geom2);
- case SpatialRelationship.EnvelopeIntersects:
- return engine.Intersects(geom1.Extent, geom2.Extent);
- case SpatialRelationship.Contains:
- return engine.Contains(geom1, geom2);
- case SpatialRelationship.Crosses:
- return engine.Crosses(geom1, geom2);
- case SpatialRelationship.Overlaps:
- return engine.Overlaps(geom1, geom2);
- case SpatialRelationship.Touches:
- return engine.Touches(geom1, geom2);
- case SpatialRelationship.Within:
- return engine.Within(geom1, geom2);
- }
- return false;//unknown relationship
- }
-
- private List GetQuerySubFields(QueryFilter qf)
- {
- //Honor Subfields in Query Filter
- string columns = qf.SubFields ?? "*";
- List subFields;
- if (columns == "*")
- {
- subFields = this.GetFields().Select(col => col.Name.ToUpper()).ToList();
- }
- else
- {
- var names = columns.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
- subFields = names.Select(n => n.ToUpper()).ToList();
- }
-
- return subFields;
- }
-
- #endregion Internal Functions
-
- #region IPluginRowProvider
-
- ///
- /// Find a given row (using Object ID) and retrieve attributes using columnFilter and output spatial reference
- ///
- /// Search for this record using this Object ID
- /// List of Column Names to be returned
- /// project spatial data using this output spatial reference
- /// PlugInRow
- public PluginRow FindRow(int oid, IEnumerable columnFilter, SpatialReference srout)
- {
- Geometry shape = null;
- List