RADARSAT Toolbar for ArcMap 10.3 · RADARSAT Toolbar for ArcMap 10.3.1 Technical Manual Software...
Transcript of RADARSAT Toolbar for ArcMap 10.3 · RADARSAT Toolbar for ArcMap 10.3.1 Technical Manual Software...
Defence Research and Development Canada Contract Report DRDC-RDDC-2018-C146 July 2018
CAN UNCLASSIFIED
CAN UNCLASSIFIED
RADARSAT Toolbar for ArcMap 10.3.1 Technical Manual
Roberto Carron MGIS Inc. Prepared by: MGIS Inc. 2017A Carp Road, Stittsville ON K0A 1L0
PSPC Contract Number: W7714-4501409915 Technical Authority: Greg Barrie, DRDC – Ottawa Research Centre
Contractor's date of publication: March 2018
RADARSAT Toolbar for
ArcMap 10.3.1
Technical Manual
Software Release 2.0.4.37
Document Version 2.1
Dated: July 31, 2018
RADARSAT Toolbar
For ArcMap 10.3.1 User Manual ______________________________________________________________________________
_________________________________________________________________________________________________________Document version: 2.1 i Dated: July, 2018
REVISION HISTORY
DOCUMENT VERSION
RS Toolbar Version
NAME COMPANY DATE OF
CHANGES COMMENTS
1.1 1.3.2 Roberto Caron
MGIS 16/02/2017
- .NET Framework 4 - Introduced:
OxyPlot
INI Parser
Log4Net
1.2 1.3.3, 1.3.4
Roberto Caron
MGIS 01/03/2017 N/A
2.0 2.0.1 Roberto Caron
MGIS 21/11/2017 New Infrastructure
2.1 2.0.4.37 Roberto Caron
MGIS 31/07/2018 Final Technical Authority review
RADARSAT Toolbar
For ArcMap 10.3.1 User Manual ______________________________________________________________________________
_________________________________________________________________________________________________________Document version: 2.1 i Dated: July, 2018
TABLE OF CONTENTS
1 INTRODUCTION ....................................................................................................................... 1
1.1 Scope of this Document ................................................................................................. 1
1.2 Intended Audience ......................................................................................................... 1
1.3 Document Conventions .................................................................................................. 1
1.4 Build System Requirements ........................................................................................... 1
1.5 Software Versions........................................................................................................... 2
1.6 Acronym List ................................................................................................................... 2
2 PROJECT ORGANIZATION ........................................................................................................ 4
2.1 Project Folders ................................................................................................................ 4
2.2 Solutions and Projects .................................................................................................... 4
2.2.1 Logging ................................................................................................................. 5
2.2.2 INI Parser .............................................................................................................. 6
2.3 Notes on Project Settings ............................................................................................... 6
2.3.1 Setting for debugging the toolbar ....................................................................... 6
2.3.2 .NET Framework ................................................................................................... 7
3 SOFTWARE COMPONENT DETAILS AND BUILD PROCEDURES ............................................... 8
3.1 FFTW ............................................................................................................................... 8
3.2 Modified IA Pro oversampling code ............................................................................... 9
3.3 Managed oversampler ................................................................................................... 9
3.4 IA Pro binaries ................................................................................................................ 9
3.5 DRDC-GDAL ................................................................................................................... 10
3.6 SWIG ............................................................................................................................. 11
3.7 DRDC-GDAL wrapper .................................................................................................... 11
3.8 Math.NET numerics library........................................................................................... 11
3.9 Vegetation roughness editor ........................................................................................ 11
3.10 Soil effects editor.......................................................................................................... 12
3.11 Toolbar utilities ............................................................................................................. 12
3.12 CCM generator ............................................................................................................. 12
3.13 MathUtils ...................................................................................................................... 12
3.14 Point Target Analysis .................................................................................................... 12
3.15 Point Target Analysis Wrapper ..................................................................................... 12
3.16 Distributed Target Analysis .......................................................................................... 12
3.17 Canny Edge Detector .................................................................................................... 13
3.18 RADARSAT Toolbar ....................................................................................................... 13
RADARSAT Toolbar
For ArcMap 10.3.1 User Manual ______________________________________________________________________________
_________________________________________________________________________________________________________Document version: 2.1 ii Dated: July, 2018
4 DEPLOYMENT ........................................................................................................................ 14
4.1 Files Required for Installation ...................................................................................... 14
4.2 Installation Procedure .................................................................................................. 14
4.3 Location of Files on Target Computer .......................................................................... 14
5 SOURCE CODE DETAILS ......................................................................................................... 15
6 RADARSAT TOOLBAR STEPS AFTER LAUNCHING .................................................................. 17
6.1 Radarsat Toolbar Project “BaseExt.cs” class: ............................................................... 17
6.1.1 GDAL................................................................................................................... 17
6.1.2 Dynamic DLL Loading ......................................................................................... 17
6.1.3 Log files .............................................................................................................. 17
6.1.4 DeleteFilesOnNextStartup.ini ............................................................................ 17
7 RADARSAT TOOLBAR WINDOWS .......................................................................................... 18
7.1 Windows ....................................................................................................................... 18
7.2 Panels ........................................................................................................................... 18
8 FUTURE DEVELOPMENT ........................................................................................................ 19
8.1 Known Issues ................................................................................................................ 19
8.1.1 Remove Edge Effect from Oversampled Layers ................................................ 19
8.1.2 Test Bad Orthorectification Results ................................................................... 19
8.1.3 Test Black Orthorectification Results ................................................................. 21
8.2 Suggestions for Future Work ........................................................................................ 21
8.2.1 Implement Tools and Procedures for Ongoing Software Support .................... 21
RADARSAT Toolbar
For ArcMap 10.3.1 User Manual ______________________________________________________________________________
_________________________________________________________________________________________________________Document version: 2.1 iii Dated: July, 2018
LIST OF TABLES
Table 1. Software version list .......................................................................................................... 2
Table 2. Acronym list....................................................................................................................... 2
Table 3. Project folders ................................................................................................................... 4
Table 4. Projects in RADARSAT Toolbar solution ............................................................................ 5
Table 5. IA Pro binaries distributed with the RADARSAT Toolbar ................................................ 10
LIST OF FIGURES
Figure 1. RADARSAT Toolbar software components ...................................................................... 8
Figure 2. Bad orthorectification result #1 ..................................................................................... 20
Figure 3. Bad orthorectification result #2 ..................................................................................... 21
RADARSAT Toolbar
For ArcMap 10.3.1 User Manual ______________________________________________________________________________
_________________________________________________________________________________________________________Document version: 2.1 1 Dated: July, 2018
1 INTRODUCTION
1.1 SCOPE OF THIS DOCUMENT
This document provides a technical description of the RADARSAT Toolbar software developed for the DRDC Ottawa Research Centre. The RADARSAT Toolbar is implemented in C# and .NET 4.0, and uses the ArcObjects developer kit to interact with the ArcMap application.
This document captures all information related to maintenance of the RADARSAT Toolbar that is not included in the system's user manual (R-15-059-1181_User_Manual.docx) or in the source code itself.
1.2 INTENDED AUDIENCE
The intended audience is technical staff in DND and other government departments. It is assumed that the reader is familiar with the following:
RADARSAT-2 data and associated terminology;
DRDC’s Image Analyst Pro (written in Python);
Software tools listed in 1.4;
C# and C++/C programming languages; and
Microsoft’s .NET Framework 4.0.
1.3 DOCUMENT CONVENTIONS
File names and paths are shown in bold type where they appear in text.
Text that appears in graphic user interfaces is shown in bold type.
Names of solutions, projects, and code objects such as classes and functions are shown in fixed width font.
1.4 BUILD SYSTEM REQUIREMENTS
Please refer to the RADARSAT Toolbar user manual (R-15-059-1181_User_Manual.docx) for documentation on the system requirements for running the RADARSAT Toolbar.
The following are the system requirements for building the RADARSAT Toolbar.
Processor speed: 1.6 GHz or faster
Memory: 4 GB
7200 RPM hard disk drive
DirectX 9-capable video card that runs at 1024 x 768 or higher display resolution
RADARSAT Toolbar
For ArcMap 10.3.1 User Manual ______________________________________________________________________________
_________________________________________________________________________________________________________Document version: 2.1 2 Dated: July, 2018
Operating systems: Windows 7 Service Pack 1, Windows 8, Windows Server 2008 R2 SP1, Windows Server 2012, Windows 10
Visual Studio Professional 2012 / C#
Visual Studio Professional 2010 / C and C++
ArcGIS for Desktop 10.3.1 Advanced with Spatial Analyst and Data Interoperability extensions
ArcGIS Developer Kit 10.2
1.5 SOFTWARE VERSIONS
Table 1 contains a list of version numbers for software components described in this document.
Table 1. Software version list
Software Version number Date supplied by DRDC (if applicable)
RADARSAT Toolbar for ArcMap 2.0.1
DRDC-modified Geographic Data Abstraction Library 1.9.2 April 24, 2015
Image Analyst Pro 2.4 May 20, 2015
Math.NET Numerics 4.0.0.0
System.Numerics 4.0.0.0
Log4Net 1.2.15.0
INIFileParser 2.3.0.0
OxyPlot 0.0.1.0 http://www.oxyplot.org/
GDAL 1.0.5648.29897
ESRI ArcObjects 10.3.1.0
1.6 ACRONYM LIST
Table 2. Acronym list
Acronym Definition
CCM Cross Country Mobility
COO Combined Obstacle Overlay
DLL Dynamic Link Library
DRDC Defence Research and Development Canada
DRDC-GDAL DRDC-modified GDAL
Esri Environmental Systems Research Institute
FFT Fast Fourier Transform
FFTW Fastest Fourier Transform in the West (FFT library)
GDAL Geographic Data Abstraction Library
IA Pro Image Analyst Pro
NITF National Transmission Imagery Format
RADARSAT Toolbar
For ArcMap 10.3.1 User Manual ______________________________________________________________________________
_________________________________________________________________________________________________________Document version: 2.1 3 Dated: July, 2018
Acronym Definition
SWIG Simplified Wrapper and Interface Generator
VS2012 Visual Studio 2012
C# .NET C Sharp
C C Language
C++ C Oriented Object Language
Py Python Language
RADARSAT Toolbar
For ArcMap 10.3.1 User Manual ______________________________________________________________________________
_________________________________________________________________________________________________________Document version: 2.1 4 Dated: July, 2018
2 PROJECT ORGANIZATION
2.1 PROJECT FOLDERS
Project folders and their contents are summarized in Table 3.
Table 3. Project folders
Folder Contents
{path}\engines2 All source code and binaries required to build and run the RADARSAT Toolbar
{path}\engines2\DRDC_RADARSAT_VS2012 Source code for RADARSAT Toolbar and associated tools with the solution file.
{path}\engines2\DRDC_RADARSAT_VS2012\COOGenerator\CCMGenerator Project and source code for CCM Generator tool
{path}\engines2\DRDC_RADARSAT_VS2012\COOGenerator\SoilEffectsEditor Project and source code for Soil Effects Editor
{path}\engines2\DRDC_RADARSAT_VS2012\COOGenerator\VegetationRoughnessEditor Project and source code for Vegetation Roughness Editor
{path}\engines2\DRDC_RADARSAT_VS2012\DRDC_RADARSAT RADARSAT Toolbar source code and any UI, esri configuration
{path}\engines2\DRDC_RADARSAT_VS2012\DRDC_RADARSAT2_Core RADARSAT Core source code that drives all interaction between tools
{path}\engines2\DRDC_RADARSAT_VS2012\DRDC_RADARSAT2_Geoprocessing RADARSAT Geoprocessing source code to process a task
{path}\engines2\DRDC_RADARSAT_VS2012\DRDC_RADARSAT2_GPArcGis RADARSAT Geoprocessing for ArcMap source code that interact with a toolbox
{path}\engines2\DRDC_RADARSAT_VS2012\CannyEdgeDetection Canny Edge Detection
{path}\engines2\DRDC_RADARSAT_VS2012\MathUtils RADARSAT utilities for Numpy function, windows functions, arcmap function
{path}\engines2\DRDC_RADARSAT_VS2012\Oversampler Source code for oversampling wrapper library
{path}\engines2\DRDC_RADARSAT_VS2012\ToolbarUtilities General utilities project and source code
{path}\engines2\ThirdParty Third party dependencies
{path}\engines2\ThirdParty\FFTW Fast Fourier transform library
{path}\engines2\ThirdParty\GDAL_DRDC DRDC-modified GDAL
{path}\engines2\ThirdParty\IAPro2.4 IA Pro binaries required by the RADARSAT Toolbar
{path}\engines2\ThirdParty\MathNet.Numerics-3.7.0 Numerics library
{path}\engines2\ThirdParty\swigwin-1.3.31 Interface generator for IA Pro oversampling algorithm
{path}\engines2\pointTargetAnal\dll\pointTargetAnal\pointTargetAnalWrapper C# Project wrapper for interfacing with the C Project
{path}\engines2\pointTargetAnal\dll\pointTargetAnal\pointTargetAnal C Project source code that calculates PTA
{path}\engines2\oxyplot C# source code project for plotting
{path}\engines2\distributedTargetAnalysis C# Project that calculates DTA
{path}\engines2\ogger C source code to simulate logging to a file
2.2 SOLUTIONS AND PROJECTS
The solution file for the RADARSAT Toolbar is {path}\engine2\DRDC_RADARSAT_VS2012 \DRDC_RADARSAT2.sln. The solution file contains the projects that are summarized in Table 4.
RADARSAT Toolbar
For ArcMap 10.3.1 User Manual ______________________________________________________________________________
_________________________________________________________________________________________________________Document version: 2.1 5 Dated: July, 2018
Table 4. Projects in RADARSAT Toolbar solution
Project Description Build output
CCMGenerator CCM generator project C# class library
DRDC_RADARSAT RADARSAT Toolbar project Esri add-in for ArcMap
SoilEffectsEditor Soil Effects Editor project C# class library
ToolbarUtilities Toolbar utilities project C# class library
VegetationRoughnessEditor Vegetation Roughness Editor project C# class library
distributedTargetAnalysis Calculate and analyze a target C# class library
ManagedOversampler Oversample Image C/C++ Project
MathUtils Contains String, JSON, Logging, Math utilities C# class library
pointTargetAnal Calculate and analyze a target C/C++ Project
pointTargetAnalWrapper Wrapper functions to the PTA C# class library
CannyEdgeDetection Calculate Canny Edge C/C++ Project
In addition, a separate solution is used to build the oversampling wrapper library. This solution file is {path}\engine2\DRDC_RADARSAT_VS2012\Oversampler.sln. This solution file contains two projects: ManagedOversampler produces a C++\CLI class library that is compatible with the RADARSAT Toolbar. This library wraps the native C++ oversampling algorithm that is distributed with IA Pro. OverSamplerTester is a simple command line testing application for the wrapper library.
2.2.1 Logging
The RADARSAT has implemented Log4Net (https://logging.apache.org/log4net/). This is an Apache library tool to help the programmer to output log statements to a variety of output targets. When developing, the internal project file “app.config” contains the appenders to write to log files in the “USERPROFILE\AppData\Local” folder. It will not contain more than 30 days of rolling files; the state is set to log WARN and ERROR only to avoid too much writing and slow down any processes. Here is the format used:
DRDC_RADARSAT_ESRI_TOOLBAR-{currentdate}.log In release mode, the “USERPROFILE\AppData\Local” folder contains a file called “DRDC_RADARSAT.dll.config” which will be created if it does not exist. The default is set to WARN and ERROR. Changing the file “DRDC_RADARSAT.dll.config” will require to quit ArcMap and restart it to allow the new settings to be loaded.
RADARSAT Toolbar
For ArcMap 10.3.1 User Manual ______________________________________________________________________________
_________________________________________________________________________________________________________Document version: 2.1 6 Dated: July, 2018
2.2.2 INI Parser
The RADATSAT has implemented a library for reading/writing INI data from IO streams, file streams, and strings (https://github.com/rickyah/ini-parser). Each Windows Form could implement a writer and a loader to persist user’s preferences.
The file is writer in the folder the USERPROFILE\AppData\Local folder and called ‘DRDC_RADARSAT.ini’. The standard file contains a section header per tool with one parameter called ‘INI’. The ‘INI’ parameter contains a JSON string having all preferences. Here is an example:
[PTA]
INI = {"chipPixels":"64 x
64","oversamplingFactor":"8","checkAlwaysOnTop":false,"checkFollowCursor":false,"longitude":175.1
13387305229,"latitude":-36.1765647303017,"row":18338,"col":6097,"width":812,"height":708}
[DTA]
INI = {"drawingOption":4,"analysedSigma":true,"pixelSize":100}
[QUADPOL]
INI =
{"outputImage":3,"definitionOption":2,"isMultiplers":false,"redBandMultipler":1,"blueBandMultiple
r":1,"greenBandMultipler":1}
[BTM]
INI = {"measurementOption":1}
2.3 NOTES ON PROJECT SETTINGS
2.3.1 Setting for debugging the toolbar
Most project settings are stored with the project files and are independent of the disk on which the projects are stored. One exception is the Start Action setting for debugging the RADARSAT Toolbar. This should be set to the path of the ArcMap executable found on the host computer (typically this is C:\Program Files (x86)\ArcGIS\Desktop10.3\bin\ArcMap.exe). This setting can be changed using the following procedure.
1. Open DRDC_RADARSAT2.sln in Visual Studio. 2. Right click DRDC_RADARSAT in Solution Explorer, and click Properties. 3. Click Debug. 4. Under Start Action, click Start external program and enter the path of the ArcMap
executable in the text entry field. 5. IMPORTANT: Any C# Projects must have the target platform to x86 because GDAL is
limited to 32bits 6. IMPORTANT: Any C# Projects must have the “Allow unsafe code” checkbox checked to
allow call to GDAL or other C libraries.
RADARSAT Toolbar
For ArcMap 10.3.1 User Manual ______________________________________________________________________________
_________________________________________________________________________________________________________Document version: 2.1 7 Dated: July, 2018
7. IMPORTANT: Any C/C++ Projects must be built using Visual Studio 2010 because Windows DLL libraries are backward compatible to Windows XP.
This setting can be made in both debug and release modes in order to run the toolbar within Visual Studio in either configuration.
2.3.2 .NET Framework
All projects build against the .NET Framework 4.0. it is the one recommended by the ArcObjects documentation for maximum compatibility with ArcMap 10.3.1.
RADARSAT Toolbar
For ArcMap 10.3.1 User Manual ______________________________________________________________________________
_________________________________________________________________________________________________________Document version: 2.1 8 Dated: July, 2018
3 SOFTWARE COMPONENT DETAILS AND BUILD PROCEDURES
A diagram of the RADARSAT Toolbar software components is shown in Figure 1. An arrow drawn from component A to component B indicates that B depends on A. The diagram does not show dependencies that are included with the build system requirements, such as ArcObjects or the .NET Framework.
Figure 1. RADARSAT Toolbar software components
The individual components are detailed in the following sections.
3.1 FFTW
FFTW supplies the Fast Fourier transform implementation used in the IA Pro oversampling algorithm. When it is downloaded, the Windows distribution of FFTW may not include the library (*.lib) files necessary for linking the managed oversampler application. The file ccore-readme.txt contains instructions for creating these files. The library files have been built and are provided with the source code, along with all other required binaries.
RADARSAT Toolbar
For ArcMap 10.3.1 User Manual ______________________________________________________________________________
_________________________________________________________________________________________________________Document version: 2.1 9 Dated: July, 2018
3.2 MODIFIED IA PRO OVERSAMPLING CODE
The ManagedOversampler project in {path}\engine2\DRDC_RADARSAT_VS2012\Oversampler.sln contains a source file called ATD_Oversample.cpp. This file was copied from the IA Pro codebase, but it was modified to remove the parts of the code that reference GDAL, due to compilation issues that were encountered when trying to link against DRDC-GDAL. The oversampling functions that use GDAL are not required by the RADARSAT Toolbar; specifically, these are the functions oversampleImage(), which opens an image with GDAL and oversamples it; and main(), which enables oversampleImage() to be run from the command prompt. The remaining functions implement the actual oversampling with FFTW, and this is all that is required by the RADARSAT Toolbar in order to perform oversampling in the same way as IA Pro.
3.3 MANAGED OVERSAMPLER
The managed oversampler is a C++/CLI library that wraps the modified IA Pro oversampling code, allowing it to be called from a .NET application (such as the RADARSAT Toolbar). During development from January to September 2015, it was discovered that if the managed oversampler library was built with the VS2012 compiler, then the resulting library would not function correctly with the RADARSAT Toolbar, due to the toolbar being built against the .NET Framework 4.0 (see 2.3.2 for more information about the use of .NET 3.5). In order to integrate the managed oversampler into the toolbar, it was necessary to set the compiler for the
ManagedOversampler project to Visual Studio 2008 (this is the Platform Toolset setting in the General category of the project properties). This setting value is only available if Visual Studio 2008 is installed on the build system. Since this is not a requirement (see 1.4), the pre-built managed oversampler (in both debug and release versions) has been provided with the source code in the folder {path}\engine2\DRDC_RADARSAT_VS2012\Oversampler\ManagedOversampler\Dist. These files will be replaced if the managed oversampler is built.
To build the managed oversampler library, open the file {path}\engine2\DRDC_RADARSAT_VS2012\Oversampler.sln and select Build Solution from the BUILD menu in order to build the project. To build a version for debugging, select Debug in the drop-down list on the Visual Studio toolbar before building. To build a version to deploy on end-user computers, select Release in the drop-down list on the Visual Studio toolbar before building.
3.4 IA PRO BINARIES
The RADARSAT Toolbar is built against DRDC-GDAL, which creates dependencies on binaries (in particular, dynamic link library (*.dll) files) that are distributed with IA Pro. Some specific dependencies were found with the Dependency Walker tool (www.dependencywalker.com);
RADARSAT Toolbar
For ArcMap 10.3.1 User Manual ______________________________________________________________________________
_________________________________________________________________________________________________________Document version: 2.1 10 Dated: July, 2018
others could only be determined at run-time using the Process Monitor tool (https://technet.microsoft.com/en-us/library/bb896645.aspx). To simplify the development of the build and deployment process, it was decided to include all IA Pro *.dll files with the RADARSAT Toolbar deployment package. A list of *.dll files that are deployed with the toolbar is given in Table 5. The libraries shown in bold type are direct dependencies of the GDAL wrapper libraries used by the RADARSAT Toolbar (see 3.7); these are gdal_csharp.dll, gdalconst_charp.dll, ogr_csharp.dll, and osr_csharp.dll. Other DLLs among those listed may be required at run-time.
Table 5. IA Pro binaries distributed with the RADARSAT Toolbar
adrg.dll hm415m.dll libgfortran-3.dll librle3.dll
dtcanada.dll intl.dll libgio-2.0-0.dll libtiff-3.dll
dted.dll jpeg62.dll libglib-2.0-0.dll libtiffxx-3.dll
dtusa.dll kdu_v64R.dll libgmodule-2.0-0.dll lodbc.dll
expat_ogdi32.dll libatk-1.0-0.dll libgobject-2.0-0.dll NCSUtil.dll
freetype6.dll libcairo-2.dll libgthread-2.0-0.dll netcdf.dll
gdal19.dll libcurl.dll libgtkglext-win32-1.0-0.dll ogdi.dll
geos_c.dll libeay32.dll libgtk-win32-2.0-0.dll proj.dll
glew32.dll libecwj2.dll libiconv2.dll remote.dll
hd415m.dll libexpat.dll libintl.dll rpf.dll
hdf5_cppdll.dll libexpat-1.dll libjpeg-7.dll skeleton.dll
hdf5_f90cstubdll.dll libfftw3-3.dll libpango-1.0-0.dll ssleay32.dll
hdf5_fortrandll.dll libfontconfig-1.dll libpangocairo-1.0-0.dll szip.dll
hdf5_hl_cppdll.dll libgailutil-18.dll libpangoft2-1.0-0.dll szlibdll.dll
hdf5_hl_f90cstubdll.dll libgcc_s_dw2-1.dll libpangowin32-1.0-0.dll vrf.dll
hdf5_hl_fortrandll.dll libgdk_pixbuf-2.0-0.dll libpng12-0.dll zlib.dll
hdf5_hldll.dll libgdkglext-win32-1.0-0.dll libpq.dll zlib_ogdi32.dll
hdf5dll.dll libgdk-win32-2.0-0.dll libquadmath-0.dll zlib1.dll
In order to include these DLLs with the toolbar installation and have them deployed to the right
location, it was necessary to add them directly into the DRDC_RADARSAT project in the Visual Studio solution explorer.
3.5 DRDC-GDAL
DRDC-GDAL is a modified version of GDAL that provides advanced support for RADARSAT-2 data that is not available in the publicly accessible version. For example, this includes support for opening RADARSAT-2 images in National Imagery Transmission Format (*.ntf). DRDC-GDAL is a C++ library and is not directly usable by the toolbar. Further information on the .NET-compatible wrapper that was developed to resolve this is given in 3.7.
RADARSAT Toolbar
For ArcMap 10.3.1 User Manual ______________________________________________________________________________
_________________________________________________________________________________________________________Document version: 2.1 11 Dated: July, 2018
3.6 SWIG
SWIG is the software tool that is used to build a managed wrapper around the unmanaged DRDC-GDAL in order to use it in the RADARSAT Toolbar. It is included with the RADARSAT Toolbar codebase in order to make the wrapper build process convenient. It is not a direct dependency of the RADARSAT Toolbar.
3.7 DRDC-GDAL WRAPPER
The batch file {path}\engine2\ThirdParty\GDAL_DRDC\build_gdal_csharp.bat is used to build a C# wrapper around the DRDC-GDAL C++ code. (This wrapper allows DRDC-GDAL functions to be called from the RADARSAT Toolbar.) Further details and execution instructions are given in the batch file itself.
During the incorporation of DRDC-GDAL into the build, effort was made to not alter the provided code permanently. The files nmake.opt and AssemblyInfo.cs had to be modified in order to make the build successful. The modified files are stored separately from the original ones. During the batch file execution, the script replaces the original files with the modified ones, and restores the originals after the build completes.
Due to the use of .NET Framework 4.0, this script must be run with the Visual Studio 2008 compiler (see 3.3 for further information). Thus, the pre-built DLL wrapper files for DRDC-GDAL are provided with the RADARSAT Toolbar codebase, in case the required compiler is not available. The files that are required by the toolbar are the *.dll files in {path}\engine2\ThirdParty\GDAL_DRDC\gdal\swig\csharp.
3.8 MATH.NET NUMERICS LIBRARY
The Math.NET numerics library is used to replace some calculations that are provided by the numpy Python library in IA Pro. Specifically, these are the interpolation functions that are used to calculate Doppler centroid estimates during oversampling. This library is provided in compiled form.
3.9 VEGETATION ROUGHNESS EDITOR
The main solution file for the RADARSAT Toolbar, {path}\engine2\DRDC_RADARSAT_VS2012\ DRDC_RADARSAT2.sln, contains the VegetationRoughnessEditor project. When the main solution is built, the VegetationRoughnessEditor project will be built. Open this file in Visual Studio Professional 2012 and select Build Solution from the BUILD menu in order to build this project.
RADARSAT Toolbar
For ArcMap 10.3.1 User Manual ______________________________________________________________________________
_________________________________________________________________________________________________________Document version: 2.1 12 Dated: July, 2018
3.10 SOIL EFFECTS EDITOR
The main solution file for the RADARSAT Toolbar, {path}\engine2\DRDC_RADARSAT_VS2012\ DRDC_RADARSAT2.sln, contains the SoilEffectsEditor project. When the main solution is built, the SoilEffectsEditor project will be built. Open this file in Visual Studio Professional 2012 and select Build Solution from the BUILD menu in order to build this project.
3.11 TOOLBAR UTILITIES
The toolbar utilities library contains classes and functions that may be of general use to all the projects in the RADARSAT Toolbar solution. For example, the folder selection dialog is stored here. This project is built automatically as part of the RADARSAT Toolbar build process.
3.12 CCM GENERATOR
The main solution file for the RADARSAT Toolbar, {path}\engine2\DRDC_RADARSAT_VS2012\ DRDC_RADARSAT2.sln, contains the CCMGenerator project. When the main solution is built, the CCMGenerator project will be built. Open this file in Visual Studio Professional 2012 and select Build Solution from the BUILD menu in order to build this project.
3.13 MATHUTILS
The Math utilities library contains classes and functions that may be of general use to all the projects in the RADARSAT Toolbar solution. The library contains Convertion, Numpy, JSON, Logging classes. This project is built automatically as part of the RADARSAT Toolbar build process.
3.14 POINT TARGET ANALYSIS
This C/C++ library contains static functions to calculate a PTA statistic. This project is built automatically as part of the RADARSAT Toolbar build process.
3.15 POINT TARGET ANALYSIS WRAPPER
The C# library contains classes to interface with the Point Target Analysis for an easier integration between C and C#. This project is built automatically as part of the RADARSAT Toolbar build process.
3.16 DISTRIBUTED TARGET ANALYSIS
The C# library contains classes to calculate Distributed Target. This project is built automatically as part of the RADARSAT Toolbar build process.
RADARSAT Toolbar
For ArcMap 10.3.1 User Manual ______________________________________________________________________________
_________________________________________________________________________________________________________Document version: 2.1 13 Dated: July, 2018
3.17 CANNY EDGE DETECTOR
The C/C++ library contains classes to calculate Canny Edge Detector. This project is built automatically as part of the RADARSAT Toolbar build process. The Canny edge detector is an edge detection operator that uses a multi-stage algorithm to detect a wide range of edges in images.
3.18 RADARSAT TOOLBAR
The main solution file for the RADARSAT Toolbar is {path}\engine2\DRDC_RADARSAT_VS2012\ DRDC_RADARSAT2.sln. Open this file in Visual Studio Professional 2012 and select Build Solution from the BUILD menu in order to build the project. To build a version for debugging, select Debug in the drop-down list on the Visual Studio toolbar before building. To build a version to deploy on end-user computers, select Release in the drop-down list on the Visual Studio toolbar before building.
RADARSAT Toolbar
For ArcMap 10.3.1 User Manual ______________________________________________________________________________
_________________________________________________________________________________________________________Document version: 2.1 14 Dated: July, 2018
4 DEPLOYMENT
4.1 FILES REQUIRED FOR INSTALLATION
A distribution package (DRDC_RADARSAT2_{%version%}.ersiAddIn) contains all files required for the successful installation of the RADARSAT Toolbar including a set of dynamic link libraries (*.dll files). A complete list of the *.dll files required by the toolbar is contained in Table 5.
The version is based from the “Config.esriaddinx” file and xml elements: <Version>2.0.4.0</Version> <Date>2017-11-01</Date>
It must be changed in the file “AssemblyInfo.cs” as well:
[assembly: AssemblyVersion("2.0.4.0")] [assembly: AssemblyFileVersion("2.0.4.0")]
Both version must match when before building the Release project. The file will be generated at this location:
{path}\engines2\DRDC_RADARSAT_VS2012\DRDC_RADARSAT\bin\x86\Release The file DRDC_RADARSAT2.esriAddIn must be copied to another location and rename according to the version: DRDC_RADARSAT2.esriAddIn -> DRDC_RADARSAT2_0.4.0.esriAddIn
4.2 INSTALLATION PROCEDURE
Please see system's user manual (RADARSAT Toolbar - User Guide v2.0.docx) for documentation on the installation procedure section 1.4.
4.3 LOCATION OF FILES ON TARGET COMPUTER
The RADARSAT Toolbar is installed to the user’s application data folder; for example, C:\Users\username\AppData\Local\ESRI\Desktop10.3\AssemblyCache\{084e834a-8b5e-41cf-ae69-faf1ba927074}\AssemblyCache is a hidden folder. The toolbar files are stored in a subfolder of AssemblyCache which is named according to a globally unique identifier set in the RADARSAT Toolbar solution. The toolbar settings are contained in C:\Users\username\AppData\Local\ESRI, in a subfolder that is assigned by ArcGIS. An example is C:\Users\username\AppData\Local\ESRI\DefaultDomain_Path_2hksewzu0wozlg1j4vbgrhhemzf2d30x\10.3.1.4959\user.config.
RADARSAT Toolbar
For ArcMap 10.3.1 User Manual ______________________________________________________________________________
_________________________________________________________________________________________________________Document version: 2.1 15 Dated: July, 2018
5 SOURCE CODE DETAILS
The following is a brief summary of the projects contained in the DRDC_RADARSAT solution:
Notice there are 3 projects that must be associated to Visual Studio 2010 in order to build C/C++ DLL properly.
This document will not describe one by one all classes. Please refer to the source code it-self. There will be a summary tag “// summary:” at the top that will describe the purpose of the class.
The DRDC_RADARSAT2 Project contains all tasks and each task belong to its folder. Example, the Canny Edge Detector task can be found under “Toolbar\Radarsat\CannyEdgeDector” and any related classes and functionalities will be found there. Each task is a button in the toolbar.
RADARSAT Toolbar
For ArcMap 10.3.1 User Manual ______________________________________________________________________________
_________________________________________________________________________________________________________Document version: 2.1 16 Dated: July, 2018
RADARSAT Toolbar
For ArcMap 10.3.1 User Manual ______________________________________________________________________________
_________________________________________________________________________________________________________Document version: 2.1 17 Dated: July, 2018
6 RADARSAT TOOLBAR STEPS AFTER LAUNCHING
The following are the steps done by the Radarsat Toolbar just before the whole functionality gets available:
6.1 RADARSAT TOOLBAR PROJECT “BASEEXT.CS” CLASS:
6.1.1 GDAL
Check if the GDAL libraries are available. If one of them throws an exception, a flag is kept and none of the toolbar buttons will be available to the user.
6.1.2 Dynamic DLL Loading
For an unknown reason, 2 important DLL “libfftw3-3.dll and ManagedOversampler.dll” file need to be load in memory right away. If an old toolbar is active, the system will pick up the one loaded in memory first causing all kind of errors.
6.1.3 Log files
This step makes sure that any log files gets deleted after one week.
6.1.4 DeleteFilesOnNextStartup.ini
This file contains all temporary files that gets generated by the Toolbar when executing processes. This step will open the INI file and delete any files that are present, then rewrite the INI file without those files deleted. If files are locked, there are remaining in the INI file for the next time.
Why this mechanism? Any files (layer) present in the ToC do not get “unlock” even after the layer is removed from ArcMap.
RADARSAT Toolbar
For ArcMap 10.3.1 User Manual ______________________________________________________________________________
_________________________________________________________________________________________________________Document version: 2.1 18 Dated: July, 2018
7 RADARSAT TOOLBAR WINDOWS
7.1 WINDOWS
When Model Dialogs are used throughout the user to force the user to do immediate actions.
7.2 PANELS
ArcMap supports panels which are floating/dockable windows. Panels are used throughout the system when interaction is required with the map. ArcMap remembers all panels position and will be reopened in the next startup. Just in case, there are 2 monitors and one is not connected, the method “UIArcMap.PositioDockableWindown” will determine to position the panel in the main monitor.
RADARSAT Toolbar
For ArcMap 10.3.1 User Manual ______________________________________________________________________________
_________________________________________________________________________________________________________Document version: 2.1 19 Dated: July, 2018
8 FUTURE DEVELOPMENT
The following sections include detail on known issues and suggestions for future development.
8.1 KNOWN ISSUES
8.1.1 Remove Edge Effect from Oversampled Layers
The oversampling routine creates a one pixel wide bright or dark edge on the far-right column and bottom row of the oversampled image. The ArcMap toolbar is using IA Pro's software for the oversampling routine so this effect occurs in both IAPro and ArcMap. If IA Pro is modified to correct this problem, then the new IA Pro code can be integrated into the ArcMap toolbar. One possible solution proposed by DRDC is to oversample a slightly larger area than what is viewed, and trim the edge effect before displaying the oversampled image to the user.
8.1.2 Test Bad Orthorectification Results
DRDC has provided screenshots (Figure 2 and Figure 3) of bad orthorectification results in IA Pro of a fine quad-polarization dataset. Similar results have not been seen from the RADARSAT Toolbar. This image can be run through the toolbar’s orthorectification routine to determine if the problem also exists there.
RADARSAT Toolbar
For ArcMap 10.3.1 User Manual ______________________________________________________________________________
_________________________________________________________________________________________________________Document version: 2.1 20 Dated: July, 2018
Figure 2. Bad orthorectification result #1
RADARSAT Toolbar
For ArcMap 10.3.1 User Manual ______________________________________________________________________________
_________________________________________________________________________________________________________Document version: 2.1 21 Dated: July, 2018
Figure 3. Bad orthorectification result #2
8.1.3 Test Black Orthorectification Results
DRDC has reported that a couple of images produce images that have all pixel values set to zero. A procedure to reproduce the issue has been given as follows.
1. Import the 17-5-2014 FQ28 and the MF4 images from the Orland Main Air Station directory (both are SLC).
2. Turn the Image Information tool off and on (this probably isn’t important but just in case …).
3. Orthorectify the HH channel of the FQ28 image and the HH channel of the MF4 image using the file n63.dt2 in the Norway\E009 directory.
4. The orthorectified HH FQ28 image will be black/have no values.
8.2 SUGGESTIONS FOR FUTURE WORK
8.2.1 Implement Tools and Procedures for Ongoing Software Support
With the release of version 2.0.1 of the RADARSAT Toolbar, the software has now moved into a phase where it can have regular users while further development is ongoing. In this situation,
RADARSAT Toolbar
For ArcMap 10.3.1 User Manual ______________________________________________________________________________
_________________________________________________________________________________________________________Document version: 2.1 22 Dated: July, 2018
ensuring the integrity of current functionality becomes more important as changes are made. MGIS recommends that certain quality assurance tools and practices be put into place to support future work. These tools and practices include the following, listed in decreasing order of importance.
1. Establishing an issue tracking database using a tool such as Redmine (www.redmine.org).
2. Creation of unit tests to ensure correctness at a function level. 3. Implementation of automated unit testing (on source control commit) using a
continuous integration system. 4. Integration of static analysis tools such as FxCop (https://msdn.microsoft.com/en-
us/library/bb429476(v=vs.80).aspx) to help ensure code quality.
RADARSAT Toolbar
For ArcMap 10.3.1 User Manual ______________________________________________________________________________
LAST PAGE OF DOCUMENT
DOCUMENT CONTROL DATA *Security markings for the title, authors, abstract and keywords must be entered when the document is sensitive
1. ORIGINATOR (Name and address of the organization preparing the document.A DRDC Centre sponsoring a contractor's report, or tasking agency, is entered in Section 8.)
MGIS Inc.2017A Carp Road, Stittsville ON K0A 1L0
2a. SECURITY MARKING (Overall security marking of the document including special supplemental markings if applicable.)
CAN UNCLASSIFIED
2b. CONTROLLED GOODS
NON-CONTROLLED GOODS DMC A
3. TITLE (The document title and sub-title as indicated on the title page.)
RADARSAT Toolbar for ArcMap 10.3.1 Technical Manual
4. AUTHORS (Last name, followed by initials – ranks, titles, etc., not to be used)
Carron, R.
5. DATE OF PUBLICATION (Month and year of publication of document.)
March 2018
6a. NO. OF PAGES (Total pages, including Annexes, excluding DCD, covering and verso pages.)
29
6b. NO. OF REFS (Total references cited.)
0 7. DOCUMENT CATEGORY (e.g., Scientific Report, Contract Report, Scientific Letter.)
Contract Report
8. SPONSORING CENTRE (The name and address of the department project office or laboratory sponsoring the research and development.)
DRDC - Ottawa Research CentreDefence Research and Development Canada3701 Carling AvenueOttawa, Ontario K1A 0Z4Canada
9a. PROJECT OR GRANT NO. (If appropriate, the applicable research and development project or grant number under which the document was written. Please specify whether project or grant.)
9b. CONTRACT NO. (If appropriate, the applicable number under which the document was written.)
10a. DRDC PUBLICATION NUMBER (The official document number by which the document is identified by the originating activity. This number must be unique to this document.)
DRDC-RDDC-2018-C146
10b. OTHER DOCUMENT NO(s). (Any other numbers which may be assigned this document either by the originator or by the sponsor.)
11a. FUTURE DISTRIBUTION WITHIN CANADA (Approval for further dissemination of the document. Security classification must also be considered.)
Public release
11b. FUTURE DISTRIBUTION OUTSIDE CANADA (Approval for further dissemination of the document. Security classification must also be considered.)