by Sue Spielman and Tom Whitehill02 / 16 / 2004If you've been paying attention to the recent groundswell, chances are that you've heard the terms GIS, geospatial, GPS, and a host of other acronyms being thrown around. But do you really understand what they mean -? the types of applications that use this stuff, and what it means to the way we look at our development Naturally, neither of us did at first, but we've been working (well actually, mostly playing) In this space for a couple of years now, and then onnly Recently realized the huge potential it presents us as java program.
This series will serve a couple of purposes: Part 1 will get you up to speed on what all this GIS stuff means, explaining some of the terminology and how it relates to what we build Part 2 will talk about some of the open source geospatial. Systems and top 3 Will Be A Walkthrough of Putting Together A Mobile-Gis-enabled Application.
Sound Like Fun? IT Should, Because this is pretty cool stuff.
GIS Basics
Let's start with the basics. The Geographic Information Systems (GIS) space comes with its own vocabulary. It's important to understand what some of these things mean, because without a firm understanding of the semantics, it is very difficult to figure out what's going on .
As some of you might know, this technology has been around for about 30 years now, but has not really hit the mainstream primarily because it's been very difficult and cumbersome to use. It's just recently that it's become widespread because the GIS databases and the software are making it attainable to even us mortal folk. What that means is that we can start using Java to interface with the GIS environment. "Geospatial" refers to a class of data that has a geographic or spatial nature. The Global Positioning System ( commonly known as GPS) is a collection of twenty-four satellites, developed by the US Department of Defense, that orbit the earth at an altitude of 20,200 kilometers. These satellites transmit signals that allow a GPS receiver anywhere on earth to calculate its own location The Global Positioning System IS Used In Navigation, Mapping, Surveying, and Other Applications Where Precise Positioning IS Necessary. GPS Handheld Devices Have Been Available for a While Now, But IT IS Only Until Recently That GPS HAS BEEN Built Into Mobile Devices Such As Pdas and Smart Phones.
Map this! - GIS Analysis
GIS analysis is a fancy term for looking at patterns in data and relationships between those features. How do we approach understanding what these patterns and relationships are? Simple. We ask a question such as, "Show me all of the customers within five miles of A Given Retail Store. "OR," SHOW ME The Population Density Map of Colorado. "OR Even," Show Me All of the Crimes Took Place in Given Area, "Like The Maps Shown In Figure 1.
Figure 1. CRIME LOCATIONS in A Given Area
All of these are questions that can be graphically displayed on a map or become values in a table, or can be processed as a chart based on some type of query.Features are displayed in any number of ways. Data can be discrete, continuous, or summarized by area. A discrete feature can be a location or a line. At any given spot, the feature is either there or it's not there. For example, a business' location is a discrete point, whereas a stream or river is a Discrete Linear Feature. And a color-code map showing land parcels IS AN EXAMPLE OF A Discrete Area, AS Shown In Figure 2.
Figure 2. Land PARCELS As Discrete Area (You Can Click on The Screen Shot To Open A Full-Size View.)
When we're talking about continuous features, we're talking about something that can be described or measured anywhere. For example, if you have a map showing temperature readings, elevation data, or average rainfall, you would have continuous data that flows from THIS TYPE OF MAP IS SHOWN IN Figure 3.
Figure 3. Continuous data (you can click on the screen shot to open a full-size view.)
A feature summarized by area represents a closed two-dimensional shape defined by its boundaries. Usually this area is measured in its square units. So if you wanted to look at areas by ZIP code, or at all of the businesses within a particular country, That Would Be an Example of A Summarized Area.
Being able to do interesting queries on summarized areas becomes a function of how well your GIS database is populated. If you have the data captured in the data table, then it becomes possible to do something like, "Find all of the homeowners who make more Than $ 75,000 a year in Lowell, Ma. "What We Just Did in The Last Query Example Was Actually Create Three Different Layers. So Now You Are Reasonably Asking," What's a Layer? "What you get is what you get
A layer is a set of vector data organized by some subject. Think of each layer as a film transparency (remember those?), Only a digital version. When you put one layer on top of another, you form a map that contains new information This Concept is Shown in Figure 4.
Figure 4. How Layers Make UP A MAP
Taking our previous query as an example, the three layers that we have are:. Homeowners as discrete points, income level as discrete points, and Lowell, MA as a summarized area If we lay the transparencies on top of one another, we'd Get All Homeowners Who Make More $ 75k Who Live in Lowell.
Still, this simple concept of layering has a number of issues that need to be dealt with. For instance, how are the various layers represented? Are they represented as vector data, as a raster image, or perhaps in a shapefile? And what are VECTORS AND RASTERS? ALSO, What Are the Coordinate Systems Used for Each Layer?
Vectors, Rasters, And Shapefiles
In the GIS world, there are two main models used to represent the geographic features. The first is a vector and the second is a raster. When you are working with a vector model, you are basically working with an x / y coordinate. Each Feature is defined as a row in a table. it's possible to have points, lines, or all, if you are defining a line (Like a River OR A Road), The IT Would Be Reperesented by a Series of coordinate pairs. for other types of features (like land parcels, for instance) that can be represented by closed polygons, you would define the borders as series of coordinate points.When dealing with a raster model, features are represented as rows and columns of cells. Each cell has an attribute value, as well as location coordinates. The coordinates are contained in the ordering of the matrix. Usually, each layer represents one attribute. For example, you might have a raster model to display the burn area of a Forest Fire, While a Vector Mode l would be more a more appropriate way to display highways. Keep in mind that you can represent a feature in either model, but usually, discrete features and data summarized by area are more likely to be a vector model, while something like a continuous category .
This leads us to a shapefile, which is a vector file format for storing the location, shape, and attributes of a feature. This information is stored in a set of related files and contains one feature class. A feature class is a collection of spatial Data with The Same Shape Type (Point, Line, or Polygon).
Projecting and coordinating
The last topic on the tip of the iceberg of our exploration of GPS has to do with map projections and coordinate systems. While in theory this seems like it should not be that difficult to grasp, personally we both find it to be pretty confusing. All of the data layers that are being used on the same map need to have the same projection and coordinate system. Otherwise, you'll have a pretty funky-looking map, because the layers will not overlay one another.What exactly is a map projection? It's a mathematical model that transforms the locations of features on the Earth's curved surface to locations on a two-dimensional surface. There are a couple of different types of map projections (which we will not cover in detail here), but they All Have ONE Thing in Common: Distormion. You Can See How Projections and Their Divostions Differ in Figure 5. a Projection Will Distort, Area, Shape, Direction, or A Combination of Any of these.
Figure 5. Projections and Distormions
The Coordinate System Is The Reference Used for a Set of Points, Line, or Surfaces, And a Set of Rules Used to Define The Positions of Points in Space. This Can Be Either In Two (x, Y) or Three (x, y , z) Dimensions. Are All of Those Linear Algebra Classes COMING Back to you yet?
Attributes
Before we wrap up the GIS basics here, let's talk about one more topic:.. Attributes Your maps and features will only be as good as your data and its attributes Most of the time, you will probably be getting data supplied for you, but depending on the types of analysis you'll be doing, you might need to add your own attributes to the data. for example, if you want to categorize similar activities together, you might have a separate table column for each. This could be presented AS A Numeric Value (IE, "Return Me All Values That Are In Category 1), OR A Text Value (IE," Find Me All Values That Are In The Business Category). Another Frequent Attribute Is A Rank, Where In features are rated on a specified scale. for example, if roadways are ranked by safety, you can query, "Find me all the roads ranked 4 in safety," and know that these should be the first in line for road improvements. These are Just A Few Samples of The Types of Attributes That Can Be Applied To Geographic Features.
Wrapping Up Part 1
We've just spent a fair amount of time talking (or actually, writing) about GIS, but our intention is to lay the ground work for talking about how this fits into Java development. This is a relatively new area for Java development to take Place. of the 238 JSRS OUT THERE (At Last Count), There Are Zero In The Gis Space. That Should Tell You That We're at The Very Beginning of The Curve Here. The Types of Applications That We'll Be Able To Produce Using GIS Integration Will Be Just Astounding.
In Parts 2 and 3 of this series, we'll look at both the server and a mobile client. By using some of the cool features available in MIDP 2.0, we'll build a MIDLet that will connect to a server using network APIs and then, using a simple HTTP tunnel, we'll pass information to a servlet that will talk with a MapObjects client. In this series, we are making use of ESRI MapObjects for Java so that you can see what a production application might look like. If you are planning on doing any type of work in this area, the multitude of products available from ESRI are worth your time to investigate. ESRI is the front runner in this space, and there'd be a lot of catching up to do if You Wanted to Start Somewhere Else.Now That We've Got The Basics Down, Stay Tuned for Part 2 and Part 3, Where We'll Start Getting Into Some Server-Side and J2me Coding.
SUE SPIELMAN IS PRESIDENT AND SENIOR Consulting Engineer for Switchback Software LLC, Author of a Number of Books, And A Speaker on Various Java Topics Around The Country.
Tom WhiteHill Is The Co-Founder of Mobilogics and Has Been Working with Java Since 1995.
All Figure graphics provided by esri.