PDA

View Full Version : سیستم های کار با نقشه



Bahmany
پنج شنبه 20 دی 1386, 06:57 صبح
سلام
توی جایی کار با سیستم های تجزیه و تحلیل نقشه مطرح بود
خوب بنده این کار رو با دلفی به پایان رسوندم ولی خوب با جاوا یه چیز دیگه هست من سرچ هایی رو انجام داده ام انشا الله به ترتیب در این قسمت قرار می دهم
اگر از دوستان اطلاعاتی در این ضمینه دارند خوشحال میشیم بفرماییند

Bahmany
پنج شنبه 20 دی 1386, 08:00 صبح
http://today.java.net/images/tiles/111-gis.gif Java and GIS, Part 1: Intro to GIS

by Sue Spielman (http://today.java.net/pub/au/54) and Tom Whitehill (http://today.java.net/pub/au/154)
02/16/2004


f 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 have only recently realized the huge potential it presents us as Java programmers. 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 how the pieces fit together, and Part 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 hasn't 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 U.S. 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 that took place in given area," like the maps shown in Figure 1.
http://today.java.net/images/2004/02/fig1.gif
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-coded map showing land parcels is an example of a discrete area, as shown in Figure 2.
http://today.java.net/images/2004/02/fig2sm.gif (http://today.java.net/images/2004/02/fig2.gif)
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 quantity to quantity. This type of map is shown in Figure 3.
http://today.java.net/images/2004/02/fig3sm.jpg (http://today.java.net/images/2004/02/fig3.jpg)
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 Layer 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.
http://today.java.net/images/2004/02/fig4.jpg
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 than $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 areas represented in a vector model. If you are defining a line (like a river or a road), then it would be represented 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 model 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 (such as temperature readings, or elevations) make more sense presented in a raster model.
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 shouldn't 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 won't cover in detail here), but they all have one thing in common: distortion. You can see how projections and their distortions differ in Figure 5. A projection will distort distance, area, shape, direction, or a combination of any of these.
http://today.java.net/images/2004/02/fig5.gif
Figure 5. Projections and distortions
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 (i.e., "Return me all values that are in category 1"), or a text value (i.e., "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 (http://www.esri.com/software/mojava/index.html) 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 (http://today.java.net/pub/au/54) is president and senior consulting engineer for Switchback Software LLC (http://www.switchbacksoftware.com/), author of a number of books, and a speaker on various Java topics around the country.
Tom Whitehill (http://today.java.net/pub/au/154) is the co-founder of Mobilogics and has been working with Java since 1995.
All figure graphics provided by ESRI.






منبع :
http://today.java.net/pub/a/today/2004/02/16/gis.html

Bahmany
پنج شنبه 20 دی 1386, 08:03 صبح
http://today.java.net/images/tiles/111-gis.gif Java and GIS, Part 2: Mobile LBS

by Sue Spielman (http://today.java.net/pub/au/54) and Tom Whitehill (http://today.java.net/pub/au/154)
04/01/2004


In part one (http://today.java.net/pub/a/today/2004/02/16/gis.html) of this Java and GIS series, we acquired the vocabulary that surrounds the GIS space. Understanding the terminology is critical when talking about GIS applications. In part two of this three-part series, we are going to take a look at the mobile Java client. We're going to build a simple Location Based Services (LBS) MIDLet to show what needs to happen on a mobile device and how to get that information to a server. Part three of this series will take the location information and show how a map can be created using the location coordinates. We're assuming that you've got some J2ME (http://java.sun.com/j2me/index.jsp) background (since we aren't going to be going into detail on the MIDLet life-cycle), as well as background on how to create and deploy a servlet. For our sample, we are working with MIDP 2.0, the Motorola iDEN i730 SDK, and the Motorola i730 device.
Using LBS

First, let's make sure that we understand what an LBS application is. Typically, an LBS application is trying to answer the question "Where am I?" and then do something with that information. There are a number of ways to answer this question:

I am on Earth.
I am in North America.
I'm in the US.
I'm in the Rocky Mountains.
I'm in Denver, CO.
I'm at 39.7°N,105°W. As you can see, the answer to the question depends on how specific you require your data to be. Being able to determine your current, accurate location can take a few forms. When dealing with a mobile phone, there are also a number of options to determine your location. Typically, some sort of information is available through network operators, using methods that are often made invisible. An example of this is when you travel, and your phone resets its time to the time zone you have entered. All of this is done "under the covers" for you.
There are different ways that a phone can determine its location. Using Angle of Arrival (AOA) methods, where the angle of the phone to the more than one transmitter is determined, or Time Difference of Arrival (TDOA), where the signal is timed from the handset to the cell transmitters, are just two examples. What we are going to be talking about is Assisted GPS (AGPS) and GPS. In these cases, assistance information is produced by the cell network using a simple GPS receiver that is built into the phone handset. This is combined with information from the GPS satellites. What this means is that not only do you need a phone that supports the GPS receiver, but also an AGPS-enabled network. For our development, we've been using the i730 device and the Nextel network, since they provide the service in which we are interested. Using specific location APIs, we are able to access the location information that we need from the device and use it in our GIS application.
It is helpful to understand the flow of the code we are going to look at, which is available at the end of the article. First, we'll look at the client portion. In this case, we are dealing with a cell phone, so we are writing a J2ME MIDLet. The MIDLet allows us to see how the device interacts with the location APIs using canned values. From here, we'll add a little more to the mix and actually do a dynamic location API call. This will show how taking a staged approach is important, so that different parts of the code can be unit-tested in isolation. Lastly, we'll look at a simple servlet that will tie the server portion into the picture. Let's start with the MIDLet.
The "Where Am I?" MIDLet

In general, all MIDLets implement required methods to support certain J2ME life-cycle events. If you'd like to explore all of the methods, you can look at the MIDLet class in the javax.microedition.midlet package. Requests coming into the MIDLet are handled by an inner class, CommandListener, that is set up in the constructor. This MIDLet will tell us what our current lat./long. coordinates are, and then send them to a server using a standard HTTP network connection. Let's take a walk through the MIDLet code. However, keep in mind this isn't a MIDP tutorial. While we'll show the complete code, we'll only talk about the parts of interest as they relate to this application. First, let's get our basic MIDLet set up. Nothing too exciting, as we're just setting up some of our local variables.
package com.mobilogics.javanet;

import java.util.Vector;
import java.util.Calendar;
import java.util.Date;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
import javax.microedition.io.Connector;
import javax.microedition.io.HttpConnection;

public class WhereAmIMidlet extends MIDlet
implements CommandListener {
public static final String NOT_SET = "Not Set";
public static final String ID = "ID :";
public static final String LATITUDE = "Lat :";
public static final String LONGITUDE = "Long:";
public static final String STATUS = "Stat:";
public static String m_sUrl = NOT_SET;
protected String m_sPhoneId = "71";
protected String m_sLat = NOT_SET;
protected String m_sLong = NOT_SET;
protected long m_lTimestamp = -1;
protected String m_sStatus = NOT_SET;
protected String m_sTicker = NOT_SET;
protected String m_sAboutMessage = NOT_SET;
protected String m_sAboutTitle = NOT_SET;
protected Display m_Display = null;
protected Form m_LocationForm = null;
protected Command m_cmdGetLocationAndSubmit;
protected Command m_CommandExit;
protected Command m_CommandAbout; Next we'll look at our constructor:
public WhereAmIMidlet() {
m_sAboutTitle =
this.getAppProperty("MIDlet-Description") +
" " +
this.getAppProperty("MIDlet-Version");
m_sUrl = this.getAppProperty("url"); Here, we are setting our URL to be on the localhost (we happen to be using Tomcat), where the location information will be submitted to our WhereAmIServlet.
if (null == m_sUrl || m_sUrl.length() == 0) {
m_sUrl = "http://127.0.0.1:8080/javanet/lbs.do";
}
Next, we define various screen commands. We've intentionally keep this sample simple by just having Submit, Exit, and About commands. Typically, you would probably have some type of GUI interaction with the user.
m_sAboutMessage = m_sUrl;
m_cmdGetLocationAndSubmit = new Command("Submit",
Command.SCREEN, 0);
m_CommandExit = new Command("Exit", Command.STOP, 3);
m_CommandAbout = new Command("About", Command.OK, 4);
// Location Form //////
// 1) Define Screen Content
Item[] locationItems = new Item[3];
locationItems[0] = new StringItem(ID, m_sPhoneId);
locationItems[1] = new StringItem(LATITUDE, m_sLat);
locationItems[2] = new StringItem(LONGITUDE, m_sLong);
// 2) Construct the Displayable Object
m_LocationForm = new Form("Summary", locationItems);
// 3) Add Commands
m_LocationForm.addCommand(m_cmdGetLocationAndSubmi t);
m_LocationForm.addCommand(m_CommandExit);
m_LocationForm.addCommand(m_CommandAbout); The interesting portion of this section is really the CommandListener, which handles the various screen command actions. The command of interest to us is the GetLocationAndSubmit, which is where we are actually getting the location information and then submitting it to the servlet. You'll notice that we are running the location APIs in their own thread. This is required because it could potentially take some time to get a GPS fix, and you don't want the MIDLet to be hanging in the GUI for the user.
// 4) Define and Set CommandListener
CommandListener cl = new CommandListener() {
public void commandAction(Command c,
Displayable d) {
if (c == m_CommandExit) {
destroyApp(true);
notifyDestroyed();
}
else if (c == m_CommandAbout) {
handleAbout(c, d);
return;
}
else if (c == m_cmdGetLocationAndSubmit) {
// This is a potentially long running
// process and must be run in its own
// thread. Therefore, wrap it in a
// thread, start the thread and make a
// quick return so this process execution
// does not tie up the Midlet's main
// thread.
Thread t = new Thread() {
public void run() {
getLocationAndSubmit ();
}
};
t.start();
}
}
};
m_LocationForm.setCommandListener(cl);
m_Display = Display.getDisplay(this);
} The getLocationAndSubmit() method is actually broken down into a couple of sub- methods, for ease of reuse. We give some indication to the user that something is going on by displaying a ticker across the screen, and then both get the location and do the submit.
public void getLocationAndSubmit() {
m_sTicker = "Getting Location";
System.out.println(m_sTicker);
updateUI();
Thread tGetLocation = new Thread() {
public void run() {
getLocation();
}
};
tGetLocation.start();
try {
tGetLocation.join();
AlertType.INFO.playSound(m_Display);
Thread tSubmitLocation = new Thread() {
public void run() {
submitLocation();
}
};
m_sTicker = "Submitting Location";
System.out.println(m_sTicker);
updateUI();
tSubmitLocation.start();
tSubmitLocation.join();
AlertType.INFO.playSound(m_Display);
m_Display.setCurrent(m_LocationForm);
}
catch (Exception e) {
e.printStackTrace();
}
} In this first MIDLet, we have implemented the getLocation() method with "dummy" information. This was done intentionally, because we first want to test the MIDLet as a plain vanilla MIDP application, without introducing the various complexities of the location API. After we're done testing our MIDLet and everything is working, we then override this method in the WhereAmIMotorola MIDLet, which will use the Motorola i730 location APIs. We'll look at that code in just a minute.
void getLocation() {
// Canned latitude value for a given location
m_sLat = "255515694";
// Canned longitude value for a given location
m_sLong = "-428707806";
m_lTimestamp = System.currentTimeMillis();
m_sStatus = "Location OK";
m_sTicker = "Get Location Status:" + m_sStatus;
updateUI();
} After we've got our location information, we can submit it to the servlet by constructing the appropriate query string and sending it over an HTTP connection.
protected void submitLocation() {
m_sTicker = "Submitting to Server";
updateUI();
try {
HttpConnection http = null;
StringBuffer sb = new StringBuffer(m_sUrl);
sb.append("?");
sb.append("id=");
sb.append(m_sPhoneId);
sb.append("&lat=");
sb.append(m_sLat);
sb.append("&long=");
sb.append(m_sLong);
sb.append("&time=");
sb.append(m_lTimestamp);
System.out.println(sb.toString());
http = (HttpConnection)Connector.open(sb.toString());
http.setRequestMethod(HttpConnection.GET);
http.setRequestProperty("Connection", "close");
m_sStatus = http.getResponseMessage();
AlertType.INFO.playSound(m_Display);
}
catch (Exception e) {
m_sStatus = "Error Submitting:" + e.getMessage();
AlertType.ERROR.playSound(m_Display);
}
m_sTicker = "Submit Status:" + m_sStatus;
System.out.println(m_sTicker);
updateUI();
} The various other methods that are contained in the MIDLet implement the MIDP life-cycle events (startApp(), pauseApp(), and destroyApp()), but are not directly related to the LBS functionality. You can download the sample source files we've provided if you want to take a look at them.
You can see in Figure 1 what happens when the MIDLet is first run.
Figure 2 shows what the location values look like after we've done a submit.
http://today.java.net/images/2004/04/gis_fig1.gif http://today.java.net/images/2004/04/gis_fig2.gif Figure 1. WhereAmIMidlet in emulator on startup Figure 2. Location values after a submit Adding in Dynamic Location

Now that we've debugged and tested our WhereAmIMidlet, we are ready to add in the location APIs. Basically, we are just extending the WhereAmIMidlet that we just created and overriding the getLocation() method. The interesting portion is that we are now making calls to the location APIs that are included with the Motorola i730 SDK. Since these APIs are specific to Motorola devices, if you are working with another device you'll need to determine if they supply location APIs in their SDK.
We create a PositionConnection using the Connector (just as we do with the HTTP connection), and then make the position() method call. This will interact with the GPS hardware built into the i730 device. Once we have a fix, we can then access the various pieces of information that we are interested in. In this case, we're simply getting the lat./long. and timestamp information. The updateUI() method is a utility method that you can take a look at in the source download, if you are interested.
package com.mobilogics.javanet;

import java.util.Vector;
import java.util.Calendar;
import java.util.Date;

import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
import com.motorola.iden.position.*;
import javax.microedition.io.Connector;
import javax.microedition.io.HttpConnection;

public class WhereAmIMotorola
extends WhereAmIMidlet {

protected void getLocation() {
try {
PositionConnection pc = null;
AggregatePosition ap = null;
m_sLat = NOT_SET;
m_sLong = NOT_SET;
try {
pc = (PositionConnection)
Connector.open("mposition:delay=high");
ap = pc.getPosition();
}
catch (Exception e) {
m_sStatus = "Location Error: " +
e.getMessage();
updateUI();
return;
}
if (pc.getStatus() !=
PositionConnection.POSITION_RESPONSE_OK &&
ap.getResponseCode() !=
PositionDevice.POSITION_OK) {
m_sStatus = "Location Error Code: " +
ap.getResponseCode();
} else {
// get units in 1/100,000 minute
int iLat = ap.getLatitude();
int iLong = ap.getLongitude();
m_sLat = "" + iLat;
m_sLong = "" + iLong;
m_lTimestamp = ap.getTimeStamp();
m_sStatus = "Location OK";
}
}
catch (Exception e) {
m_sStatus = "Location Error:" +
e.getMessage();
}
m_sTicker = "Get Location Status:" +
m_sStatus;
updateUI();
}
} We have our MIDLet running on our i730 device, telling us where we are. Now what? Let's take a peek at what comes into the servlet when we do our submitLocation() call.
Meanwhile, Back on the Server

As we can see, the MIDLet does the work of getting our current location for us and delivering it to the server. On the server side, we have a simple servlet running that accepts the request and then does something with the information. In a typical application, the servlet would actually be doing a bit more here, such as making a request to a GIS back end. For simplicity's sake, we have the servlet just taking the information and writing it to a text file called latlong.txt. This could easily be stored in a database or integrated into some other business logic.
The key part of WhereAmIServlet is the doGet() method, which does the work of parsing the incoming query string, writing the request parameters into our OutputStream, and then echoing the information to the response.
public void doGet (HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
// CGI query string will look like this:
// ?id=71&lat=123456&long=-123456&time=8983719387
System.out.println("Inside WhereAmIServlet.doGet()");
String sId, sLat, sLong, sTimestamp;
sId = request.getParameter("id");
sLat = request.getParameter("lat");
sLong = request.getParameter("long");
sTimestamp = request.getParameter("time");
StringBuffer sb = new StringBuffer();
sb.append(sId);
sb.append(",");
sb.append(sLat);
sb.append(",");
sb.append(sLong);
sb.append(",");
sb.append(sTimestamp);
sb.append("\r\n");
m_LatLongOutputStream.write(sb.toString().getBytes ());
System.out.println(sb.toString());
StringBuffer sb2 =
new StringBuffer("<html><body>");
sb2.append(sb.toString());
sb2.append("</body></html>");
response.getOutputStream().write(
sb2.toString().getBytes());
} Note: In part three of this series, we'll see how to take this information from the servlet and actually produce a map using GIS integration.
The URL from our MIDLet corresponds to our servlet from setting the values in the web.xml file. The content of the web.xml is shown in the code below.
<web-app>
<servlet>
<servlet-name>lbs</servlet-name>
<servlet-class>com.mobilogics.javanet.WhereAmIServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>2</param-value>
</init-param>
<init-param>
<param-name>validate</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Action Servlet Mapping -->
<servlet-mapping>
<servlet-name>lbs</servlet-name>
<url-pattern>/lbs.do</url-pattern>
</servlet-mapping>
<!-- The Welcome File List -->
<welcome-file-list>
<welcome-file>latlong.txt</welcome-file>
</welcome-file-list>
</web-app> Wrapping Up Part Two

In this part two, we brought in the LBS portion of an application by writing a simple MIDLet to get location information. We hooked it up to a server portion to demonstrate how the information gets to the server, and then what types of activities can take place. In part three, we'll generate a map based on the location information that we received from the device and tie everything together.
Download the sample code for this article: gis.zip (http://today.java.net/today/2004/04/01/gis.zip)
Sue Spielman (http://today.java.net/pub/au/54) is president and senior consulting engineer for Switchback Software LLC (http://www.switchbacksoftware.com/), author of a number of books, and a speaker on various Java topics around the country.
Tom Whitehill (http://today.java.net/pub/au/154) is the co-founder of Mobilogics and has been working with Java since 1995.

Bahmany
دوشنبه 24 دی 1386, 07:11 صبح
GeoMap API

GeoMap API شامل کلاس هایی طراحی شده برای محاسبات ارتفاع ، خطوط کشیده شده در نقشه ، نقطه های علامت گذاری شده و غیر است که در این پست معرفی می شه.

GeoMap for Java v1.0: A Java Mapping System for GIS Data
GeoMap is a collection of Java classes designed to display latitude and longitude coordinate data on an interactive canvas. This applet uses two input files specified as parameters in the html:
The tag file (TAGFILE (http://www.cbr.washington.edu/geomap/maps.tag)) specifies at what display level the various features should be displayed, tags that associate features with a color or image, and a initial map setting that specifies what the bounds are for the map.
The data file (DATAFILE (http://www.cbr.washington.edu/geomap/maps.dat)) specifies the various latitude and longitude coordinates to be associated with each object such as an island or a coastline.README (http://www.cbr.washington.edu/geomap/readme.html)
You're welcome to the source code (http://www.cbr.washington.edu/geomap/source.zip) or if you'd just like to try out the applet on your server without having to compile it just grab the applet and data files (http://www.cbr.washington.edu/geomap/applet.zip).
Note: If the map does not display when the message "Applet GeoMap running" appears at the bottom of your browser, click your mouse in the space below.

این لینک رو از دست ندید یه مثال هستش :
http://www.cbr.washington.edu/geomap/index.html


The GeoMap for Java tool was written in 1997. We do not provide support for GeoMap, nor are further developments of the tool planned. You are welcome to the source code. We have no restrictions on its use or distribution.
The GeoMap program assumes that latitude/longitude coordinates are in the Western and Northern hemispheres. You will need to modify the java source code to deal with this limitation if you are mapping other hemispheres.1 (http://www.cbr.washington.edu/geomap/readme.html#1)
You will need to transform your coordinates into the GeoMap format. We use inhouse Arcinfo macros to convert Arcinfo data to the data format used in the GeoMap program. We do not provide our inhouse macros as it is easier for you to write your own Arcinfo macros to convert your data than to try to use our inhouse macros.
The basic concept used for mapping is a file that specifies a series of latitude and longitude coordinates (in degrees, minutes, seconds) that describe an geographic object (river, coastline, island). You can see the file that generated the map if you click on "datafile" on the main GeoMap page.
The "Tag File" does not work correctly; the display levels do not work. The basic idea is to define display levels and tags. Tags are the area(s) that are defined in "datafile." In GeoMap, you have tags of the type island (polygon), river (line), coastline (line), reach (line), release_site (point), stock (point), dam (point), and fishery (point). Where you have geometric shapes (polygon and line), the colors are defined. For the other elements which are points, they are given an image to display.
The "datafile" defines exactly what to draw on the map.
island Puget_Sound_group # beginning of definition of a geometric shape & name
latlon 48 35 9 N 123 1 12 W # The points that define the shape
latlon 48 35 29 N 122 58 42 W # Latitude comes first in the form
latlon 48 35 15 N 122 56 47 W # Degree Minute Second Direction
latlon 48 34 50 N 122 55 2 W # followed by the same for Longitude
latlon 48 33 39 N 122 56 41 W
latlon 48 33 12 N 122 58 51 W
latlon 48 34 0 N 122 58 51 W
latlon 48 35 9 N 123 1 12 W
end (Puget_Sound_group) # end of points that define shape "island"

stock Mid Col R Brights # begin definition of a point of type "stock"
icon_location 45 42 00 N 122 20 00 W # latitude & longitude of point
end (Mid Col R Brights) # end of definition

boundary One # appears to be tag code no longer used
end (One)
######################################
#possible code work-around for Eastern hemisphere from D. Kittler
#Class JMapContentHandler.java
######################################

if (charHeading.equals("E")) {

lon=lon(-1.);
}

######################################
#so it works around Greenwich.
######################################








http://help.sap.com/saphelp_nw70/helpdata/en/images/object.gif GeoMap API http://help.sap.com/saphelp_nw70/helpdata/en/images/locate.gif (http://help.sap.com/saphelp_nw70/helpdata/en/fe/f7f23ea4b42e5ae10000000a114084/frameset.htm)

Definition

You can use the GeoMap UI element to display a section of a map.
You use the values of the properties top, left, bottom, and right to specify the geographical coordinates and define the map section to be displayed. The geographical coordinates are derived from the longitude and latitude values of a geographical location and must be entered in WGS84 format based on the reference system World Geodetic System –1984 (WGS84).
The following values show a geographical section of Walldorf/Heidelberg:
top: 49.4304
left: 8.5082
bottom: 49.2000
right: 8.7922

http://help.sap.com/saphelp_nw70/helpdata/en/fe/f7f23ea4b42e5ae10000000a114084/h-00100020000_image001.gif
http://help.sap.com/saphelp_nw70/helpdata/en/images/achtung.gif
The GeoMap UI element can only be used with a special software component that is provided by the geographical maps.
This software component which you can use to expand the Internet Graphics Service (IGS) is not included in the delivered SAP Web Application Server package. It must be purchased from a third-party provider. The GeoMap UI element cannot be displayed without this complementary software component.
Property Descriptions

● accessibilityDescription
When accessibility is activated, the assigned text is added to the tooltip. This description provides semantic details of the UI element and is only read by the screen reader if the user focuses the complete Ul element.
● bottom
You can use this property to specify the value of a geographical coordinate in decimal numbers according to the standard World Geodetic System – 1984 (WGS84). Together with the value of the right property, the lower right position of the section is specified.
● geoObjectSource
You can position so-called geo objects in the map and use them to highlight a specific position. These geo objects are used to provide specific information to the user. For example, you can mark the starting point or finishing point of a route on the map. This property must be bound to a context attribute.
● height
Specifies the height of the UI element in pixels.
● igsURL
You can use this property to specify the Web address (URL) of the server on which the Internet Graphics Service is to run. This means that you can overwrite the global URL for which the http://help.sap.com/saphelp_nw70/helpdata/en/images/book.gifWeb Dynpro System Configuration (http://help.sap.com/saphelp_nw70/helpdata/en/43/8a1a8ece230c8ce10000000a11466f/frameset.htm) in the default.properties file has been set.
● left
You can use this property to specify the value of a geographical coordinate in decimal numbers according to the standard World Geodetic System – 1984 (WGS84). Together with the value of the top property, the upper left position of the section is specified.
● moveType
This property specifies whether the geographical border of a map can be interactively changed by the user. The moveType property can be filled with the following values and is represented by the enumeration type WDMoveType:
none
You cannot change the geographical border.
panel
Control elements allow you to change the geographical border.
● right
You can use this property to specify the value of a geographical coordinate in decimal numbers according to the standard World Geodetic System – 1984 (WGS84). Together with the value of the bottom property, the lower right position of the section is specified.
● top
You can use this property to specify the value of a geographical coordinate in decimal numbers according to the standard World Geodetic System – 1984 (WGS84). Together with the value of the left property, the upper left position of the section is specified.
● width
Specifies the width of the UI element in pixels.
● zoomType
Specifies the zoom behavior of the map. The zoomType property can be filled with the following values and is represented by the enumeration type WDZoomType:
none
Zooming within the map is not possible, and no control elements for zooming are available.
panel
Zooming within the map is possible.



و اینهم لینکش :
http://help.sap.com/saphelp_nw70/helpdata/en/fe/f7f23ea4b42e5ae10000000a114084/content.htm



یک نصیحت دوستانه
عزیزان سعی کنید رو این ضمینه یعنی GIS+JAVA کار کنید هم مایه زیاد داره و هم کار جالبیه دوستانیکه به این گونه طراحی ها مسلط هستند لطفا با بنده در ارتباط باشند ( در خصوص انجام پروژه )

handinux
دوشنبه 24 دی 1386, 13:27 عصر
دوست عزیزم آقای بهمنی.فکر می کنم اگر آن چیزی را که خودتان از این موضوع فهمیده اید و برداشت کرده اید را به طور خلاصه و به فارسی بیان کنید دوستان برای همکاری ترغیب شوند.متاسفانه متنی شما قرار داده اید بسیار طولانی است و وقت هم کم.اگر خلاصه ای از آن را بیاورید من بسیار مشتاقم با شما همکاری کنم.پایدار باشی

zehs_sha
سه شنبه 25 دی 1386, 11:01 صبح
اولا من تشکر می کنم از کار قشنگ شما


گر آن چیزی را که خودتان از این موضوع فهمیده اید و برداشت کرده اید را به طور خلاصه و به فارسی بیان کنیمن با هردو صورت انگلیسی و فارسی (برداشت شما) موافقم

ravanfar
سه شنبه 25 دی 1386, 18:47 عصر
سلام
با تشکر از آقای بهمنی عزیز بخاطر مقالات باارزشی که معرفی نمودید.
خالی از لطف ندیدم که آدرس زیر را معرفی کنم یک پروژه "کدباز" است که کار بسیار بسیار ارزشمندی انجام شده و در حال حاضر در داخل کشور و خارج از کشور در مراکز دانشگاهی و پژوهشی تخصصی مشتری دارد، بطور کلی تلفیقی از GIS و Seismic Hazard Analysis و پهنه بندی های تحلیل خطرهای ریسک ناشی از زمین لرزه بوده و بسیار بسیار ارزشمند و با مبنای علمی قوی و معتبر و مورد حمایت مراکز معتبر علمی نظیر (USGS/SCEC) و (PEER/UCLA) و (EQE International)میباشد، منابع و کدهای آن نیز جهت توسعه در دسترس بوده و توسط JAVA SUN STUDIO براحتی قابل تغییر و توسعه است.
http://www.opensha.org/
حتما ببینید چرا که بسیار ایده دهنده است (علی الخصوص برای بچه هایی که کار تحلیل ریسک دارند)

Bahmany
چهارشنبه 26 دی 1386, 09:29 صبح
بروی چشم حتما در اولین فرصت این کاررا ( ترجمه فارسی ) کرده و در سایت قرار می دهم.
از استاد روانفر نیز جهت ارائه اطلاعاتشون ممنونم .

fahimi
سه شنبه 19 مهر 1390, 16:10 عصر
جناب آقایی Bahmany
نوشته اید "توی جایی کار با سیستم های تجزیه و تحلیل نقشه مطرح بود
خوب بنده این کار رو با دلفی به پایان رسوندم" اگر امکانش هست تجزیه تحلیل نقشه را با دلفی شرحی بدهید