MEGASITE MANAGEMENT TOOL ( MMT ) : A DECISION SUPPORT SYSTEM BUILT USING MAPWINDOW ACTIVEX CONTROL

Megasite Management Tool (MMT) is planning and evaluation software for contaminated sites. Using different statistical modules, MMT produces maps which help decision makers in rehabilitating contaminated sites. The input data used by MMT is of geographic nature and exists as shapefile and raster format. As MMT is built using simple windows forms application, the objective of the study was to find a way to visualize geographic data and to allow the user to edit its attribute information. Therefore, the application requirement was to find GIS libraries which offer capabilities such as (1) map viewer with navigation tools (2) library to read/write geographic data and (3) software which allows free distribution of the developed components. A research on these requirements led to the discovery of MapWindow ActiveX components which not only offered these capabilities but also provided free and open source licensing options for redistribution. Although considerable amount of reports and publications exist on MMT, the major contribution provided by MapWindow libraries have been under played. The current study emphasises upon the contribution and advantages MapWindow ActiveX provides for incorporating GIS functionality to an already existing application. Similar components for other languages have also been reviewed.


INTRODUCTION
Degradation of land is caused by natural phenomenon and through human activity (Gabriels and Cornelis).The rapid industrialization that has taken place since the last two and half centuries has not only improved quality of life but also has contributed in degrading the environment resources (Saouma, 1972).Added to this the technological advancements that have taken place in the military sector has led to land degradation on a much larger scale.A former military base near Potsdam situated in Berlin, Germany serves as an example where both soil and groundwater were contaminated due to military activity and which stays abandoned since 1991.Abandonment of sites such as these prevents the development of surrounding areas.Hence, in order to sustainably rehabilitate such degraded sites a Megasite Management Tool (MMT, 2011) was developed by researchers from D-SITE team.The tool supports the decision making process by simplifying the redevelopment of such sites using different methods and modules namely: 1. Risk assessment and prevention 2. Sustainability assessment 3. Site preparation and Clean-up costs 4. Market value evaluation For assessing these parameters, the application requires different land-use scenarios and layouts where all the individual units should sum up to 100% (e.g.30% residential area, 45% commercial land, 25% green fields).The assessment is based on the preparation of these scenarios and layouts, and the site specific data such as knowledge and information about the site.
Formerly, data for preparing scenarios and layouts was done using ArcGIS desktop or using QGIS open source software.Post the identification of the tool it is being done using the tool developed using MapWindow ActiveX Components.

OBJECTIVE
There are several planning and evaluation steps in assessing the parameters mentioned in Section 1. From GIS based data preparation to visualization of results, there are many modules in-between which needed visualization and display of attributes of geographic data.Further this data also required attribute editing capabilities for creating different scenarios and layouts.The results produced from this data also required a medium for visualization.Basically vector data exists in ESRI's Shapefile format and raster data in ASCII format.The scale to which the application needed GIS capabilities was very important and the mode of distribution of the developed software to stakeholders should be independent of any licensing cost.Therefore, the major objective of the study was to find 5.A free and open source software that would help in achieving capabilities such as viewing, navigating and editing the geographic data 6.A software that could be integrated into their current MMT project that was built using VB6 and 7. Free and open source software that could be distributed to the stakeholders and to others who are in need of the application.

A REVIEW OF OPEN SOURCE APPLICATION PROGRAMMING INTERFACE PROVIDERS (API) FOR DEVELOPING AND INTEGRATING GIS APPLICATIONS
Based upon the requirements of the project, a detailed search was carried out to check for the availability of application that would help in managing and achieving the objectives.An initial search led us to softwares such as QGIS, gvSig, OpenJump, UDIG and MapWindow.All of these are free and open source GIS software's.The API's of these software's provide for building plug-ins which run only when the software of the concerned application is installed.A further search has revealed some applications which provide capabilities for building custom GIS application from ground up.Out of all the desktop application that were researched, the author could find three software that provided the capabilities needed for the current application.These are: A. Geotools B. QGIS C. MapWindow ActiveX Components

Geotools:
It is a cross-platform free and open source Java based geospatial library for building full fledge GIS application from ground up.
Example of an application built using this library is User-friendly Desktop Internet GIS (UDIG, n.d.).This software was built using API's and components of GeoTools along with libraries from JTS Topology Suite.Eclipse, provides an Integrated Development Environment (IDE) for developing application using these libraries.

QGIS:
QGIS is a cross-platform free and open source desktop GIS application developed using C++ which extensively makes use of the Qt libraries.QGIS application provides API's for developing standalone applications through PyQt, Qt and python.Similar to eclipse, Qt Creator provides an IDE though which development of application is made easier.

MapWindow ActiveX Components (MapWinGIS):
MapWindow is a Windows based free and open source desktop GIS software.MapWinGIS is an ActiveX control namely MapWinGIS.ocxwhich forms the core of MapWindow application.It has built in support for many vector and raster formats though which standalone application could be developed using Windows Forms (Mohammed, 2009).Standalone applications could be developed using the three languages All the three softwares mentioned above provide API's and components for developing standalone applications and allow for viewing, navigating and editing geographic data.Additionally the developed custom application could further be integrated into other applications that require GIS functionality.Section III A, Section III B and Section III C are examples of open source GIS software's where standalone applications could be developed using these language specific API's and their components.All of the three software's allow for integrating map viewer with zoom in, zoom out, pan, zoom to extent, identity, add new layer, display attribute table and many more functionalities.Further, a simple application built using these libraries can be extended to have functionalities such as a full fledge GIS desktop system similar to UDIG, QGIS or MapWindow.

Why MapWinGIS?
Prior to the development of modules mentioned in Section I, the requirement of finding a standalone GIS provider was imperative.Based on the objectives and requirements a thorough review was done on API providers which offer integration of GIS functionalities.The development of MMT was initiated in 2006 and used VB6 as programming language.As the early development of MapWindow was based on VB6, ActiveX components of this software were well established in this language.Since MMT also used VB6 as programming language, the Activex components of MapWindow for VB6 proved to be the perfect choice for extending MMT with GIS functionality.

APPLICATION DEVELOPMENT AND INTEGRATION
Management Tool (MMT) is a windows based desktop application developed using VB6.The GIS capabilities for this software were provided and extended using MapWinGIS ActiveX components.Figure 1 1(2) shows the Navigation Tools displayed as buttons at the upper left corner.The box selection button (fourth button from left) of the Navigation Tools also acts as an identity tool.This button allows for identifying the attributes of the polygons when a click even on the map is performed.The identify tool is programmed to have several options for polygon selection like required by the current application.Figure 2 shows several different possibilities on polygon selection from single selection to multiple, switching the selection for already selected polygons or de-selecting already selected polygons.Several of these selected options have been provided to the user to change land use category values for the selected polygons.Additionally these selection options have been extended further to reflect upon the Attribute  4)) applies the changes to the shapefile.By doing so, the new land use type is updated to the selected row/rows of the Attribute table and the predefined color schema is dynamically updated for the corresponding.This action also updates the Distinct Attributes section.The Distinct Attributes section not only shows unique attributes but also highlights corresponding land use attributes and polygons when clicked on any of the unique attributes.Shapefile Editing Buttons in Figure 1(4) are used to backup shapefile to a predefined location before edited and to revert back the changes if the user is unsatisfied.Layer Display shown in Figure 1(5) displays number of layers loaded into the Map Viewer component.Finally Statistics section in Figure 1(8) displays dynamic statistics for land use layers with respect to layouts and scenarios.
The whole project was built on a separate windows forms application which was later integrated into MMT by making the necessary changes at code level.Figure 2 shows the final integration of the MapWindow application to MMT.Apart from map and attribute display, most of the modules implemented in MMT require raster processing.This is handled by MMT in a simple way.It involves converting the shapefile to ASCII based on a specified resolution.ASCII is a format which is human readable and supported by many GIS software's.Since ASCII is a plain text format which can be opened by any text editor, reading/editing this format through simple input/output objects of a software language is very easy.The format contains header information which determines spatial extent of the data.
The values that come after the header information display integer or floating values.These values could be manipulated at pixel level by reading them into a two dimensional Matrix objects of a software language.Conversion of a shapefile to ASCII and processing this ASCII file for implementing mathematical expressions on different module of MMT is what makes this simple application independent from any licensed based API's for reading raster data.
Although MapWindow does have provision to display all the required layers with symbology, it lacks the ability to produce a map for printing.Therefore, to provide this capability, MMT makes use of mapfile which is a configuration file for the MapServer.Parameters such as area of the map, path to the data, symbology, legend and path to the output file are defined in a mapfile.This file has a .mapextension which can be read by a MapServer to produce a map like desired.Since MMT needs to be distributed to the client, installation of both MMT and MapServer does not offer an easy solution.Therefore, to overcome the installation of MapServer, "shp2img.exe"file was used.This executable file creates a map image from a mapfile without having to install MapServer."ShellExecute" object of VB6 could be used to run this executable file.This way all of the executables could be included into one project for distribution to the end user as a setup file.

RESULTS AND DISCUSSION
Different modules in MMT produce different results for evaluating contaminated land.One such module that is used for identifying areas with high level of contamination is called Conflict Analysis.The risk maps produced in this analysis is taken as input for estimating the second module called Remediation Costs.The third module Market Value estimation is dependent on the remediation and site preparation costs.These costs are further subtracted from the market value itself for estimations.Based on the results obtained from all the three modules, suitable values for sustainability for land use development is calculated (Schädler et al, 2012) (Maximilian et al, 2012).The modules mentioned above are interdependent on each other.At the initial stage the creation of land use maps with different scenarios and layouts for the defined land use categories is required.This functionality has been made possible using MapWindow ActiveX components.Like mentioned in the above sections, these components add capabilities such as visualization and editing of geographic data.MapWindow ActiveX in this regard provided the perfect components for developing these major capabilities required by the project.A detailed document of case study results for the different modules on MMT could be found in "Report of demonstration case studies" referenced at (Morio et al, 2014).A further explanation of the software processes of MMT is defined in "MMT --Megasite Management Toolsuite User's Guide" referenced at Maximilian et al, 2012.Considerable amount of reports and publications exist on MMT but none highlight upon the simple yet ingenious GIS capabilities provided by the open source MapWindow ActiveX components.The current paper highlights upon these very basic capabilities required by any GIS application and helps other organizations to identify solutions for their problem that are similar to these kind of projects.In the current context, MapWindow has provided the components for developing the required GIS capabilities, integration of these capabilities into MMT and provided free licensing for distribution of developed and integrated components.
Realization of MMT software was solely possible due to the components provided by MapWindow software.Without these components, the land use map would have to be created using ArcGIS or QGIS or any other GIS software.Having to prepare data on other GIS software's would complicate the use of MMT for the end user.Thanks to MapWindow ActiveX components, MMT software works without having to depend on other GIS software's and allowing for redistribution of the software for free without any licensing issues.

Shortcomings and Recommendations
MMT uses VB6 as programming language for its development.
For many reasons stated by Microsoft, the language has been abandoned long ago.Microsoft's .NET which has come as a replacement framework for VB6 advanced rapidly with support for many programming languages such as VB.NET, C# and Visual C++.MapWindow has long ago upgraded its software to .NET framework and till date has grown to incorporate many more functionalities utilizing the great features provided by Microsoft.The latest ActiveX components of MapWindow provide libraries that could be consumed in VB.NET or C#.Since modules on MMT uses simple calculation procedures build using windows forms application and VB6, the conversion to .NET framework could be achieved though little effort.Therefore, a migration of MMT to .NET framework is required by the system.Further, the system needs an upgrade to the standards that are followed at corporate level.An industry proven architecture model such as multi-tier can be adopted for programming the application.The architecture is one among the best practices followed by many private organizations and forms one of the widely used models across industries.This kind of practice standardizes the code and helps newcomers to easily understand and follow these standards.

CONCLUSIONS
MMT was developed to assist decision makers in evaluating the reusability of contaminated land through proper planning and evaluation methodologies.MapWindow ActiveX components in this context has provided an open source framework for developing the GIS functionality required by the project and also provided redistribution of this software freely to the stakeholders.Various capabilities such as a map viewer and navigation tools have been developed for visualization and navigation purpose.Further components such as attribute table, legend and statistics have been incorporated using Visual Studio for VB6 with MapWindow libraries.The functionalities that have been integrated into MMS not only help facilitate visualization and editing of information but also provide valuable results analysed through the different module existing on MMT.Thus, realization of MMT software through MapWindow ActiveX components has provided many advantages like explained in this study.

Figure 2 :
Figure 2 : Final integration of MapWinGIS application into MMT

Figure 1 :
Figure 1 : Standalone application developed uising MapWinGIS and VB6 for integration into MMS displays a snapshot of the developed application which was later integrated to MMT.Visual Studio 6 for VB6 was used as the Integrated Development Environment (IDE) for developing the application.MapWindow ActiveX control provides a set of components that can be added to the visual sutdio toolbox.These components can then be added to windows forms application for building GIS applications or to integrate GIS functionality to already existing application.For assessing the parameters mentioned in Section 1, MMT requires provision to change land use categories of the shapefile attributes for producing different scenarios and layouts.The first step in achieving this was to create a Map Window to visualize the existing layer in shapefile format and to have access to the attribute table.The ActiveX of MapWindow provides a map component which can be added to a new windows forms application.The map component has provision to read various vector and raster formats, and provides libraries for categorizing the layer schematically with different colours and patterns.Figure1(1) shows the developed standalone application.Map Viewer (Map Window) is placed in the middle for visualizing shapefile layer with color schema (based on the land use category codes).A set of Navigation Tools such as zoom in, zoom out, pan, zoom to extent and box selection are provided for the Map Window component which allow for the visualization of GIS data.Figure Table where the records/rows of the attribute table are highlighted corresponding to the selected polygons and vice versa.The Attribute Table shown in Figure1(3) displays details of shapefile attributes with columns such as Nutzung (land use Category section shown in Figure1(7) changes existing land use category or it could be used to add a new land use category for the selected polygons.The dropdown of Change Category contains predefined land use categories.To change or add new category, a row or group of rows in the Attribute table are selected (which also selects the corresponding polygons) and then the desired category from the dropdown is selected.Clicking on the Save Changes button (shown in Shapefile Editing Buttons section of Figure1( categories), Kategorie (land use code) and Area.This table shows and highlights attributes of the shapefile corresponding to selection.The column Nutzung in the Attribute Table displays land used categories.Unique values of this category are loaded into the Distinct Attribute section shown in Figure 1(6).Change