David Engen
Throughout the local press are articles about how
the Internet has taken the world by storm. Today most of the
information found on the Web is in the form of static textual
information and images hyper-linked together. One of the advantages
of the Web is the common User Interface that can be found on all
major computing platforms through the use of a Web Browser. As
the Web matures people want more sophistication by creating applications
based on the Web paradigm. Sun's Java Language has been touted
as the Internet programming language that can be used to develop
the next generation of Internet aware applications. Last year
at Esri's 16th Users Conference, MapObjects was released
to provide an excellent tool to create GIS applications. To provide
the next generation of spatial applications MapObjects can be
combined with the strength of Java to create Internet enabled
GIS applications. As with most languages there are different
approaches of how Java can be used with MapObjects. The intent
of this research paper is to outline some of the basic design
and development issues for using MapObjects with Java to Internet
enable GIS applications.
It is a safe assumption to say that the Internet has changed the computing world as we know it. It is a little disconcerting receiving e-mail from your parents or other relatives telling you about the newest web site they "surfed" to find a great recipe for salsa. Besides recreational use, people in the business world are looking for solutions to constructive surfing.
It is this demand for a solution that provided last
year 's Esri Users conference's catch phrase "Internet enabled".
Today's Internet savvy end users are looking for more than static
text and hyper-linked images. To help create these new "Internet
enabled" programs software developers have to look for new
tools and languages. One of these new tools is MapObjects a development
library released last year. Also needed is the newest computer
languages a two year old programming language called Java from
Javasoft. It is considered by many as the premiere Internet programming
language. This research paper cover how MapObjects can be used
with Java, its various methods of integration, the tools used,
and their relationships.
In an earlier paper presented in the spring at the GIS'97 conference in Vancouver, Canada was a scenario of an applications built using the Internet. It concluded by stating "This Scenario doesn't exist today, but with the Internet/Intranet; WWW and Java, growing as fast as they are now this could exist tomorrow". Tomorrow is here today, and this paper will show how someone through the use of MapObjects and Java can make this scenario possible.
A researcher at the University of British Columbia needs to study the impact of the new Land Use Plan for the Lower Mainland. One of the data sets used as a base is the B.C. Ministry of Environment's Watershed Atlas to provide the stream base of the areas affected. The modeling tool being used is directed to use the most current data set at the Watershed Web's URL. There is no need to download the complete data set to a local machine, the modeling tool is using the Web as a global hard drive. After collecting various data sets from throughout the Internet the researcher produces a paper describing the model effects and publishes the results including the models online.
A member of a multi-national Forest Company GIS department finds a reference to the paper and model in a Internet search tool and decides that the UBC researcher has neglected the effect of slope stability within the Ministry of Forests data set. The employee appends the Forestry data's URL to the model and includes the slope stability model. An E-mail message is sent to the UBC researcher explaining how modifications with the new model could help provide more accurate portrayal of the effects.
At the same time the Watershed Atlas being used
in the Land Use models is being updated to include new revisions.
The Ministry of Tourism is also putting together a Web site promoting
the Parks and Outdoor activities that take place, also using the
Watershed data set(i).
The scenario just described is based on the Internet model, with a Web browser as the User Interface. The researcher leverages the ubiquitous nature of Web browsers and the clear advantages it provides. Before describing how to Internet enable GIS applications, Internet and "Enable" must be defined.
When most trade papers talk about the Internet they
are describing the Web. The misconception is that the WWW, Web
is consider to be the Internet, but in fact it is one of many
applications that run on the Internet. The American Heritage®
Dictionary defines the Inter prefix to mean "between"
and defines network as "A system of computers interconnected
by telephone wires or other means in order to share information,
also called net". Therefore, the Internet can be defined
as a global connection between computers. Finally the word "Enable"
is defined as "To make feasible or possible". To "Internet
Enable with Java" can be defined as to make feasible or possible
with Java a global computer network to share spatial information.
As stated earlier the Internet provides the infrastructure on which applications reside. These applications can then be classified into two major families, Peer to Peer and Client/Server. For example a Peer to Peer system would be a chat line, shared whiteboard applications or any application that can be considered a client and server at the same time.
The majority of applications found today are Client/Server based. The most prevalent being the Web with the client being the various browsers and the Servers being various HTTPD deamons . Referring back to our scenario for tomorrow the main advantage for using the Web was the hardware, operating system and software independence. The scenario referred to using the Web as a global hard drive so the data doesn't have to be stored locally. The Internet application that will allow this is WebNFS that uses the standard URL format nfs://www.xxx.com(ii).
Something not brought up in the scenario was the distinction between creating new applications and re-engineering existing applications. As the popularity of the Internet increases an existing application can be re-engineered to give it Internet capability. A good example is using a MapObjects Internet Server to add map production to a Web Site.
A specific type of Internet, is an Intranet, a type
of Internet used by companies for internal purposes. An application
that is not a viable solution as an Internet application because
of bandwidth and response requirements, could be a viable solution
to an Intranet. For example in the scenario for tomorrow the
multinational Forest Company could create an internal MapObjects
modeling tool to be shared between many users.
MapObjects is a software component library that provides
GIS functionality, that can be incorporated into applications.
It is not an end user application such as ArcView, but a product
meant for software development. The underlying component architecture
that MapObjects has been based on is Microsoft 's Active X technology(
which was OLE controls). The MapObjects reference manual defines
MapObjects to be composed of an Active X control with 30 automation
objects. For a more detailed description of MapObjects see http://www.Esri.com/software/mapobjects/index.html.
Component software such as MapObjects offers the advantage of
using specific interchangeable components needed to solve a task,
reducing the amount of time to develop an application.
The underlying structure of Active X is COM, component object model, and DCOM, distributed component object model. These models are defined by Digital and Microsoft to specify how objects interact with each other and the mechanisms to do it. Active X controls are usually visual objects that support visual editing, and event mapping. Through Active X automation properties and methods are accessed by interfaces. Therefore, in the case of MapObjects the "Esri Map Objects" (Mo10.ocx) control is the main COM object which handles events, such as mouse or key events, and execution of methods to control other objects through an interface. The Mo10.ocx Active X control properties, such as map layer color can be modified by one of the 30 Active X automation objects(iii).
One of the great strengths of MapObjects is that
as a software component it can be quickly integrated into a application
giving it GIS functionality. But relying on Active X which is
based on the COM and DCOM structure is the weakness of Active
X. It is not in the fact the COM is inadequate, but it can only
be used in a win32 environment. Microsoft is working on this
problem by porting to different environments, but how much of
the services will be ported and when will these ports will be
done is still in question. Because the Internet is made up of
more than win32 systems another solution is needed to help create
Internet enabled applications. Thankfully, Active X has been
developed in such a way that Microsoft considers Active X to be
language neutral binary objects. It is this combination of Active
X with Java which can help overcome the weakness of COM in the
problem of creating Internet applications for GIS applications.
Java is an objected oriented, interpreted language that runs in a Virtual Machine (VM) interpreter. This means a Java program will run on any machine that has the VM ported to it. The syntax of the language is similar to C and C++ while omitting the more difficult aspects with code compiled to a byte code representation that VM can understand.
Java programs are organized into classes which can be dynamically loaded at runtime, locally or retrieving the class across a network(iv). The advantages to dynamic loading classes is when a modified or enhanced class is changed the application use the new class. In the scenario a member of a multinational forest company extends the Land Use model class, with a slope stability class. No need for relinking of the code and redistributing the application. Java applications stored on the Web Server can be written once and redistributed and enhanced by end users everywhere because of the platform independence Java provides.
The Java VM has thread capability built into its
core, which is necessary for creating Client/Server applications,
which most Internet applications are today. To protect against
viruses the Java VM does code verification and execution of applets
in the VM sandbox implementation. For more information on Java
see http://www.javasoft.com. An excellent source for people new
to Java is the Electronic Magazine JavaWorld found at location
http://www.javaworld.com. In February, 1997 Javasoft released
Java 1.1.1 a major enhancement to the Java language. The following
sections provide some of the new package information and why they
are important in creating GIS applications.
One of the most important of the new packages added to Java is the JDBC package. It provides the ability to access RDBMS data stored in databases locally and throughout the Internet. It is loosely based on ODBC and has bridges to ODBC drivers. As component software MapObjects was developed to only deal with spatial issues. Therefore, to create a complete GIS application, JDBC provides the ability to access, modify and display tabular information as needed. To Internet enable a GIS application JDBC provides the ability to access a database on a server and display the results on the client.
Going back to our scenario, the UBC researcher's
results and data set could be stored in a RDBMS such as ORACLE,
relating to a specific spatial location on a MapObjects generated
map displayed on a machine independent Web Browser.
Javasoft recognizes that component software provides a fast effective method for developing applications. As Active X is Microsoft's implementation of component software, JavaBeans is Javasoft's. Generally a Java class can be considered a JavaBean. The key advantage of JavaBeans over Active X is the platform independence. With the Active X Bridge JavaBeans can behave as Active X objects in the win32 development environment with event mapping between the two.
A sample JavaBeans application could be a River Rafting
Trip builder from Ministry of Tourism in the scenario. The River
Rafting Trip builder application could be downloaded from the
Internet providing an example of using the Internet as a delivery
system.
Even though Jar files and security are not new packages
they are important features. Jar Files is the wrapping mechanism
to deliver multiple classes and data sets to an end user. Jar
files are based on the popular ZIP file format that compresses
data to speed the delivery of applications such a JavaBeans River
Rafting Trip builder example downloaded from the Internet. Besides
the speed of delivery of Jar files is the security of providing
the digital signatures of Jar files. For our scenario it is important
to know the Land Use plan is authentic to confirm where the models
came from.
Remote Method Invocation is the underlying mechanism
that allows Java methods to execute on a remote machine. For
the Client/Server architecture of the scenario most clients would
not have the computational power needed and storage to calculate
the model in an effective manner. RMI allows the model to run
on the Server with the results being sent to the client Web browser.
Using RMI to distribute the Land Use Model would allow for more
people to view and use the model.
The Java Native Interface provides the ability to
link Java with C stub programs. Simply put the Java Native Interface
allows Java to be interfaced with machine dependent code or a
legacy application. For example, to provide an extension to our
scenario the Ministry of Environment could enhance the BC Watershed
Atlas with a video tape, which is displayed with special hardware
video buffers. These video development libraries are written
in C. Through the use of JNI the scenario GIS application could
be enhanced with video.
The tools used here are not the only tools available, in fact all the development could have been carried out using the free JDK 1.1.1 with a VI editor. For the purpose of this paper Javasoft's JDK was used as the baseline. If any of the two development environments differed from the JDK 1.1.1 then it was assumed the JDK 1.1.1 was correct.
The two operating systems used were Windows 95 and Solaris with the two development tools being Microsoft's J++ and Sun's Java Workshop. Microsoft's J++ was selected as one the tools because of the implementation of the Java VM allowing Java to call COM objects and vice versa. The Java Workshop was selected because it is the only development environment that uses the JDK 1.1.
To test some of the newer Java functionality a Java
1.1 enabled browser was necessary. At the time of this paper
the only Java 1.1 enabled browser was the HotJava 1.0 browser.
All major browsers have pledged support for Java 1.1 in future
releases.
In the integration of MapObjects and Java to create applications there are two basic approaches. The first is a Java application with Active X embedded within and the second being an Active X application calling Java classes or Java embedded within. Today most Internet applications are Client/Server and distributed in nature so objects and classes can be on either end of the application. The following sections are some points on how Java and Active X can be integrated.
Common to both approaches is the fact that Active
X must be executed in a win32 environment. This means all or
part of an application must reside on a win32 platform such as
windows95, windows NT 3.51 or newer.
In using Java with Active X Microsoft is the only company that provides direct access to COM objects directly from Java code. Microsoft's implementation of the VM includes COM support. This allows COM objects to be directly imported into Java programs. Microsoft accomplishes this by using the Java Type Library Wizard tool. This tool provides access to the COM objects through Java equivalent methods for the interfaces by generating the classes needed to map the interfaces of the COM Object.
Another way of placing Active X within a Java application is to wrap all the win32 dependent code in a Java Native Interface (JNI) package. This part of the distributed application will still need to be run in a win32 environment, but the rest of the application would be machine independent.
For example in the Scenario production of the maps
could be done with MapObjects with an Internet Server. The advantage
of using Java on the server is using the same language throughout
all systems which can be distributed to other platforms. A modeling
tool is not effective in a win32 environment because of the lack
processing power. However, it could be extended through the use
of RMI to a modeling tool residing on a workstation class machine
for a computer intensive model.
In the case of Active X applications with Java both Microsoft and Javasoft provide similar abilities to embed Java with Active X. Javasoft's use of JavaBeans with an Active X bridge allows JavaBeans to behave like Active X controls. Microsoft uses the modified Java VM as describe earlier. Therefore, in a development environment both Active X controls and JavaBeans can interact with each other.
For example in our scenario a MapObjects control
could be embedded on a Web page with a JavaBean. The JavaBean
could provide access to the tabular information of the map being
displayed. This is only possible if the browser uses Microsoft's
Java VM for an Active X control embedded into a Web page. Some
people say MapObjects as an Active X control is "too fat"
to be embedded on a Web page. Meaning the size of the application
would be too large to distribute on the Internet. This is a valid
reason in most cases, but on a private company's Intranet where
the bandwidth is larger and response time faster then an Intranet
application embedding MapObjects Control is possible.
To test out our scenario, the BC Ministry of Environment has provided the BC Watershed Atlas data set to be used to build a new prototype for the WSCA project. The Watershed Code Availability, WSCA project was simply to provide maps of the BC Watershed Atlas with watershed codes for contractors currently collecting fisheries' information on water bodies. The output map scale chosen for these maps was 1:20,000 for a total of approximately 8,000 maps to be produced and distributed to the regional offices and any contractors that needed them(v). To help distribute the maps the Internet was chosen to provide access and deliver to the maps. The major problem with the current system is all 60Gb of the static map have to be produced beforehand and stored on the Web. Using MapObjects with Java will allow the creation of dynamic maps extending the functionality that exists for the end user today.
The results of building today's scenario WSCA with
MapObjects and Java will be presented at the Esri's 17th
User Conference in San Diego.
Because MapObjects is only a year old and Java is only two years old, it is difficult to find working examples of MapObjects and Java. Combing the strengths of MapObjects spatial components and Java's Internet programming language effective Internet enabled GIS applications can be created.
Map Objects provides the building blocks through the use of Active X technology. But one of the weaknesses of MapObjects is its reliance on COM which exists only on win32 platforms today, can be strengthened through the use of Java. Java provides the ability to build a Client/Server application that can be distributed and used on non win32 platforms.
To use MapObjects directly within Java the Microsoft's COM enabled Java VM is needed at some point. If you don't want to use Microsoft's VM, Javasoft provides the JNI which allows Java code to be Active X code to be wrapped in Java code. Other advantages of Java is signed Jar files and JDBC which provides access to databases.
With everything moving at Internet speed new enhanced
tools and software will be available to help integrate Java and
MapObjects such as the @COM directives proposed by Microsoft in
the near future.
Engen, David
Starise Enterprises Inc.
A-1322 Thurlow Rd
Victoria, B.C.
Fax: (250) 385-0855
Work (250) 480-8828 (Cellular)
Home: (250) 385-0854
E-mail: dengen@islandnet.com