GIS Lounge


  • Home
  • What is GIS?
  • GIS Career
  • Learn GIS
  • Maps
  • Contact

You are here: Home » GIS Software » GIS Programming » Java For Newbies – A GIS Perspective

Java For Newbies – A GIS Perspective

Filed in GIS Programming by Marco Morais on August 22, 2002 • 0 Comments

Share this article:

Related Content:

Java and GIS Languages and Operating Systems in GIS

Learn about what Java is and how to use it in GIS.

The official language definition given in the preface to the Java Programming Language Specification is:

“The Java programming language is a general-purpose concurrent class-based object-oriented programming language, specifically designed to have as few implementation dependencies as possible. It allows application developers to write a program once and then be able to run it everywhere on the Internet.” ~ Preface, The Java Language Specification, 2nd Edition

These two sentences say a lot, but I will focus on two important language features: objects and “write once, run anywhere” (WORA).

Objects

Java is an object-oriented language. In the context of the definition above, an object is an instance of a class. A class is an entity which encapsulates data, referred to as variables, and functions that operate on data, referred to as methods. However the ability to define and create class instances is insufficient to call a language object-oriented. The implications of object-orientation are that the language supports inheritance. Inheritance is the ability of one class to extend the variables and methods of another to create class hierarchies. An often-cited advantage of an object-oriented language is that it facilitates code reuse.

How Objects Apply to GIS

If you have used some of the scripting languages shipped with commercial GIS software, such as ESRI’s Avenue or MapInfo’s MapBasic, then you have probably acquired some feeling for how the ability to manipulate objects shields you from low level details and ultimately makes you more productive. If you have spent time writing C code for GRASS GIS which uses a lot of nested struct types, the nested relationships between these types may be ideal candidates for replacement with an inheritance hierarchy.

Write Once, Run Anywhere (WORA)

A second important feature of Java is “write once, run anywhere” (WORA). In non-interpreted programming languages, such as FORTRAN, C, or C++, a person must have a compiler change the human-readable source code into lower level machine-readable binary code. For each different architecture that a person wants to execute the binary code on, they must perform a separate compilation. This often means that the source code must be rewritten to accommodate differences in machines. Java avoids this inconvenience by having the compiler produce binary code that is in an intermediate form between source and binary code, called bytecode. In order to execute bytecode on a particular machine architecture, a Java interpreter must exist for that architecture. Unlike non-interpreted languages, only a single copy of Java source code and bytecode exists, but there are interpreters for almost every machine architecture on the planet including cell phones, desktop PCs, Macintosh computers, and Linux and UNIX workstations. As the world becomes more digitally connected, heterogeneity in the types and architectures of devices that must communicate will only increase.

How WORA Applies to GIS

Inevitably the organization that you do GIS for will want to participate in the expanding web of communication, perhaps by serving some of your organization’s data and maps on the Internet or by collecting information on the geographic position of assets or customers in the field. The “write once, run anywhere” philosophy of the Java platform means that anytime the architecture of the devices you need to communicate with is heterogeneous or unknown, Java will be the lingua franca. Finally, if you are a business which develops GIS applications, then you can use Java to ensure that the applications you create are portable to as many platforms as your customers demand, without expensive code rewrites.

What Else Is There?

I have not mentioned some of the other language features such as garbage collection, threads, and exceptions, but visit the New To Java Programming Center for more information. Also check out the companion article, “Learning Java, A GIS Perspective” for a guide to resources on the web that can help you learn the Java language. You can also send me email if you have any other Java and GIS features that you would like to see.

 

You Might Also Be Interested In:

  • Java Map Servers and GIS Toolkits – Reporting from JavaOneJava Map Servers and GIS Toolkits – Reporting from JavaOne
  • Java and GISJava and GIS
  • XML – eXtensible Markup LanguageXML – eXtensible Markup Language
  • Python and GIS ResourcesPython and GIS Resources


Tags: GIS programming, java



Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

« David Rumsey Historical Map Collection Is First Mapping and Internet GIS Site To Win Prestigious Webby Award
France – GIS Resources »

Subscribe

Fill out your e-mail address to receive a weekly newsletter from GIS Lounge:

Advertise on GIS Lounge

GIS Book Pick

The Look of Maps: An Examination of Cartographic Design is a cartographic classic by Arthur H. Robinson originally published in 1952. The book was based on Robinson’s doctoral research “which investigated the relationship between science and art in cartography and the resultant refinement of graphic techniques in mapmaking to present dynamic geographic information.”

  • Popular
  • Recent
  • Comments
  • Archives
  • Largest Atlas in the World Created using ArcGIS
  • Google Map Redesign
  • Shapefile Viewers
  • Creating Simple Maps with Microsoft Excel
  • What is GIS?
  • Google Map Redesign
  • Crowdsource Power Plant Data Project
  • Shapefile Viewers
  • Timelapse Satellite Imagery – View Changes on Earth over Time
  • The Map Myth of Sandy Island
  • Mark: A very easy way to do this!!! Thank you.
  • Richard Ortwine: I am currenlty working on a project that will show there are more liquor stores in zip codes that ha
  • John Chioles: This is a phenomenal move on the part of the USGS! I remeber getting imagery was cost prohibitive, n
  • aizolnai: this is yesterday's news, but it's so well illustrated that it's defo worth a (re)read, thx for the
  • Web GIS System: FYI. We have collected 1,545 responses in our 2012 GIS salary survey to our vendors and customers pa

Connect


Introduction to GIS

New to GIS? Start by reading What is GIS for an introduction to Geographic Information Systems. Next visit the GIS 101 launch page for basics of GIS articles.

Getting Started with GIS

To understand the different options for GIS education read How to Learn GIS , GIS distance learning programs, and GIS certification versus certificate programs

GIS Jobs

Interested in GIS as a career? Visit GISGig.com for GIS job listings.A good first article is the Building a Career in GIS which provides an introduction to the building blocks of GIS employment .

Subscribe

Enter your email address below to receive updates each time we publish new content.

Connect

Connect with us on the following social media platforms.

Subscribe via RSS Feed Connect on Facebook Follow Me on Twitter Connect on Google Plus Join Our LinkedIn Group

GIS Resources

  • What is GIS?
  • GIS 101
  • GIS Career
  • Cartography
  • Maps
  • GIS Software
  • Learn GIS
  • Data
  • Free GIS

Colophon

  • Advertising on GIS Lounge
  • Submitting to GIS Lounge
  • Contact GIS Lounge
  • Subscribe
  • Site Map
© 2013 GIS Lounge. All rights reserved.