Вы находитесь на странице: 1из 8

MapWindow GIS Overview

Introduction
MapWindow is a "Programmable Geographic Information System" that supports manipulation,
analysis, and viewing of geospatial data and associated attribute data in several standard GIS
data formats. Developed by a team of programmers, engineers, and scientists at Utah State
University, MapWindow is a mapping tool, a GIS modeling system, and a GIS application
programming interface (API) all in one convenient redistributable package. MapWindow was
developed to address the need for a GIS programming tool that could be used in engineering
research and project software, without requiring end users to purchase a complete GIS system or
become GIS experts.

For example, a researcher or company may want to deploy a tool that lets users build and interact
with maps of GPS data overlaid on USGS quad maps. One approach is to build the tool as an
extension to a popular GIS software and then require users to purchase that software to run the
extension. Alternatively, the company could use MapWindow as a platform and build a
specialized application that does the needed function and then give it directly to end users with
no need for third party software purchases.

The MapWindow Application


The MapWindow application is a ready-to-use spatial data viewer, and a tool that can be
modified into a new custom application. Customization is done by editing the MapWindow
configuration file, and/or a MapWindow project file. These are the two files that control the look
and feel of MapWindow. Both are XML-format files that can be edited directly through notepad
or an XML editor.

The basic MapWindow graphical user interface (GUI) looks like this:
By default, the layout includes a map area (white box at the right), a legend pane, and a preview-
map pane. Additionally, built-in toolbar buttons allow you to create, save and open MapWindow
project files (collections of data layers), print, and navigate around the map. Navigation tools
include pan, zoom-in, zoom-out, zoom-to-selected-layer, zoom-to-selected-shapes, zoom-to-full-
extents, etc. A tool bar button for adding and removing data layers from the map, as well as a
"selection" tool, are also included in the default layout. The MapWindow GUI also includes
dockable windows and editable menus.

MapWindow Plug-ins
MapWindow has an extensible architecture that allows for plug-ins to add functionality using
Visual Basic .NET or C#. Plug-ins included with the base MapWindow installation include:

• Shapefile Editor - For editing shape file geometry


• Grid Wizard - For importing and converting different grid data formats
• Attribute Table Editor - For viewing and editing shapefile attribute table data
• Feature Identifier and Labeler - For identifying features and adding labels

In addition to these, a variety of plug-ins have been developed or are currently under
development at USU for specific hydrologic and environmental modeling applications such as
watershed delineation, analysis of instream flows and fish habitat, development of Watershed
Information Systems, development of analysis modeling systems and decision support systems,
as well as other custom data analysis.

There are many cases where it may be useful for users to write their own plug-ins. For example,
users may want to write a plug-in to:

• Plot housing density by housing type based on a click on a particular neighborhood


• Re-project data from one projection to another
• Calculate the total upstream length of a stream network based on a selected stream
• Simulate a battlefield with tanks, obstacles and other interactive elements
• Launch a web-browser with the company web site for each of the businesses in a town
based on a selection of a building on a map
• Compute and display land cover distribution within a selected region

A standard plug-in interface has been developed for users to create their own plug-ins for
MapWindow, and this interface enables the seamless integration of these plug-ins with the
MapWindow application. Custom plug-ins can be packaged with the MapWindow application
and datasets in a software installation to provide users with custom GIS functionality and data
analysis.

The MapWindow ActiveX Control


The MapWindow application is based on a core GIS component that is the ActiveX control,
"MapWinGIS.ocx". This is a programming object that can be added to a form in Visual Basic or
other languages that support ActiveX, providing a built-in GIS data map. It has been optimized
for use as a fully functional model interface, not just as a map viewer. This optimization
involved speeding up image and grid display, limiting the amount of redrawing that the user
sees, and including application programmer interfaces (APIs) for low-level access to grid, shape,
table and image data.

The MapWinGIS.ocx ActiveX control can be used by programmers wherever a GIS map or low
level access to spatial datasets is needed within a custom application. For example, a
programmer can add the core MapWindow component to a form where spatial data is displayed
according to input from the user. An example of this is shown below – the map responds to
changes in inputs supplied by the user.

Another use of the MapWinGIS.ocx ActiveX control is providing low level access to spatial
datasets for modeling purposes. For example, the ActiveX control can be used to open spatial
datasets such as grids in code and then the programmer can manipulate the values within the grid
or create a new grid based on the old grid (i.e., create a slope grid based on an elevation grid).

Three Ways to Develop GIS-Enabled Software Using MapWindow


Although many users may wish to simply use the MapWindow application as a desktop spatial
data viewer or for developing tools and functions for individual use, MapWindow can also be
used to build and deploy original GIS-enabled software applications.

MapWindow provides three basic ways to build and deploy a custom GIS application:

1. Use the core GIS ActiveX component in your own programming language and build an
application from scratch. This would be particularly useful in cases where you have no
need for the full legend or layer management, or you do not want to support plug-ins in
your application.
For example, a State Quarters Map Viewer could be built that uses a hard-coded shapefile
of the United States, and allows users to click on a state and find out all kinds of useful
information about the state, and to look at an image of the State Quarter. A drop-down
list of the years that quarters are release could be somewhere on the form with the map,
and when a user selects a date from the list, all of the states with quarters released that
year are highlighted. Once the software is built, the developer just needs to build an
install package that includes the MapWinGIS.ocx ActiveX component and the needed
GIS data layers.

2. Use the MapWindow application, but edit the configuration file and project file to deploy
a basic GIS data viewer - no programming required. This is the right approach when you
have data layers you want someone to look at, with no particular additional functionality.

For example, you may have several GIS data layers that resulted from an engineering
contract project, and you want to deliver them to your client along with the report. To do
this, you would edit the configuration file to change the title bar, icon, splash screen and
about-box information. Then you edit the project file to include the list of data you want
to be visible along with your chosen color schemes, etc. Finally you burn it all to a CD
with the installation for the MapWindow application and glue it in the back of your
project report.

3. Do #2, but include some pre-built plug-ins to enhance your application. This approach
could be used to deliver a streamflow data analyst, a spatially-referenced photo viewer, or
some other application that could be built by bringing together MapWindow, data, and
existing plug-ins.

Creating Custom GIS Applications Using the MapWindow Application


Custom GIS applications can be created and distributed using MapWindow through the use of
Plug-ins and customizable project and configuration files. The following is an example of an
application designed to distribute spatial data layers for a watershed along with streamflow and
water quality datasets that are linked to the map via a custom plug-in. When a user clicks on a
streamflow gage or a water quality station on the map, the Time Series Analyst plug-in launches
with the time series data for the selected streamflow gage or water quality station.
The MapWindow project and configuration files allow users to build and deploy custom GIS
data visualization tools like the above example without doing any programming. The
MapWindow project file allows users to specify which data layers to load for a particular project,
and it stores the names, file paths, and legend coloring schemes of all data layers. The
MapWindow configuration file contains all of the basic information that defines the look and feel
of the MapWindow GUI, including: the title bar caption, the title bar icon, the splash screen
image, the about-box information, plug-in specific information, the initial layout of the window
panes, custom help file, etc.

Creating Custom GIS Applications Using the MapWindow ActiveX Control


The core MapWindow component is a programming object that can be added to a form in Visual
Basic or other languages that support ActiveX, providing a built-in GIS data map. It can be used
as a map viewer or in modeling applications or wherever low-level access to grid, shape, table,
and image data is needed. Here is an example in Visual Basic 6 of a very simple MapWindow
project that can be built:
The code that adds this shape file to the map is:

With a shape file layer loaded in the map, the user can navigate the map using the left and right
mouse buttons to zoom-in and zoom-out. The MapWindow core component can be more
interesting when you add a few layers of data to it and provide other means for navigation. For
example, with just a few lines of code, the project above can be extended to display this:
The code for the above applicaton is:

These are very basic demonstrations, but they demonstrate some of what the control can do and
how it can be used. Additional functions of the core component ActiveX control include:

• Open, create, edit, and save geo-referenced image, grid, shapefile, and dbf (shape
attribute) data directly
• View, label, color, highlight, shape file data in the map
• Perform spatial queries on the data
• Search for features with specific attributes
• Dynamically edit the spatial data and immediately see the changes in the map
• Interact with the data through the map
• Build TINs from Grids, Images from Grids, Shape files from TINs and Grids, Grids from
Shape files, etc.
• Much, much, more...

Вам также может понравиться