leelight's blog

MyEclipse+Hibernate 4--Connect to Oracle Database

The connection with Oracle Database has the same step when you connect with MySQL database. The difference lies on the selection of Driver JARs.

In DB Browse, click new icon to create a new connection.

Click Configure database driver:

Add new drivers:

giMapper, an alternative open source project MapServer

The geographical information web Mapper, giMapper, has been developed as an alternative to the well established open source project MapServer. It uses Shapefiles as data source to display the map, your system requirement are only listed as below:HTML, javascript, PHP (v4.3+) and GD (v1.6+), without Database and other software. Of cource, using Shapefiles a datasource directly means the toolkit reads and parses the data at first and then draw the vector data through PHP GD function, just like UMN Mapserver has done. But this way is not efficient, unless your server side is programmed with C++. It is an embarrassed task for PHP, exactly to say.

But giMapper has its reason to do that: "We needed a way of browsing a UK map which had hot spots identifying particular places or people. The project started to use MapServer but it soon became evident that to use MapServer in the final application would require access to the server's root for installation and configuration - something we did not have." OK, the toolkit points to the users, who have not their own host server and the Server does not support Database, or installation of other software(such as UMN MapServer). I am lucky, my server support Database at least :)

The toolkit includes Server side and map browser client. You should know, giMapper is not based on OGC WMS standard, but i can publish map well.

Some of the features of giMapper :

WebGIS-China - Interactive maps, data and diagrams about China Recent Climate Change

I found one WebGIS application for china recent climate change here, http://www.webgis-china.de/, some scholars from Gutenberg University did that. The website assesses recent Climate Change in China over the past 50 years. " Well-adopted statistical methods of trend computations that are commonly applied for climatic change studies were applied for this study based on monthly temperature records over the 50 year observation period 1951 - 2000 for totally 165 main meteorological stations. The reference stations are located all over China though they are preferably distributed over the eastern part of the country."

53 CSS-Techniques You Couldn’t Live Without-and many other CSS and Scripts from smashing magazine

If you are a web designer, I am sure you will like it, 53 CSS-Techniques You Couldn’t Live Without, from a wonderful site, smashing magazine. The webmaster of the site did great effort to collect those things, I really appreciate that! Here I just list some of it, and take it into my bookmark. You can go there to get the full list.
4. CSS Bar Graphs (CSS For Bar Graphs)


Combine PDF with GIS?

Is there some relationship between PDF and GIS? As I thought before, it is enough to display the map using PDF. Interaction with PDF? Just like SVG, Flash, or Ajax? Interesting but impossible. But GeoPDF from Terragotech has broken the embarrass.
You need download one small plugin for Arcobat PDF reader, it is free.
The GeoPDF Toolbar allows you to view multiple coordinate display, re-project to most coordinate systems, measure distance and bearing, zoom to any coordinate, and connect to GPS and track. Here you can view some demo how to use it.

Touch J2ME Polish--6. GUI DIY with CSS style definition

I MUST say firstly that using CSS to define the GUI in J2ME application is a VERY VERY SMART idea!
What is CSS?
Cascading Style Sheets, was widely used in XHTML and webdesigning, the designers cant separate the style from the HTML userinterface, that means the programmer can only do his part of HTML interface designing, and the beautification and decoration of interface could be left to art designer. For example, look at the menu of this page, if one day I am tired of the current style of easywms.com, I DO NOT have to modify the HTML code for each page, I just need modify the css file and every page will change its style. 

Overlaying Google Map with MapInfo point data using Map2GMap

For MapInfo Professional a small MapBasic application called Map2GMap (right-click for download) has been programmed which generates a complete HTML page which integrates Google's Map object overlayed with point data from a MapInfo table. By clicking on a marker an info window pops up displaying attribute information gained from the objects in the table.

Prof. Behr has brought us this software 2 years ago, but I just got to know this morning. I think more people could need it. What you need is install this plugin in MapInfo and apply for a Google map key for your website and output the fully html file. The html containing the points geometries and javascript code for controlling. Copy the html file to your website and view.

WMS Sites, A collection of useful Web Mapping Service sites

Today I happened to find one interesting site for WMS server: http://wms-sites.com/
This site is one collection of useful Web Mapping Service sites, which aimimg to be a visual catalog of public Web Mapping Service (WMS) resources online.

The webmaster has collected many WMS servers, and you can view the WMS Layers.
To browse the WMS sites in the catalog, enter some keywords in search box above, or see site listings in the catalog.  By following links to individual layers, you can see those mapped layers.  Sample searches: weather, ortho-photos, boundaries, topography, transportation.

Happy Chinese New Year for Everyone Here!!!

Hi, everyone who visits my site today, happy chinese new year!
Today is chinese New Year's Eve, And tomorrow is chinese Pig Year~~
Pig in Germany means lucky, in China also means prosperity and happiness.

And I wish you  and your family, your lover will be happy, peace and health in the new year!!!!


Touch J2ME Polish--5. First Application, begin with Loading Splash Screen

If you have used some J2ME applicaitons, e.g. some games, almost all of them will give you one loading splash screen when you start the game, or before you enter the next stage the waiting splash screen will tell you the progress of data loading. The standard solution is to provide a splash screen and do the necessary initialization in a background thread. And if you have done this before, your code will look like this:

//firstly difine one class to draw the logo and string on canvas
    public class SplashCanvas extends Canvas {
        protected void paint(Graphics g){
            try {
            } catch (java.io.IOException e) {
                System.out.println("Load image error when initializing Exception happens:" + e.getMessage());
            g.drawImage(icon_start,getWidth()/2, getHeight()/2-15, Graphics.BOTTOM| Graphics.HCENTER);
            g.drawString("EasyWMS 1.00", getWidth()/2, getHeight()/2, Graphics.BOTTOM| Graphics.HCENTER );
            g.drawString("Loading...", getWidth()/2, getHeight()/2+15, Graphics.BOTTOM| Graphics.HCENTER );
        protected Graphics clearScreen(Graphics g) {
              // clear screen
              g.setColor(255, 255, 255);
              g.drawRect(0, 0, this.getWidth(), this.getHeight());
              return g;

//will run the splash screen in one background thread, for the further calling
   public class SplashScreen implements Runnable{
        private SplashCanvas splashCanvas;
        public void run(){
            splashCanvas = new SplashCanvas ();     
                }catch(Exception e){}

//impletement this class as one thread, like this:
//public class genisMIDlet extends MIDlet implements Runnable{
//then give the run method
    public void run(){
            // soft loop          
//the splash will keep on displaying 3 seconds and then go to the main form automatically
    private void doTimeConsumingInit(){
        // Just mimic some lengthy initialization for 3 secs
        long endTime= System.currentTimeMillis()+3000;
        while(System.currentTimeMillis()<endTime ){}

        controller=new UIController(this);

//at last,  open 2 threads when initialize the application
    protected void startApp() throws MIDletStateChangeException {
        Thread splashthread= new Thread(new genisMIDlet.SplashScreen());

     //now you can also load the data from database or something.....
        Thread thisThread = new Thread(this);

And if there are others progress need to give the user one waiting screen, those code will be write again with differnt string and image. Are you tired? Yes, I am tired of this.Polish provides the de.enough.polish.ui.splash.InitializerSplashScreen for this task. The splash screen shows an image along with an optional string message and initialize the actual application in a backgroud thread.  This is the code example:

package de.enough.polish.sample.splashScreen;

import java.io.IOException;

import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;
import javax.microedition.lcdui.*;
import de.enough.polish.ui.splash.InitializerSplashScreen;
import de.enough.polish.ui.splash.ApplicationInitializer;;

public class SplashScreenDemo extends MIDlet
//#if !polish.clases.ApplicationInitializer:defined
    implements ApplicationInitializer
    private Screen mainScreen;
    private Display display;
    protected void startApp() throws MIDletStateChangeException {
        this.display = Display.getDisplay(this);
        if(this.mainScreen !=null){
            //the MIDlet has been paused;
              //the MIDlet is started for this first time
                  Image image = Image.createImage("/welcome.png");
                  int backgroundColor = 0xFFFFFF;
                  String readyMessage = "Press any key to continue...";
                  //Set readyMessage = null to forward to the next
                  //displayabe as soon as it's available
                  int messageColor = 0xFF0000;
                  InitializerSplashScreen splashScreen = new InitializerSplashScreen(this.display
                  ,image, backgroundColor, readyMessage,messageColor,this);
              }catch(IOException e){
                throw new MIDletStateChangeException("Unable to load splash image");

    public Displayable initApp(){
        //initialize the application.e.g. read data from record store,etc
        //now create the main menu screen:
        //e.g. this.mainScreen = new Form("Main Form");

        this.mainScreen = new Form("Main Form");

        return this.mainScreen;

    protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
        // TODO Auto-generated method stub

    protected void pauseApp() {
        // TODO Auto-generated method stub
Splash Loading Screen:

Go to the main Form:

Have you seen that, only one function could do everything, creates a new InitializerSplashScreen using the internal default view.
public InitializerSplashScreen(Display display, Image image, int backgroundColor, java.lang.String readyMessage, int messageColor, ApplicationInitializer initializer)The message will be shown in the default font.Parameters:

Syndicate content