1. Tuyển Mod quản lý diễn đàn. Các thành viên xem chi tiết tại đây

Dành cho những chủ đề chỉ có một câu hỏi

Chủ đề trong 'Câu lạc bộ kỹ sư' bởi small_porcupine, 10/05/2005.

  1. 1 người đang xem box này (Thành viên: 0, Khách: 1)
  1. lan0303

    lan0303 Thành viên mới

    Tham gia ngày:
    24/05/2003
    Bài viết:
    2.622
    Đã được thích:
    0
    VII.ngôn ngữ java
    1. Cú pháp của Java:
    Ngôn ngữ Java hoàn toàn tương tự như C++. Trong phần này chúng ta sẽ đi sâu xem xét cú pháp và các từ khoá (keyword) của Java. Các thành phần của ngôn ngữ này bao gồm:
    Lời chú thích (comment) : Những dòng chú thích của lập trình viên nhằm làm chương trình dễ hiểu hơn.
    Các phát biểu (statement) : Mỗi phát biểu là một "dòng" trong chương trình.
    Các khối mã lệnh (code block) : Tập hợp các phát biểu được gộp với nhau thành một đơn vị nhất định.
    Cấu trúc tập tin (file structure) : Các thành phần của một tập tin nguồn Java, thứ tự của chúng trong đó.
    Từ khoá (keyword) : Các từ được định nghĩa trước trong ngôn ngữ Java (không được dùng các từ này làm từ định nghĩa).
    Từ định danh (identifier) : Tên bạn đặt cho các lớp, biến hay hàm. Từ định danh có một số giới hạn về ký tự đứng đầu.
    Cách viết (literal) : Các hằng số được viết một cách khác nhau tuỳ theo kiểu dữ liệu (lấy ví dụ, để phân biệt người ta viết "123" là xâu ký tự, còn 123 là số nguyên).
    Biểu thức (expression) : Kết hợp của một hay nhiều các phép tính nhằm tính ra một giá trị nào đó.
    Các tác tử (operator) : Các tác tử thực hiện lệnh cộng, trừ, nhân, chia.. và các toán tử logic.
    Các thành phần ngôn ngữ Java sẽ lần lượt được trình bày khái quát trong các phần sau:
    1.1. Chú thích (comment):
    Có hai cách thêm các dòng chú thích vào trong tập tin nguồn Java:
    a. Dùng cặp /* và */ để bao một hay nhiều dòng chú thích:
    /* Ðây là chú thích
    Nó sẽ bị bỏ qua khi dịch chương trình */
    b. Dùng hai ký tự // để tạo ra một đoạn chú thích kể từ vị trí đó đến cuối dòng:
    a = b + c; //Tính tổng hai số trong b và c
    1.2. Phát biểu (statement):
    Phát biểu là một "dòng" riêng biệt trong mã Java. Chú ý rằng không có sự tương đương giữa "dòng" trong mã lệnh với dòng trong tập tin nguồn. Lấy ví dụ:
    a = b + c + d + e + f + g; // Ðây là một phát biểu

    a = b + c // Ðây cũng là một phát biểu
    + d + e + f + g;
    Khoảng cách giữa các thành phần của một phát biểu có thể dài tuỳ ý, bao gồm các ký tự trống (whitespace) : Dấu trống (space), ký tự tab, ký tự hết dòng và ký tự về đầu dòng (cr và lf).
    Lưu ý: Trên UNIX, kết thúc dòng là ký tự hết dòng (carriage return - mã ASCII 13). Với Windows, các dòng văn bản lại kết thúc bằng ký tự hết dòng và ký tự về đầu dòng (linefeed - mã ASCII 10). Bộ biên dịch Java coi tất cả các ký tự này là ký tự trống, do đó tương thích trên cả UNIX và Windows.
    1.3. Khối mã lệnh:
    Các phát biểu có thể đứng gộp với nhau thành một nhóm, điều này giúp một phát biểu đơn nào đó có thể dễ dàng điều khiển việc thực hiện của một nhóm lệnh khác. Khối mã lệnh Java được giới hạn trong dấu "{" và "}". Chúng ta có thể thấy một khối mã lệnh để nhóm các phát biểu thuộc về một lớp:
    class Flight {
    int altitude;
    int heading;
    int speed;

    void turnFlight(int angle){
    heading = (heading + angle) % 360;
    if (heading < 0) heading = heading + 360;
    }
    } // End of class Flight
    Như thấy trên ví dụ, một khối mã lệnh có thể đặt ***g trong một khối mã lệnh khác.
    1.4. Cấu trúc tập tin nguồn Java:
    Một tập tin nguồn chỉ chứa 3 kiểu phát biểu ngoài các khối mã lệnh:
    Phát biểu package : Phát biểu này định nghĩa một gói mà các lớp trong tập tin này nằm trong đó.
    Phát biểu import : Phát biểu này cho phép quy chiếu đến một hay nhiều lớp đã có (như các lớp trong API) thông qua tên lớp.
    Phát biểu class : Ðịnh nghĩa lớp mà bạn muốn tạo.
    Các phát biểu import và package đều là tuỳ chọn, nhưng nếu có mặt các phát biểu này, chúng ta phải xếp đúng theo trình tự ở trên (tức là package, import, rồi cuối cùng mới đến class).
    Ví dụ:
    package com.sybex.examples;
    import java.awt.Panel;
    import java.awt.Color;
    class ColorPanel extends Panel{
    // Ðịnh nghĩa của lớp ColorPanel được đặt ở đây
    ...
    }
    Ðoạn mã trên định nghĩa một lớp mới tên là ColorPanel thuộc về gói có tên là com.sybex.examples. Những chương trình khác khi dùng lớp này sẽ quy chiếu đến nó với tên com.sybex.examples.ColorPanel.
    Phát biểu import đơn giản hoá việc quy chiếu đến một lớp trong một gói đã có sẵn. Gói java.awt là gói Abstract Windowing Toolkit của Java, đây là một phần cơ bản của Core API. Phát biểu import đầu tiên trong ví dụ trên cho phép chúng ta gọi đến java.awt.Panel một cách đơn giản là Panel. Tương tự, trong phát biểu import thứ hai cho phép bạn chỉ đến lớp Color trong gói java.awt bằng tên của nó mà thôi.
    Phát biểu cuối cùng là phát biểu class dùng để định nghĩa lớp. Chú ý rằng đây là một phát biểu kép, nghĩa là nó bao gồm một khối các phát biểu. Sau định nghĩa lớp này, chúng ta có thể có một vài phát biểu lớp phụ khác.
    1.5. Từ khoá:
    Một từ khoá là từ có ý nghĩa đặc biệt đối với bộ biên dịch Java, ví dụ như từ để định nghĩa kiểu dữ liệu.. Các từ khoá được liệt kê trên bảng sau:
    Bảng II.01 : Các từ khoá của Java
    abstract boolean break byte
    case catch char class
    const* continue default do
    double else extends final
    finally float for goto*
    if implements import instanceof
    int interface long native
    new null package private
    protected public return short
    static super switch synchronized
    this throw throws transient*
    try void volatile while
    * là các từ khoá chưa được sử dụng trong phiên bản hiện tại của Java (dành cho tương lai).
    1.6. Từ định danh (identifier):
    Một từ định danh là tên đặt cho một biến, lớp, hoặc hàm. Bạn có thể chọn bất cứ thứ gì làm từ định danh, miễn là nó bắt đầu bằng một chữ cái (a..z và A..Z) và không trùng với từ khoá nào. Cần chú ý rằng Java là ngôn ngữ phân biệt hoa - thường (case sensitive).
    Chúng ta có một số quy định về cách đặt tên định danh. Tuy nhiên quy định này là không bắt buộc, nó chỉ nhằm mục đích làm chương trình trở nên dễ đọc, dễ hiểu. Bảng sau đây đưa ra một số quy định đặt tên định danh:
    Bảng II.02 : Quy định đặt tên định danh
    [​IMG]
    Được lan0303 sửa chữa / chuyển vào 00:57 ngày 15/11/2005
  2. lan0303

    lan0303 Thành viên mới

    Tham gia ngày:
    24/05/2003
    Bài viết:
    2.622
    Đã được thích:
    0
    1.7. Quy tắc viết các giá trị (literal):
    Cách viết các kiểu dữ liệu chuẩn của Java được liệt kê đầy đủ trong bảng 03.

    Bảng II.03 : Khuôn dạng biểu diễn dữ liệu của Java
    [​IMG]
    Bảng II.04 : Chuỗi thoát ký tự
    [​IMG]
    1.8. Biểu thức và các tác tử:
    Biểu thức là tập hợp của các biến, từ khoá hay biểu tượng tương ứng với một giá trị nào đó. Giá trị này có thể là số, xâu ký tự, hay một lớp hoặc kiểu dữ liệu khác. Biểu thức có thể coi như bất cứ thứ gì viết ở phía bên phải của phát biểu gán:
    Một biểu thức đơn giản như sau:
    a // Một biến
    15 // Một giá trị số
    "Hello" // Một xâu ký tự
    Ví dụ sau đây gán xâu ký tự "Hello" vào một biến s:
    s = "Hello";
    Cũng giống như C, một phát biểu gán của Java cũng trả về giá trị được gán ở phía bên phải, lấy ví dụ: Phát biểu sau đây gán cho b bằng 15, đồng thời trả về giá trị 15 đặt vào biến a:
    a = b = 15;
    a. Hàm và biến thành phần của một đối tượng:
    Một kiểu biểu thức khác là gọi hàm thành phần (member function). Một hàm có thể tính toán và trả về giá trị, do đó chúng có thể được đặt phía bên phải một biểu thức gán:
    a = incomingFlight.getHeading();
    Cấu trúc chung để gọi hàm hoặc biến thành phần của một đối tượng như sau:
    đối_tượng.biến_thành_phần hoặc
    đối_tượng.hàm_thành_phần(các tham số)
    Trong trường hợp các hàm hay biến thành phần là tĩnh (static), chúng ta có thể gọi thông qua tên lớp:
    lớp.biến_thành_phần hoặc
    lớp.hàm_thành_phần(các tham số)
    b. Cấp phát bộ nhớ cho đối tượng:
    Cấp phát bộ nhớ đối tượng với Java chỉ là một cách gọi đặc biệt đến hàm thành phần. Ðể tạo một đối tượng trên bộ nhớ, chúng ta chỉ việc dùng từ khoá new khi gọi hàm dựng (constructor) của lớp đó:
    Flight f; // Khai báo biến f là kiểu Flight
    f = new Flight(); // Cấp phát và khởi tạo đối tượng
    hoặc viết ngắn gọn hơn:
    Flight f = new Flight();
    Chú ý rằng nếu một lớp được tạo ra không có hàm dựng, Java sẽ tạo ra một hàm dựng mặc định không có tham số. Tuy nhiên, nếu như đã có hàm dựng với tham số, chúng ta không thể dùng hàm dựng mặc định này nữa.
    c. Các từ khoá this và super:
    Hai từ khoá đặc biệt này cũng được dùng trong các biểu thức. Từ khoá this tương ứng với tên đối tượng hiện thời, còn từ khoá super để chỉ lớp cha của đối tượng hiện thời. Lấy ví dụ, chúng ta có thể dùng từ khoá this để yêu cầu đối tượng bất kỳ in thông tin về chính bản thân nó;
    VII.ngôn ngữ java
    4. Phạm vi của biến:
    Từ những ngôn ngữ lập trình sơ khai, mọi biến khai báo đều là toàn cục (global), nghĩa là mọi phần khác nhau trong chương trình đều có thể xem, sửa làm thay đổi biến này. Việc theo dõi sự biến đổi của các biến này trở nên rất phức tạp, dẫn đến chương trình khó bắt lỗi, khó nâng cấp.. Thêm vào đó, khi tất cả các biến là toàn cục, chúng ta phải đặt cho các biến này những tên khác nhau (không được đặt trùng tên).
    Ðể giải quyết vấn đề này, người ta đưa ra biến cục bộ (local), là những biến có thời gian sống hữu hạn, chỉ có thể nhìn thấy trong một phần nào đó của chương trình. Như vậy, chúng ta có thể dùng hai biến cùng tên, miễn là chúng nằm ở những phần khác nhau của chương trình. Khả năng một biến được "nhìn thấy" từ một phần nào đó của chương trình tuỳ thuộc phạm vi của biến đó.
    Với Java (hay C và C++), một biến khai báo trong một khối mã lệnh (code block) sẽ là biến cục bộ của khối đó (nếu không có những từ khoá đặc biệt đi kèm). Nó được tạo ra trong khối và huỷ đi khi ra khỏi khối. Những khối mã lệnh con trong khối mẹ có thể truy cập đến biến cục bộ của khối mẹ, nhưng khối mẹ hay các khối con khác không có quyền truy xuất đến biến cục bộ của một khối con nào đó.
    class MyClass {
    int i; // Biến thành phần của lớp
    int First () {
    int j; // biến cục bộ
    String temp; // biến cục bộ
    // Chúng ta có thể đọc và thay đổi cả i và j ở đây
    return 1;
    }
    int Second () {
    int j; // biến cục bộ
    // Chúng ta có thể đọc và thay đổi cả i và j ở đây
    // nhưng không thể đọc và thay đổi xâu ký tự temp..
    return 2;
    }
    }
    Như chúng ta thấy, biến j được khai báo trong hàm thành phần First và Second nhưng chúng hoàn toàn độc lập với nhau. Ðiều này tránh cho người lập trình phải đặt những tên khác nhau như j1 và j2.. Hơn nữa, đây là cách che dấu dữ liệu theo từng mức, làm chương trình đơn giản hơn.
    5. Các từ khoá (modifier):
    Các từ khoá cho phép thay đổi thời gian tồn tại hoặc phạm vi của lớp, biến, hay các hàm thành phần. Danh sách các từ khoá của Java trên bảng II.0x cho phép chúng ta thấy được khả năng kết hợp của các từ khoá với các hàm hay biến..
    Bảng II.0x : Từ khoá dùng kết hợp với lớp, hàm thành phần,
    biến thành phần và biến cục bộ

    [​IMG]
    VII.ngôn ngữ java
    5.1. Từ khoá abstract:

    Khi dùng cho một lớp, từ khoá abstract cho biết lớp này chưa được phát triển đầy đủ, không được tạo đối tượng từ nó. Nếu được dùng cho hàm thành phần, từ khoá abstract cho biết hàm đó sẽ được phát triển đầy đủ ở các lớp con. Khi đó, vì hàm thành phần chưa thành hình, lớp đó cũng được coi là khai báo abstract nhằm tránh việc tạo đối tượng từ lớp và gọi đến các hàm "ảo". Các giao diện (interface) được mặc định là abstract.
    Ví dụ:
    public abstract class java.net.SocketImpl
    extends java.lang.Object {
    // Các trường:
    protected InetAddress address;
    protected FileDescriptor fd;
    protected int localport;
    protected int port;

    // Hàm dựng
    public SocketImpl();
    // Các hàm thành phần
    protected abstract void accept(SocketImpl s);
    protected abstract int available();
    protected abstract void bind(InetAddress host, int port);
    protected abstract void close();
    protected abstract void connect( InetAddress address,
    int port);
    protected abstract void connect(String host, int port);
    protected abstract void create(boolean stream);
    protected FileDescriptor getFileDescriptor();
    protected InetAddress getInetAddress();
    protected abstract InputStream getInputStream();
    protected int getLocalPort();
    protected abstract OutputStream getOutputStream();
    protected int getPort();
    protected abstract void listen(int count);
    public String toString();
    }
    5.2. Từ khoá static:
    Thông thường, mỗt đối tượng trong cùng một lớp sẽ có bản sao riêng biệt tất cả các biến thành phần. Tuy nhiên, đôi khi người ta cần đến một biến thành phần chung cho tất cả các đối tượng của lớp đó. Một biến thành phần như vậy được gọi là static (biến tĩnh), khi khai báo có đi kèm với từ khoá static. Lấy ví dụ một lớp sau đây (MyClass) được thiết kế sao cho nó có thể đếm số đối tượng được tạo ra của lớp:
    public class MyClass{
    // Khai báo biến dùng chung cho các đối tượng
    // khác nhau của lớp MyClass
    public static int Counter;
    // Hàm dựng đối tượng
    public MyClass (){
    // tăng biến tĩnh của lớp đó
    Counter++;
    }
    // Hàm tĩnh dùng để đặt Counter về 0
    public static void resetCounter(){
    Counter = 0;
    }

    // Ðoạn mã khởi tạo lớp MyClass
    static { Counter = 0; }
    }
    Một hàm thành phần có thể khai báo là hàm tĩnh bằng từ khoá static. Ví dụ như hàm resetCounter() được dùng để đặt biến Counter về 0. Lúc này hàm có thể gọi thông qua đối tượng hoặc trực tiếp bằng tên lớp:
    // Ðối tượng thứ nhất được tạo ra, Counter = 1
    MyClass n = new MyClass();
    // Ðối tượng thứ hai tạo ra, Counter = 2
    MyClass m = new MyClass();
    System.out.println(MyClass.Counter+" đối tượng vừa được tạo!");

    m.resetCounter(); // hoặc MyClass.resetCounter() cũng đúng

    Lớp System trong gói java.lang khai báo tất cả các hàm và biến thành phần của nó là static. Như vậy, chúng ta có thể dùng trực tiếp các hàm và biến này thông qua tên lớp. Khi đó không cần tạo ra đối tượng thuộc lớp System:
    System MySystem = new System(); // Không được phép!
    // Ðược phép vì out đã khai báo static
    System.out.println("Chào các bạn!");
    //Ðược phép vì hàm này đã khai báo static
    long timeNow = System.currentTimeMillis();
    5.3. Từ khoá synchronized:
    Java cho phép chạy nhiều tác vụ một lúc (đa luồng). Tuy nhiên, đôi khi hai tác vụ cùng thực hiện và truy cập đến một hàm có thể dẫn đến xung đột. Từ khoá synchronized dùng để định nghĩa một hàm thành phần nào đó là đồng bộ (nghĩa là trong cùng một thời điểm, chỉ có một thread được gọi đến hàm này).
    5.4. Từ khoá native:
    Các hành vi được khai báo native sẽ được thực hiện bằng ngôn ngữ khác (chẳng hạn C) do đó chúng không có phần mã lệnh. Rất nhiều hàm trong Core API có kiểu native bởi chúng cần truy cập đến các lệnh mức thấp của hệ điều hành. Ví dụ:
    /**
    * Trả về giá trị sin của một góc
    * tham số a là một góc tính theo radians
    */
    public static native double sin (double s);
    Hàm native trên đây gọi đến thư viện chuẩn của hệ điều hành để tính sin góc s. Ðối với hệ Intel x86, đây là lệnh của bộ đồng xử lý, trong khi với các hệ khác có thể là do phần mềm tính toán.
    Hai từ khoá native và synchronized chỉ được dùng đối với hàm thành phần.
    5.5. Từ khoá volatite:
    Một biến khai báo là volatile sẽ biến động tuỳ ý, không thể giả định rằng nó mang một giá trị nào xác định (giống với từ khoá volatile của C++).
    5.6. Từ khoá transient:
    Hiện nay từ khoá này không có tác dụng gì đối với trình biên dịch Java. Nó sẽ được sử dụng trong tương lai để tạo đối tượng "bền" (tức là không huỷ đi khi chương trình kết thúc).
    5.7. Từ khoá final:
    Hầu hết các ngôn ngữ đều cho phép khai báo một biến nào đó như hằng số (nghĩa là không thay đổi được). Với Java, để khai báo một biến như vậy, chúng ta phải thêm từ khoá final. Nếu đã khai báo final, chúng ta phải gán giá trị khởi đầu cho nó luôn:
    final int MAX_CHANNEL = 10;
    Lớp và hàm cũng có thể khai báo là final. Nếu có từ khoá này trong khai báo một lớp, chúng ta không được quyền tạo các lớp con từ lớp này. Ví dụ, các lớp trong gói Math (hàm toán học) được khai báo final. Một hàm final sẽ không còn khả năng nạp chồng ở các lớp con.
    5.8. Từ khoá private:
    Từ khoá này giới hạn khả năng truy cập của biến hoặc hàm từ phía bên ngoài lớp. Chỉ có các hàm bên trong lớp đó mới có quyền truy cập đến các biến hoặc hàm khai báo private.
    5.9. Từ khoá protected:
    Từ khoá protected quy định biến hoặc hàm đó được "nhìn thấy" bởi hàm trong lớp đó hoặc các lớp con của lớp đó. Các lớp con có thể nằm trên các gói (packet) khác nhau.
    5.10. Từ khoá private protected:
    Từ khoá private protected tương tự như protect, nhưng giới hạn hơn: các lớp con cùng gói với lớp mẹ mới nhìn thấy các hàm và biến này.
    VII.ngôn ngữ java
    6. Các câu lệnh điều khiển:

    Java kế thừa và phát triển các câu lệnh điều khiển của C/C++. Chúng ta sẽ lần lượt xem xét các câu lệnh này ở phần này.
    6.1. Các câu lệnh điều kiện:
    a. Phát biểu if:
    if (biểu-thức-điều-kiện)
    phát-biểu-if
    else
    phát-biểu-else
    Phát biểu if đầu tiên sẽ kiểm tra biểu thức điều kiện. Nếu biểu thức này trả về giá trị true, phát biểu (hoặc khối các phát biểu) trong phần phát-biểu-if sẽ được thực hiện. Ngược lại, phần phát-biểu-if sẽ được thực hiện. Các lệnh if có thể ***g nhau.
    Ðôi khi người ta còn sử dụng toán tử ? : để thay cho lệnh if, nhằm đơn giản hoá câu lệnh. Chúng ta có thể xem ví dụ sau:
    int mark = 8;
    char grade;
    if (mark >= 9) // Nếu đạt điểm trên 9
    grade = ''''A''''; // xếp loại A
    else if (mark >= 8) // Nếu đạt điểm trên 8 (nhưng < 9)
    grade = ''''B''''; // xếp loại B
    else if (mark >= 5) // Nếu được điểm trên 5 (nhưng < 8)
    grade = ''''C''''; // xếp loại C
    else grade = ''''D''''; // Còn lại, xếp loại D
    Tất cả các lệnh if ở trên được thay bằng toán tử ? :
    int mark = 8;
    char grade= (mark >= 9) ? ''''A'''' :
    (mark >= 8) ? ''''B'''' :
    (mark >= 5) ? ''''C'''' : ''''D''''
    b. Phát biểu switch:
    switch (biểu-thức) {
    case giá-trị-1:
    Ðoạn-mã-1;
    case giá-trị-2:
    Ðoạn-mã-1;
    case giá-trị-3:
    Ðoạn-mã-1;
    ...
    default:
    Ðoạn-mã-mặc-định;
    }
    Khi thực hiện lệnh switch, biểu thức trong ngoặc được đánh giá. Quyền điều khiển sẽ chuyển đến thân của các phát biểu có từ khoá case với hằng theo sau nó có giá trị giống với biểu thức.
    Nếu như biểu thức không thoả mãn bất kỳ hằng số case nào, quyền điều khiển trả về cho đoạn mã mặc định đặt sau default.
    Lưu ý: Nếu không dùng phát biểu break, quyền điều khiển sẽ chuyển cho case kế tiếp.
    Ví dụ về cách sử dụng lệnh switch :
    char ch;
    switch (ch) {
    case ''''0'''': case ''''1'''': case ''''2'''': case ''''3'''': case ''''4'''':
    case ''''5'''': case ''''6'''': case ''''7'''': case ''''8'''': case ''''9'''':
    is_digit = true;
    break;
    case '''' '''' :
    case '''' '''':
    case ''''
    '''':
    is_space = true;
    break;
    default:
    is_other = true;
    }
    Nếu như không có câu lệnh break sau is_digit = true, các ký tự kiểu số (digit) sẽ có is_space = true.
    6.2. Các câu lệnh lặp:
    Các câu lệnh lặp cho phép thực hiện lặp đi lặp lại một khối mã lệnh nào đó. Có 3 kiểu lệnh lặp: for, while và do. Phần sau đây sẽ trình bày các lệnh này một cách chi tiết hơn..
    a. Phát biểu for:
    for (phát-biểu-khởi-tạo; biểu-thức-điều-kiện; phát-biểu-tăng)
    thân-vòng-lặp
    Khi đi vào một câu lệnh for, đầu tiên phát-biểu-khởi-tạo được thực hiện nhằm thiết lập giá trị ban đầu cho biến đếm. Kế đến, phát-biểu-tăng và biểu-thức-điều-kiện được liên tục xét đến: nếu như điều kiện sai, vòng lặp sẽ kết thúc. Java cũng cho phép nhiều phát biểu khởi tạo và biểu thức điều kiện một lúc (phân cách bằng dấu phảy) giống C++. Lấy ví dụ:
    // Số ngày trong từng tháng
    int[] month_days = {31, 28, 31, 30, 31, 30,
    31, 31, 30, 31, 30, 31};
    // Mảng nhiệt độ cao nhất từng ngày
    int[][] daily_high = new int[month_days.length][]
    for (int i = 0; i < month_days.length; i++) {
    // tạo mảng
    daily_high = new int [month_days];
    }
    b. Phát biểu while:
    while (biểu-thức-điều-kiện) {
    thân-vòng-lặp
    }
    Ðể thực hiện một phát biểu while, biểu-thức-điều-kiện sẽ được tính toán trước. Nếu biểu thức là true, thân vòng lặp sẽ được thực hiện. Quá trình này lặp đi lặp lại cho đến khi biểu thức chứa giá trị false. Ví dụ sau đây sẽ in ra mười dòng trắng:
    int i = 10;
    while (i-- > 0)
    System.out.println();
    c. Phát biểu do:
    do
    thân-vòng-lặp
    while (biểu-thức-điều-kiện);
    Ðiểm khác biệt duy nhất giữa phát biểu do và phát biểu while là trật tự thực hiện: Thân vòng lặp sẽ được thực hiện trước, sau đó mới tính đến biểu thức điều kiện. Do vậy, phần thân vòng lặp được thực hiện ít nhất là một lần. Ðoạn chương trình sau đợi cho đến khi người sử dụng đánh vào xâu "exit":
    String buffer;
    DataInputStream my_in = new DataInputStream(System.in);
    do {
    System.out.print("Nhập lệnh : ");
    System.out.flush();
    buffer = my_in.readLine();
    } while (! buffer.equals("exit"));
    6.3. Các phát biểu ngắt vòng lặp:
    Trong Java có ba kiểu phát biểu để ngắt vòng lặp: break, continue và return. Sau đây chúng ta sẽ lần lượt xem xét các phát biểu này:
    a. Phát biểu break:
    break nhãn; // nhãn có thể có hoặc không..
    Nếu như không có kèm nhãn, phát biểu break sẽ chuyển quyền điều khiển đến phát biểu sau vòng lặp trong nhất. Nếu như có nhãn, quyền điều khiển được chuyển tới phát biểu kế tiếp của khối lệnh chứa nhãn. Ví dụ minh hoạ sau dùng để in ra ngày thứ 3 trong năm có nhiệt độ lớp hơn 70oF:
    vong_lap_ngoai:
    for (int i = 0, count = 0; i < daily_high.length; i++)
    for (int j = 0; j < daily_high.length; j++)
    if ((daily_high[j] > 70) & (++count == 3)) {
    System.out.println("Ngày đó là:" + (i+1)+"/"+(j+1));
    break vong_lap_ngoai; // Nhảy ra ngoài cả 2 vòng lặp
    }
    // nếu như lệnh break được thực hiện,
    // quyền điều khiển sẽ được chuyển tới đây
    Được lan0303 sửa chữa / chuyển vào 01:45 ngày 15/11/2005
  3. lan0303

    lan0303 Thành viên mới

    Tham gia ngày:
    24/05/2003
    Bài viết:
    2.622
    Đã được thích:
    0
    b. Phát biểu continue:
    continue nhãn; // nhãn có thể có hoặc không
    Phát biểu này chuyển quyền điều khiển cho đoạn mã đi kèm với thân vòng lặp. Với while và do, phát biểu điều kiện sẽ được kiểm tra lại. Với vòng lặp for, phát biểu tăng sẽ được thực hiện. Nếu như có nhãn đưa vào, quyền điều khiển được trao cho vòng lặp bên ngoài cùng có chứa nhãn.
    c. Phát biểu return:
    return biểu-thức;
    Một phát biểu return sẽ trả quyền điều khiển về cho đoạn mã gọi hàm đó. Nếu như hàm được định nghĩa là sẽ trả về giá trị, biểu-thức phải có kiểu giá trị đó. Ngược lại, chúng ta phải dùng lệnh return không kèm theo biểu-thức.
    IX. Truyền thông trong JAVA
    9.1. Ðịa chỉ URL

    Trong môi trường Internet/Intranet, các tài nguyên trên mạng được định danh bằng cơ chế địa chỉ ULR. Một địa chỉ URL bao gồm tên giao thức, tên máy và đường dẫn trỏ đến tài nguyên (tệp dữ liệu). Lớp chuẩn URL trong JDK cho phép khai báo các đối tượng địa chỉ dạng này. Xét ví dụ sau:

    import java.awt.*;
    import java.io.*;
    import java.net.*;
    public class url{
    public static void main (String arg[ ]) {

    try {
    URL urlServer = new URL("http","fit.hut.edu.vn",80,"/default.htm");
    System.out.println(urlServer.toString());
    System.out.println("Protocol="+urlServer.getProtocol());
    System.out.println("Host="+urlServer.getHost());
    System.out.println("Port="+urlServer.getPort());
    System.out.println("Fichier="+urlServer.getFile());
    URLConnection idConnexion = urlServer.openConnection();
    InputStream in = idConnexion.getInputStream();

    byte [] table = new byte[2048];
    int n = in.read(table);

    String s = new String(table,0,n);
    System.out.println(s.substring(1000,1256));
    }
    catch (IOException e){
    System.out.println(e.getMessage());
    e.printStackTrace();
    }
    }
    }

    9.2. Truyền thông giữa các máy tính trong mạng TCP/IP
    JAVA cũng cho phép thực hiện các phiên kết nối àm việc dễ ràng giữa các máy tính trong mạng sử dụng giao thức TCP/IP. Các kết nối này dựa trên cặp giá trị địc chỉ IP của máy và địa chỉ cổng TCP của dịch vụ (cặp giá trị này gọi là một socket). Có hai chế độ kết nối chính: Datagram và Client/Server.
    Truyền theo chế độ không liên kết (qua các datagram)
    Xét ví dụ sau:
    Tệp DataReceiver.java
    import java.net.*;
    import java.io.*;
    public class DataReceiver extends Thread {
    DatagramSocket sockInOut;
    DatagramPacket paquet ;
    byte [ ] donnee ;
    InetAddress paquetAddr;
    int paquetPort;
    boolean lireSw = true;
    public DataLire( ){ try {
    donnee = new byte[1 28];
    paquet = new DatagramPacket(donnee, 128);
    sockInOut = new DatagramSocket();
    InetAddress thisAddr = sockInOut.getLocalAddress();
    int nPort = sockInOut.getLocalPort();
    System.out.println(thisAddr.toString());
    System.out.println("Recepteur est sur le port "+nPort);
    }
    catch (IOException e){System.out.println(e.getMessage());}
    }
    public void run( ){ try {
    do {
    sockInOut.receive(paquet);
    int n = paquet.getLength();
    String recu = new String(donnee, 0 , n);
    paquetAddr = paquet.getAddress( );
    paquetPort = paquet.getPort( );
    String msg = "Da nhan tot - Cam on!";
    donnee = msg.getBytes();
    paquet = new DatagramPacket(donnee, msg.length(),paquetAddr, paquetPort);
    sockInOut.send(paquet);
    } while (lireSw);
    }
    catch (IOException e){
    System.out.println(e.getMessage());}
    }
    public static void main(String a[ ]){
    (new DataLire()).start(); }
    }

    Tệp DataSender.java
    import java.net.*;
    import java.io.*;
    public class DataSender {
    public static void main (String arg[ ]){
    try {
    InetAddress addSite = InetAddress.getByName(arg[0]);
    int numPort = Integer.parseInt(arg[1]);
    byte[ ]msgBytes = arg[2].getBytes();
    DatagramPacket paquet = new DatagramPacket(msgBytes, msgBytes.length, addSite, numPort);
    DatagramSocket socketOutIn = new DatagramSocket();
    socketOutIn.send(paquet);
    byte[ ]rspBytes = new byte[512];
    paquet = new DatagramPacket(rspBytes,512);
    int n = paquet.getLength();
    System.out.println(new String(rspBytes,0,n));
    }
    catch(IOException e){ System.out.println(e.getMessage());}
    }
    }

    Truyền theo chế độ có liên kết
    Sau đây là một ví dụ minh hoạ việc truyền tin giữa hai chương trình Server và Client
    Chương trình Server
    import java.net.*;
    import java.io.*;
    public class Server {
    byte tableIn [ ] = new byte[512];
    byte tableOut [ ] = new byte[512];
    boolean runSw=true;
    public Server ( ) { try { //CONSTRUCTOR
    ServerSocket servr = new ServerSocket(2001);//port 2001
    int num = 0; //compteur de clients
    do {
    Socket client = servr.accept( ); //attendre un client
    InputStream entree=client.getInputStream(); //voie in
    OutputStream sortie=client.getOutputStream();//voie out
    num++; //compter clients
    int rsp = 0; //compteur de rộponses
    while (rsp < 3) {//3 lecture/ecriture
    int r = entree.read(tableIn); //lire message
    System.out.println(new String(tableIn,0,r));
    System.in.read(tableOut,0,512);
    sortie.write(tableOut); //ecrire message
    } //fin while sur les messages d''''un client
    client.close(); //fermer client
    } while(runSw); //recommencer - autre client
    } //fin try

    catch (IOException e){System.out.println(e.getMessage());}
    } //fin CONSTRUCTEUR
    public static void main(String arg[]){new Server( );}
    } //fin classe JavaServer
    Chương trình Client
    import java.net.*;
    import java.io.*;
    public class Client {
    public Client( ) { try { //CONSTRUCTEUR
    byte[ ] msgByte = new byte[512];
    byte[ ] inByte = new byte[512]; //table pour lecture

    // InetAddress adr = InetAddress.getLocalHost();
    InetAddress adr = InetAddress.getByName("192.168.100.20"); //Dia chi IP cua may chay server
    Socket servr = new Socket(adr, 2001); //liaison serveur
    OutputStream sortie = servr.getOutputStream(); //voie out
    InputStream entree = servr.getInputStream(); //voie in
    String msg = "";

    while (msg !="Bye!") { //3 fois ecrire/lire
    System.in.read(msgByte,0,512); // Read maximun 15 caracters
    sortie.write(msgByte); //ecrire bytes
    entree.read(inByte); //lire bytes
    msg = new String(inByte);
    System.out.println(msg);
    } //fin while sur les messages
    servr.close(); }
    //fin bloc try
    catch (IOException e){System.out.println (e.getMessage());}
    } //fin CONSTRUCTEUR
    public static void main(String arg[]){new Client();}
    } //fin classe JavaClient
    Tiếp tục phát triển chương trình này ta có thể xây dựng một ứng dụng chatting giữa hai máy tinh.
    X. Ða luồng (multi-thread) trong JAVA
    Luồng là gì : Luồng có thể coi là một tiến trình chạy trên máy tính. Luồng được tạo ra khi ta chạy một chương trình nào đó ví dụ như bằng lệnh java chẳng hạn.
    Trong phần này chúng ta sẽ đề cập đến khả năng đa luồng của JAVA có nghiã là hỗ trợ nhiều chương trình cùng chạy song song. Trong JDK có một lớp chuẩn tên là Thread, các chương trình có hỗ trợ đa luồng của chúng ta từ sau sẽ phải kế thừa từ lớp này. Lớp Thread gồm có hai phưong thức cơ bản là Start và Run. Start dùng để tạo ra một luồng tương ứng với lớp đó. Start sẽ gọi tự động phương thức Run, như vậy các hoạt động cần thiết của lớp ta sẽ đặt trong Run.
    Ta hãy xét một ví dụ minh hoạ tính đa luồng một cách đơn giản như sau:
    import java.awt.*;
    public class ThreadSimple extends Thread {
    String id;
    public ThreadSimple (String id) {
    this.id = id;
    }
    public void run(){
    for (int i=0; i<512; i++){
    System.out.print(id);
    }
    }
    public static void main(String arg[]){
    ThreadSimple a= new ThreadSimple("a");
    ThreadSimple b= new ThreadSimple("b");
    a.start();
    b.start();
    }
    }

    Dịch và chạy thử chương trình ta sẽ thấy kết quả phụ thuộc vào từng hệ điều hành hỗ trợ đa nhiệm, trong đó có sự phân chia thời gian giữa các tiến trình như Windows 95, UNIX ... hai luồng a và b sẽ chạy đan xen với nhau cho ta các ký tự a và b trên màn hình. Ngược lại đối với hệ điều hành đơn nhiệm như MS-DOS luồng a phải kết thúc thì b mới được bắt đầu.
    Ðộ ưu tiên giữa các luồng (priority)
    Mỗi luồng khi chạy đều có một độ ưu tiên nhất định. Hệ điều hành sẽ dựa trên cơ sở độ ưu tiên của từng luồng để quyết định xem luồng nào có quyền chạy trứơc. Các quản lý của hệ điều hành như sau:
    Tại một thời điểm nếu có nhiều luồng cùng chờ đợi thì luồng nào có độ ưu tiên cao hơn sẽ được chaỵ trước.
    Khi một luồng đang chạy nếu có một luồng khác có độ ưu tiên cao hơn cần chạy thì luồng trước sẽ bị tạm ngắt để dành cho luồng mới chạy xong khi đó nó mới được tiếp tục.
    Ðối với trường hợp hai luồng có độ ưu tiên giống nhau cùng muốn chạy khi đó hệ diều hành sẽ kiểm soát theo nguyên tắc như sau:
    Khi luồng đang chạy tạm dừng các tính toán để tiến hành truy nhập vào ngoại vi thì quyền sử dụng CPU sẽ được trao cho luồng khác.
    Phân chia thời gian: CPU được phân chia cho mỗi luồng có độ ưu tiên ngang nhau một khoảng thời gian như nhau. Sau mỗi khoảng thời gian đó luồng đang chạy dù chưa kết thúc cũng phải tạm dừng để dành chỗ cho luồng khác đến lượt.
    Ðể minh hoạ ta sẽ sửa lại phương thức main của ThreadSimple như sau:
    public static void main(String arg[]){
    ThreadSimple a= new ThreadSimple("a");
    ThreadSimple b= new ThreadSimple("b");
    Thread m = currentThread();
    System.out.print(" Priority Max: "+ MAX_PRIORITY);
    System.out.print(" Priority Min: "+ MIN_PRIORITY);
    System.out.print(" Current Priority : "+ m.getPriority());
    System.out.print(" Priority of thread a: "+ a.getPriority());
    System.out.print(" Priority of thread b: "+ b.getPriority());
    b.setPriority(MAX_PRIORITY);
    a.start();
    b.start();
    }
    Trong ví dụ trên, luồng a được khởi động trước nhưng nó chỉ chạy được một thời gian ngắn rồi sau đó bị b có độ ưu tien cao hơn ngắt và chỉ được tiếp tục sau khi b đã kết thúc.
    Ðồng bộ giữa các luồng:
    Khi ta chạy các luồng song song mà lại cùng cập nhập trên một dữ liệu chung thì sẽ dẫn tới lỗi dữ liệu do sự mất đồng bộ giữa các luồng. Ta xét ví dụ sau minh hoạ hoạt động của một tài khoản người gửi với các thao tác đọc và sửa đổi song song:
    import java.awt.*;
    public class Acount;
    private int sum=0;
    public int getSum(){
    return sum;
    }
    public void putSum(int a){
    sum =a;
    }
    public void updateSum(int a){
    int s= getSum();
    putSum(s+a);
    }
    }
    Thêm một lớp nữa để có thể thực hiện nhiều thao tác cập nhật vào tài khoản một lúc. Sau khi chạy ví dụ ta sẽ thấy số dư tài khoản sai so với thực tế, lý do là không có sự đồng bộ khi cập nhật. Các tiến trình chạy song song sẽ đọc và cập nhật đồng thời lên một tổng chưa được update, chính vì vậy mà kết quả cuối cùng là sai.
    Ðể khắc phục vấn đề này chúng ta phải cấm các cập nhật đồng thời (giống như cơ chế khoá trong cơ sở dữ liệu phân tán) để đảm bảo trong một thời điểm chỉ có một tiến trình được phép sửa đổi dữ liệu. Trong JAVA ta thực hiện điều này bằng cách thêm từ khoá synchronized vào trước phần khai báo phương thức updateSum.
    synchronized public void updateSum(int a)
    Được lan0303 sửa chữa / chuyển vào 01:30 ngày 15/11/2005
  4. lan0303

    lan0303 Thành viên mới

    Tham gia ngày:
    24/05/2003
    Bài viết:
    2.622
    Đã được thích:
    0
    Như đã nêu chỉ là ?oMột ít kiến thức cơ bản để đọc VisAD?, và nguồn VASC cơ bản nhưng hơi cỗ, "để hiểu VisAD" nên tham khảo thêm:
    Computer Science and Software Engineering
    URL: http://www.csse.monash.edu.au/sitemap/
    NCGIA Core Curriculum in Geographic Information Science
    URL: http://www.ncgia.ucsb.edu/giscc/
    Hay ít ra cũng nên biết BẢN ÐỒ HỌC VÀ GIS
    CHƯƠNG I: BẢN ÐỒ
    1. KHÁI NIỆM VỀ BẢN ÐỒ
    2. PHƯƠNG PHÁP THỂ HIỆN BẢN ÐỒ
    1. Phân loại
    2. Hệ qui chiếu
    3. Hệ tọa độ địa lý
    4. Tỉ lệ
    5. Chú giải trên bản đồ
    6. Phương pháp lập bản đồ
    7. Sử dụng kỹ thuật viễn thám trong việc lập bản đồ
    3. SỬ DỤNG BẢN ÐỒ
    CHƯƠNG II: GIỚI THIỆU GIS
    1. GIS LÀ GÌ ?
    1. Là hệ thống lưu trữ dữ liệu
    2. Là hệ thống phân tích
    3. Là hệ thống trợ giúp quyết định
    2. THÀNH PHẦN CỦA GIS
    3. ỨNG DỤNG CỦA GIS
    1. Trong quản lý và qui hoạch đô thị
    2. Trong quản lý và qui hoạch phát triển nông thôn
    3. Trong quản lý môi trường
    CHƯƠNG III: CẤU TRÚC DỮ LIỆU KHÔNG GIAN ( SPATIAL DATA STRUCTURE)
    1. ÐỊNH NGHĨA
    2. MÔ HÌNH DỮ LIỆU KHÔNG GIAN (SPATIAL DATA STRUCTURE)
    1/ VECTOR
    a. Loại đường (arc, line)
    b. Loại điểm (point)
    c. Loại vùng (polygon, area)
    2/ RASTER
    3. BÀI TOÁN TRÊN DỮ LIỆU KHÔNG GIAN (Spatial operations)
    1. Thuật toán trên VECTOR:
    a. Che phủ (verlaying)
    b. Vùng đệm (Buffer)
    c. Khoảng cách (Distance)
    2. RASTER
    a. Lọc (Filter)
    b. Phân loại (Reclassification)
    c. Các thuật toán đại số trên bản đồ (+ , - , *, /)
    d. Hàm lân cận (Neighbourhood)
    3. Sự kết hợp dữ liệu (Data aggeration)
    CHƯƠNG IV: CẤU TRÚC DỮ LIỆU PHI KHÔNG GIAN (ATTRIBUTE DATA STRUCTURE)
    1. KHÁI NIỆM
    2. CẤU TRÚC DỮ LIỆU LIÊN KẾT
    a. Vật thể (Object)
    b. Thuộc tính (Characteristic)
    c. Tổ chức dữ liệu (Class, hierarchy)
    d. Liên kết dữ liệu (Relationship)
    CHƯƠNG V: LIÊN KẾT DỮ LIỆU KHÔNG GIAN VA PHI KHÔNG GIAN
    1. KHÁI NIỆM
    a. Trường (field)
    b. Mẩu tin (Record)
    c. Tập tin dữ liệu (Database file)
    2. Liên kết dữ liệu không gian (GEOCODING)
    a. Liên kết raster-attribute data
    b. Liên kết vecter-attribute data
    CHƯƠNG VI: PHƯƠNG PHÁP XÂY DỰNG HỆ THỐNG THÔNG TIN ( INFORMATION SYSTEM DEVELOPMENT METHODOLOGY)
    1. HỆ THỐNG THÔNG TIN
    2. CÁC BƯỚC THIẾT KẾ HỆ THỐNG
    Phân tích hệ thống (System analysis)
    Thiết kế sơ bộ (Global system design)
    Thiết kế chi tiết (Detailed system design)
    Sử dụng và kiểm tra hệ thống (System implementation and assessment)
    3. THIẾT LẬP SƠ DỒ HỆ THỐNG
    Cơ sở dữ liệu
    Qui trình (Process)
    Dòng dữ liệu (Data flow)
    Nguồn dữ liêu (Data source)
    CHƯƠNG VII: HỆ THỐNG TRỢ GIÚP QUYẾT ÐỊNH
    1. KHÁI NIỆM
    2. MỘT SỐ THUẬT TOÁN TÌM KIẾM
    3. THIẾT LẬP BẢN ÐỒ THUỘC TÍNH
    4. CÁC CÔNG CỤ PHÂN TÍCH
    CHƯƠNG VIII: MỘT SỐ BÀI TẬP VỀ ỨNG DỤNG CỦA GIS
    1. ỨNG DỤNG TRONG QUI HOẠCH VÀ QUẢN LÝ ÐÔ THỊ
    2. ỨNG DỤNG TRONG CÁC LÃNG VỰC MÔI TRƯỜNG
    3. ỨNG DỤNG TRONG NGÀNH ÐỊA CHÁNH
    Vài ảnh vui: Nguồn: NCGIA Core Curriculum in Geographic Information Science
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    THÂN!
  5. lan0303

    lan0303 Thành viên mới

    Tham gia ngày:
    24/05/2003
    Bài viết:
    2.622
    Đã được thích:
    0
    --------------------------------------------------------------------------------
    VisAD Bibliography
    --------------------------------------------------------------------------------

    URL: http://www.ssec.wisc.edu/~billh/visad.html
    Java distributed components for numerical visualization in VisAD
    William Hibbard, Curtis Rueden, Steve Emmerson, Tom Rink, David Glowacki, Tom Whittaker, Don Murray, David Fulker, John Anderson, Communications of the ACM 48, No. 3, 2005, 98-104.
    Building 3-D User Interface Components Using a Visualization Library
    W. Hibbard, Computer Graphics 36, No. 1, 2002, 4-7.
    New Ways, in Java, of Visualizing the Same Old Data
    D. Murray and D. Fulker, AGU 2000
    An example of Unidata''s future in new software: the VisAD component architecture for collaborative data analysis and visualization
    W. Hibbard, Preprints, Conf. Interactive Information and Processing Systems for Meteorology, Oceanography, and Hydrology, 2000, 162.
    Collaborative visualization and computation in the earth sciences using VisAD.
    W. Hibbard, S. Emmerson, C. Rueden, T. Rink, D. Glowacki, N. Rasmussen, D. Fulker and J. Anderson, Preprints, Conf. Interactive Information and Processing Systems for Meteorology, Oceanography, and Hydrology, 1999, 478-480.
    VisAD: Connecting people to computations and people to people
    W. Hibbard, Computer Graphics 32, No. 3, 1998, 10-12.
    Java and the World Wide Web: The Right Choice for Interactive Systems
    W. Hibbard, J. Anderson, and B. Paul, Preprints, Conf. Interactive Information and Processing Systems for Meteorology, Oceanography, and Hydrology, 1997, 172-173.
    A Java and World Wide Web Implementation of VisAD
    W. Hibbard, J. Anderson, and B. Paul, Preprints, Conf. Interactive Information and Processing Systems for Meteorology, Oceanography, and Hydrology, 1997, 174-177.
    Visualizing Scientific Computations: A System based on Lattice-Structured Data and Display Models
    W. Hibbard, PhD Thesis, Univ. of Wisc. Comp. Sci. Dept. Tech. Report, #1226, 1995.
    Interactive Visualization of Earth and Space Science Computations
    W. Hibbard, B. Paul, D. Santek, C. Dyer, A. Battaiola, and M-F. Voidrot-Martinez, Computer 27, No. 7, July 1994, 65-72.
    A Lattice Model for Data Display
    W. Hibbard, C. Dyer, and B. Paul, Proc. IEEE Visualization ''94, 1994, 310-317.
    Display of Scientific Data Structures for Algorithm Visualization
    W. Hibbard, C. Dyer, and B. Paul, Proc. IEEE Visualization ''92, 1992, 139-146.
    --------------------------------------------------------------------------------
    NCGIA Core Curriculum in Geographic Information Science
    --------------------------------------------------------------------------------
    URL: "http://www.ncgia.ucsb.edu/giscc/units/related.html"
    Useful materials from related projects
    The original NCGIA Core Curriculum
    The NCGIA Core Curriculum for Technical Programs
    The Geographer''s Craft Project
    The Virtual Geography Department

    --------------------------------------------------------------------------------
    1. The original NCGIA Core Curriculum
    The original NCGIA Core Curriculum was completed in 1990. A few years later when the WWW had emerged, Brian Klinkenberg at the University of British Columbia offered to translate the document files into html and make them available over the web. These are still on-line at www.geog.ubc.ca/courses/klink/gis.notes/ncgia/toc.html. While some of this material is now out-of-date, many of these original units are still useful. Those of particular value are listed below.
    NOTE - the overhead graphics from the printed version of the original Core Curriculum were scanned and, though available on the UBC site, are linked only from the main table of contents page, not from each individual unit. The simple hand drawn sketches included in the body of original text are not included, but are indicated by the word "diagram".
    Sampling The World
    Spatial Objects And Database Models
    General Coordinate Systems
    Map Projections
    Affine And Curvilinear Transformations
    Efficient Storage Of Lines - Chain Codes
    Simple Algorithms I - Intersection Of Lines
    Simple Algorithms II - Polygons
    The Polygon Overlay Operation - included in the GISCC as Unit 186
    Raster Storage
    Hierarchical Data Structures
    Quadtree Algorithms And Spatial Indexes
    Digital Elevation Models
    The TIN Model - included in the GISCC as Unit 056
    Spatial Interpolation I
    Spatial Interpolation II
    --------------------------------------------------------------------------------
    2. The NCGIA Core Curriculum for Technical Programs
    The Core Curriculum for Technical Programs was developed in the latter part of the 1990''s for use by instructors teaching technical skills related to the use of GISystems. Most of this material is at a much more elementary level than is intended for the GISCC, but some readers may find it useful.
    --------------------------------------------------------------------------------
    3. The Geographer''s Craft Project
    The Geographers Craft is a teaching initiative being pursued in the Department of Geography at University of Colorado at Boulder to improve the teaching of geographical techniques at the introductory level. It is a two-semester course experimenting with active-learning, problem-solving methods of instruction and hypermedia, Internet-based course materials. The goal is to promote analytical reasoning and critical thinking by having students address research problems with ''appropriate'' geographical concepts and techniques, whether drawn from cartography, geographic information systems, remote sensing, spatial statistics, or other information technologies. An extensive set of materials for The Geographer''s Craft project is being made available on-line through the Internet in the form of an electronic textbook and electronic laboratory guide. The Geographer''s Craft project was supported by the National Science Foundation.
    Several of the notes in the Geographer''s Craft Project are complementary to materials being developed for the GISCC. While our materials are being created, we direct your
    attention to the following excellent substitutes for GISCC units:
    1.4. Map projections and transformation (Unit 019) --> Map Projections
    2.8. Populating the GISystem (Unit 066) --> Data Sources
    2.10. Handling uncertainty (Unit 096) --> Managing Error
    2.11.1. Cartographic fundamentals (Unit 102) --> Cartographic Communication
    2.14.1. Spatial decision support systems (Unit 127) --> Spatial Decision Support Systems for Location Planning
    3.2.4. Legal issues (Unit 147) --> Legal Issues Relating to GIS
    --------------------------------------------------------------------------------
    4. The Virtual Geography Department
    The Virtual Geography Department (VGD) incorporates a wide range of instructional materials by a number of contributors from around the world. Modules may contain lecture notes, slide collections, classroom and laboratory exercises, ideas for term projects, sample datasets, virtual fieldtrips, and examples of research not available elsewhere. Modules are available for topics in the geographic information sciences including cartography, remote sensing, and statistics, cultural geography, introductory human geography, physical geography, the history and philosophy of geography, and world regional geography. Working groups have also been established to prepare materials on the Earth''s environment and society, regional and area studies, urban geography, and virtual fieldtrips. The VGD also maintains a comprehensive list of Web-based geographic data sources, geography departments, and courses with on-line materials.
    The Project is endorsed by the National Council for Geographic Education, the Commission of College Geography of the Association of American Geographers, and the Geography Education Specialty Group of the Association of American Geographers. Funding was originallyy provided by the National Science Foundation to convene summer workshops in which teams of geographers came together to organize and develop course materials.
    --------------------------------------------------------------------------------
    The correct URL for this page is: http://www.ncgia.ucsb.edu/giscc/units/related.html
    Last revised: August 12, 2000.
    --------------------------------------------------------------------------------
    Gateway to the Core Curriculum
    --------------------------------------------------------------------------------
  6. lan0303

    lan0303 Thành viên mới

    Tham gia ngày:
    24/05/2003
    Bài viết:
    2.622
    Đã được thích:
    0
    Về GIS DATABASE DESIGN các Bác có thể tham khảo thêm:
    URL: http://www.hbp.usm.my/THESIS/heritageGIS/MASTER/research/Databases.htm
    THÂN!
  7. lan0303

    lan0303 Thành viên mới

    Tham gia ngày:
    24/05/2003
    Bài viết:
    2.622
    Đã được thích:
    0
    --------------------------------------------------------------------------------
    Chapter one
    Introduction
    --------------------------------------------------------------------------------

    http://www.hbp.usm.my/THESIS/heritageGIS/thesis/Chapter1.htm
    1.1 Background and motivation
    1.1.1 Background

    The study investigates how Geographic Information System (GIS) spatial analysis and modelling improves demographic data analysis in the planning process (where demographic information and spatial analysis are strongly interrelated); i.e. seek for new ways and how the available 2D, 2.5D and 3D GIS spatial analysis and modelling methods can be manipulated to produce a set of techniques that can be used to derive different demographic variables and quantities for planning analysis.
    A principal motivation for the GIS Demographic research is that planning analysis uses a lot attribute data about humans; where planning analyses require an indication as to how the total population and how selected composition groups are and will be spatially distributed in the study area making demographic data the main source of data into the planning process; and that most of the GI science planning analysis research is about GIS development rather than about GIS use, without a strong theoretical link between the two, to advance the GI science and to be useful in planning practice has to take the perspective of GI use as a move to direct way of providing a link between the science and planning practice, is the research theme of systematic evaluation GIS demographic spatial analysis and modelling.
    In planning any area the growth potentials must be expressed in terms of the population it is expected *****stain ?" the size of population, its composition, and characteristics, and its spatial distribution. Although population data is collected at the point level (individuals and household), it is always aggregated to existing spatial entities (i.e. administrative units) to allow tabulations according to various data attributes and demographic analysis to be carried out using statistical techniques. The human Geographical dimensions of the information in demographic analysis are being forgotten most of the time, geography is only used to collect data; as a result information is lost, or hidden or details are difficult to extract, in ad***ional being unable to view and analysis spatially in a way that produce demographic variables and quantities that are in line with planning analysis inputs.
    To easily understand and fully utilize all of this demographic information there is need to carry spatial analyses at disaggregate level and to be linked to their locations to help in equity development. These problems correspond directly to the two key strengths of GIS - manipulation and display of spatially referenced data (Tomlin, 1990; Langford & Unwin, 1994; Chou, 1997; Chrisman, 1997; and DeMers, 1997, 2000), this is further facilitated by GIS?Ts capability to test and manipulate variables faster and as it is less expensive to test models rather than reality, and can predict consequences of proposed activities through simulation, which helps to pick "best" alternative.
    Thus employ the techniques of 2D GIS, 2.5D GIS (DEM and DTM), and new techniques in form of three-Dimensional Demographic Model (3D-DM) in demographic data analysis and modelling, visualisation and interpretation; where other applications such as mining, hydrology, and environmental modelling have crossed over the 2D boundary into 3D modelling. This shift of application within GIS environment is necessary and is in line with other works by Yeh (1999) where he integrates GIS in planning; research by Lee (1995) in his PhD thesis at University of Washington where he develops a Methodology for Generating Alternative Land Use Plans Using GIS Modelling Techniques; and also GIS field came from the fields of spatial statistics, database management, and cartography.
    1.1.2 Definition of key words
    Geographical information system (GIS) has been variously defined in many ways and by many people including Aronoff (1989), Huxhold (1991), ESRI (1992, 1994, 1998), Burrough (1986), Clarke (1986), Healey, et al. (1998), DeMers (1997, 2000), etc. But in Chrisman (1997) we find one of the most general definitions which was developed by consensus among 30 specialists: Geographical information system - A system of hardware, software, data, people, organization and institutional arrangements for collecting, storing, analysing, and disseminating information about areas of the earth. (Ducter and Kjerne, 1989)
    The term "spatial analysis" encompasses a wide range of techniques for analysing, computing, visualizing, simplifying, and theorizing about geographic data. Methods of spatial analysis can be as simple as taking measurements from a map or as sophisticated as complex geocomputational procedures based on numerical analysis. Spatial analysis is statistical description or explanation of either Locational or attribute information or both (Goodchild, 1987). From Fischer, et al (1996) and Chou (1997) the spatial analysis include techniques such as spatial querying, point-in-polygon operation, buffering, overlaying, intersection, dissolving, proximity analysis, etc
    Modelling, in GIS, it is used generally to refer to any operation involving the representation and manipulation of spatial data, particularly in composition of new features and coverages through the process of overlay (Burrough, 1986 and Tomlin 1990). It also has another meaning in the mainstream of system sciences, modelling involves simulation based on processes, which give rise to system structures (Batty, et al. 1994). In this research both definitions of modelling are employed.
    Demography is the study of human populations with an emphasis on statistical analysis i.e. statistical characteristics (Plane, et al, 1994). Data describing a human population is referred to as demographic data. Involving primary the measurement of the size, growth, density, distribution, and diminution of the numbers of people, the proportions living, being born or dying within some area or region and the related functions of fertility, mortality and marriage (Cox, 1970). Demographics is often used in singular, meaning the application of demographic information and methods in business, planning, and public administration; and it is also seen in plural, referring to the demographic information itself (Merrick and Tordella, 1988). The major difference between demographics and the field of demography generally is that the later is concerned more with producing new knowledge and understanding of human behaviour, where as the former is concerned more with the use of existing knowledge and techniques to identify and solve problems (Weeks, 1994 pp. 477).
    --------------------------------------------------------------------------------
    1.2 Problem Statement and Research Goals
    1.2.1 Problem definition

    The main contention in this research is Demographic spatial analysis and modelling in two-dimensional (2D), two and half dimensional (2.5D), and 3D GIS, i.e. which aspects of demographic characterisation can be accomplished by 2D, 2.5D, 3D GIS, or a combination of them to produce demographic variables and quantities which are in line with planning analysis input using procedures that are common and easier to planners. Past research confirms that the GI-based tools developed by vendors and/or academics are for various reasons under-utilised (Harris 1989; Harris and Batty 1993; Holmberg 1994; lee, 1995 Klosterman 1997). Among reasons for under-utilisation of GIS in planning is incompatibility of the mostly generic GI products with the tasks and functions performed by urban and regional planners as it is one thing to have digital geographic information (Murray, 1999), but a far more challenging issue is how this information can be analysis/modelling and understood (what does the demographic data indicate or suggest and what are the implications) in planning environments.
    Demographic data for planning analysis has been tra***ional analysed by statistical techniques where various models have been developed like Population Analysis Spreadsheets (PAS) for Excel, population change (plane, et al, 1994), spread model (Klosterman, et al 1994) has been used. Most of these models although they can account for change in demography, they lack the spatial aspect (it is not possible to geographically view and analysis the patterns) (Klosterman, et al, 1993); tends to ignore the demographic spatial dimension and if covered only at aggregate level; But there are approaches from different fields trying or which have taken advantage of GIS?Ts spatial analysis capability in order to incorporate the spatial (geographical) aspect, this has proved useful for understanding physical and environmental processes, the socio-economic dynamics are still hard to model and/or simulate, in terms of population analysis, the use of GIS in demographic data is not fully utilised, although it is rapidly expanding, as David Martin reports, the 1991 census of population was the first in United kingdom (UK) to be conducted in what might be called the ?~GIS erâ?T; the 2001 census geography is designed by and for GIS (David Martin, 1997), and many others areas of integration like in Tiger (US census), PopMap - An Information and Decision Support System for Population Activities (UN web site).
    In terms of 2D GIS various approaches have been proposed which include integration of spatial analysis methods in GIS that has lead to a new exploratory analysis (Goodchild, 1987; Haining, 1990; Fotheringham and Rogerson, 1993; Openshaw 1994b, c; and Openshaw et al. 1996) this has followed Fotheringham, et al (1994); Fisher, et al (1996); Carver (1997); Chou (1997); and DeMers (1997, 2000) that GIS is an incomplete set of spatial analytical tools, in many cases we are obliged test or combine GIS tools with statistical analysis and others in order to accomplish spatial analysis. Lot of research going on the linkage between spatial statistical analysis and geographic information systems, in Fotheringham, et al. (1994) the linkage has been basically suggested in three different ways. The first strategy is GIS and statistical packages like SAS and SPSS can be maintained as two separate packages and simply exchange data between the two systems, where write information from a GIS into a file and read this into statistical package to carry out analysis, then read back by GIS. In Carver (1997) we see that to export spatial data from the GIS to standard statistical systems is not an adequate solution, because the nature of spatial data requires specific spatial analytical functions. But Anselin et al. (1993) have combined SpaceStat, a program for the analysis of spatial data, with the Arc/Info using this approach. The second strategy is GIS functions can be embedded within spatial analysis or modelling. Although in ****r (1997) it is noted that embedding GIS functions into a spatial statistical package seems to be an overwhelming exercise and not really realistic, examples which have taken place include XLisp-Stat Package which extend the geographical data handling and mapping facilities of a package designed for statistical programming (Tierney, 1991 and Openshaw et al. 1996). The third strategy, is Spatial analysis can be fully integrated within the GIS software. That a full integration of spatial analysis tools into a GIS seems most promising (Hansen, 1996), and that using this strategy we can utilize the interactivity between maps, charts and spatial statistics to get a good feeling of patterns and relationships within the data; examples include Arc/S-Plus (Arc/Info is linked to S-Plus), Spacestat integration with ArcView GIS by Anselin, Openshaw?Ts Geographical Analysis Machine (GAM) (Openshaw et al. 1987). Specialized GIS packages directed specifically at spatial analysis have emerged (Bailey and Gatrell (1995), Fisher et al. (1996), Haining (1990), Anselin and Getis (1993); and Anselin (1996, 1999), a good example is IDRISI for windows (IDRISI for windows, 1998). But all these are not directed towards micro demographic analysis from the planner?Ts point of view i.e. the inherent inability of the existing methods to provide useful results in planning analysis and the difficulty the planner often experiences in understanding what the results mean in relation to planning analysis is the issue here, not the integration. The principle need is to develop a style from the existing techniques and documentation of spatial analysis for GIS demographic analysis the planner (as a user of GIS) can use, not to force a planner to the methods that were created by experts for experts (Openshaw et al. 1996). Also knowing that GIS is not only 2D this has to be extended to 2.5D and 3D GIS.
    The idea that population can most appropriately be mapped and modelled as a surface (2.5D) is not new, Schmid and MacCannell (1955) discussed the construction of contour-based maps of population density, while Nordbeck and Rystedt (1970) demonstrated that population density can be viewed as a continuously varying reference interval surface. Tobler (1979) presented a method for pycnophylactic (volume-preserving) interpolation of values from irregular zones in*****rface form, and Goodchild et al. (1993) review a number of approaches to areal interpolation, noting that the process can be viewed as involving the estimation of an underlying population surface; other developments are by Martin and Bracken (1991), with the latest developments being population geocoding, analysis, and modelling using grid by Martin (1999). All handle population surfaces by considering a value for a point as being representative for total for an area (or ratio based on total). Another shorting coming is that demographic variables are represented by two entities and it is these which differentiate them, for example gender, it either male or female; marital status is either single or married; etc. when these entities are modelled in GIS with the latest development in GIS surface analysis and modelling, we are able only to show their spatial locations and extents but not their spatial quantities. But for a planner is always looking how much and how demographic characteristics vary as move from one location to the next, that does not provide total solution for s/his needs. This is further made more complex by the fact that demographic quantities are required at different level of aggregation, thus the problem ranges from representing micro demographic data to aggregated data; also another factor, which comes in play, is the combination of the surface and the quantities (volumetric) analysis and modelling, which leads to the need for 3D GIS demographic analysis.
    1.2.2 The Thesis
    The central theme (thesis) is how demographic spatial analysis for planning analysis can be achieved in GIS by looking at two-dimensional, two and half dimensional, and three-dimensional spatial analysis and modelling to produce variables and quantities which are in line with planning analysis both at aggregated and disaggregated level.
    1.2.3 Objectives of the study
    The study is to investigate how GIS in terms of 2D, 2.5D, and 3D spatial analysis and modelling improves the demographic data analysis in the planning process; aim being to come out with documentation of set of techniques so that their inclusion in GIS may be facilitated. The following a priori (testable) objectives are formulated:
    · To asses the current demographic data analysis and GIS (2D, 2.5D or 3D GIS) and carry out demographic spatial analysis and modelling.
    · To model demographic characteristics into a three dimensional demographic model (3D-DM) to derive useful information for demographic characterisation and demographic quantities.
    · To document how micro demographic data can be spatially analysed in GIS 2D, 2.5D and 3D) to produce variables and quantities which are in line with planning analysis
    · Outline GIS demographic spatial analysis and modelling procedures in planning to come up with appropriate terminologies as well as enabling the use of them.
    In meeting these objectives, a number of continuing themes become apparent; these are outlined in section 1.3 (Research approach i.e. Proposed Methodology).
    --------------------------------------------------------------------------------
    1.3 Proposed Methodology
    The approach starts by a review of literature of problem at hand, then the main body which has been divided into three components a) overview, b) approach, and c) application; end with a conclusion giving the discussion and future work. The details are given under scope of research and have been divided into chapters (see thesis layout and figure 1.3).
    Review of population (demographic) data in planning is the beginning point, which is followed by demographic statistical spatial analysis (DSSA) i.e. statistical spatial analysis methods for demographic analysis; methods of GIS data analysis and modelling; then a look at GIS in planning analysis; this leads to first task of this research i.e. GIS Demographic spatial analysis which involve looking and comparing DSSA and GISSA (Geographical information system spatial analysis i.e. GIS spatial analysis methods in use), what demographic analysis using GIS requires; how GISSA can be manipulated with an eye on results which are always expected from DSSA, to get GIS demographic spatial analysis (GISDSA) which can help to simplify and enhance demographic data analysis; at this stage the concentration is in the convectional 2D GIS and all is done following the Model of carrying out GIS Demographic Spatial Analysis (figure 1.1).
    [​IMG]
    Figure 1.1 Model of carrying out GIS Demographic Spatial Analysis
  8. lan0303

    lan0303 Thành viên mới

    Tham gia ngày:
    24/05/2003
    Bài viết:
    2.622
    Đã được thích:
    0
    Then proceed to Demographic analysis and modelling in 2.5D (surface analysis and characterisation). Look at the shorting coming of 2D GIS demographic analysis; then introduce the new demographic surface terms, their representation, and the derivation of parameters from the demographic surface and their interpretation.
    From 2.5D GIS Demographic analysis and modelling, introduce 3D GIS Demographic spatial analysis and modelling. This is accomplished by employing the techniques from terrain analysis and modelling (DEM and DTM) in form of three-Dimensional Demographic Model (3D-DM) for demographic data representation, interpretation, visualisation and analysis. But before embarking on a detailed description of the nature of 3D GIS modelling its scope is defined by addressing a number of underlying questions. What should a characterisation of demographics in terms of surface attempt to achieve? How should demographic surface be modelled? Modelling the Third Dimension encompasses the following general tasks (see figure 1.2):
    [​IMG]
    Figure 1.2: Three Dimensional Demographic Modelling Tasks
    ã 3D-DM generation: reading demographic from the database, formation of relations among the diverse observations (model construction);
    ã 3D-DM manipulation: modification and refinement of 3D-DMs, derivation of intermediate models;
    ã 3D-DM interpretation: 3D-DM analysis, information extraction from 3D-DMs;
    ã 3D-DM visualisation: graphical rendering of 3D-DMs and derived information; and
    ã 3D-DM application: development of appropriate application models for planning purposes. 3D-DM application in planning forms the context for 3D-Demographic modelling as each particular utilisation has its specific functional requirements relative to the other demographic modelling tasks.
    1.4 Resources and References
    To accomplish the objectives using the outlined methodology, use two types of data set to test techniques: One at very micro level collected from the Heritage area, in Georgetown, Penang state, Malaysia; The main information requirements are 1) the cadastral GIS of the study area, 2) buildings: floor space, number of floors, ownership, building location, and area etc 3) People: employment, age, ***, ethnic grouping, number of children, family members, etc and 4) Land use: shopping points, housing, recreation, etc. The demographic data collected from the study area; the cadastral data for the area already exist in GIS format obtained from Assoc. Prof. Dr. Lee Lik Meng, the building and land use data in GIS format from Penang state planning office (Jabatan Perancangan Bandar dan Desa) Penang, Malaysia. The other is population census data collected by Malaysia population and housing census office in 1991 census, which they publish at aggregated level of Mukim (parish).
    The following will be used: ArcView to provide a graphical user interface (GUI) for direct interaction to view and e*** geo-feature objects; ArcView Avenue (Customisation and Application Development for ArcView) programming environment, ArcView Spatial Analyst extension, ArcView 3D extension, Microsoft Access (Relational database management system (RDBMS)), and SPSS for statistical analysis. The link between these software packages is done using Microsoft Open Database connectivity and other import and export functions within these packages i.e. use SPSS Data Driver 32 (SPSS Data source 32) and ArcView SQL connection to use SPSS Data files in ArcView, SPSS Data source 32 and Microsoft Access to read SPSS files into Microsoft Access, using Microsoft Access Database and ArcView SQL connection to Database, to analysis data in SPSS use SPSS database capture using dbase files to read ArcView database files and Microsoft Access Database to read from the database.
    The references being used include Books and periodicals, lectures, seminars, and discussions, computer software packages, and the Internet sites about GIS, planning, demography and population [1]. All the work (thesis, references, links, and other research outcomes) are being hosted on School of Housing, Building, and planning (HBP) web site under thesis section http://www.hbp.usm.my/thesis/heritageGIS
    1.5 Scope of the research and thesis layout
    This thesis consists of six chapters including the introduction, which highlights the research background, motivation, Problem statement and objectives of the research, methodology and the scope of the research.
    Chapter 2 provides a global overview of demographic data in planning analysis; the concerns and methods of Demographic statistical spatial analysis (DSSA), GIS demographic data analysis and modelling which includes methods of geographical information system spatial analysis (GISSA), GIS in planning. It highlights the relative suitability of certain methods to particular applications and contrasts their differences, strengths and weaknesses; then GIS demographic analysis. It ends by introducing multi dimensional GIS for Demographic modelling where it outlines 2D, 2.5D, and 3D GIS to give an insight.
    Chapter 3, starts with 2D GIS demographic analysis, then move on to examining the advances and work done in terms of demographic surface analysis and modelling, then derivation and interpretation of surface parameters; then introduce the aspect of 3D GISs; It discusses the need and criteria for a demographic surface representation, analysis, modelling using 3D GIS, which leads to chapter four dealing with 3D demographic analysis and modelling.
    In Chapter 4, a complete modelling approach is described in details. Starting from demographic 3D modelling problems, definition and documentation of demographic terms to be used, analysed and modelled; then details 3D GIS (data structures, georeferencing, etc), the modelling of the third dimension taking field demographic data as the input, representation of Demographics as 3D spatial objects, describes the use of spatial tessellation using Voronoi diagram and triangular irregular networks (TIN) to construct and represent demographic characteristics where the issues of interpolation and extrapolation come into play; conversion of data points into triangular irregular networks, a new method to improve the modelling quality of these TINs is described i.e. Algorithms for generating triangular irregular networks in three dimensions (3D TIN) will be developed to come out with the 3D TIN to be used in the 3D-DM, demographic quantitative modelling.
    Chapter 5 gives visualisation of demographic data - here the concentration is using the existing GIS, Scientific, and Geographical visualisation techniques. Then, uncertainty in GIS analysis where fuzziness is considered in the methods of Demographic analysis and modelling not in errors in data obtaining/observation and storage; Followed by the evolving the GIS DM, where the concern is about integration the developed models with other datasets. This chapter concludes by looking at a possible structure of utilising these techniques in planning analysis.
    Finally, Chapter 6 discuses the merits and limitations of this approach and a comparison with closely related current work by summarising the research, documents and recapitulates the main issues (results) and the study contributions obtained throughout the research and highlights areas of future work.

    Figure 1.3 shows the main partitions of this thesis and a visual overview of its contents.
    [​IMG]
    Figure 1.3: visual overview of the main portions of the thesis
  9. lan0303

    lan0303 Thành viên mới

    Tham gia ngày:
    24/05/2003
    Bài viết:
    2.622
    Đã được thích:
    0
    --------------------------------------------------------------------------------
    Chapter two
    GIS and Demographics in planning
    --------------------------------------------------------------------------------

    http://www.hbp.usm.my/THESIS/heritageGIS/thesis/Chapter2.htm
    2.1 Demographics in planning
    2.1.1 Introduction

    Spatial planning is becoming increasingly demanding requiring spatial and non-spatial data (Jebasingam, 2000; Nasruddin, 2000), one of the data for input is demographics, as in planning any area the growth potentials must be expressed in terms of the population it is expected *****stain õ?" Chief among those is analysis of the size of population, composition, characteristics, and spatial distribution (Chapin, 1965; Haining, 1990; Klosterman, et al. 1994; and Plane, et al. 1994). This type of disaggregate data is needed in the preparation and implementation of Comprehensive Plans, location-allocation plans or development plans which deal with the process of growth/decline of cities and metropolitan areas include structure plan and local plans encompassing action plans, zonal plans, and subject plans. Although the structure plan is intended to translate national and regional economic and social polices into a local context, and in doing so provide a framework for the implement of local plans (Ratcliffe, 1993), they indicate the action areas, which are determined spatially depending on the demographic composition. Local plansõ?T purpose being to implement the intentions and fill in the details of the policies and proposals in the structure plans (Healey Pasty, 1983).
    2.1.2 Disaggregated demographic data
    The Present Demographic analysis in planning, taking the case of Penang state, Malaysia; demographic data is reported according to age (5 year cohorts), ***, martial status, ethnicity, household size, type of household (like single person household, nuclear family households, extended family, headship rate, and non private households), and growth rate but aggregated to enumeration blocks to be used in planning analysis (State population report Pulau Pinang, 1995; Penang state databank, 1996). When it comes to plan preparation, demographic data used is presented in form of tables, but it is not included in the draft i.e. it is not mapped (Kuala Lumpur structure plan, 1984).
    Analysis of population structure is about looking at it at disaggregated level of Families, households, individuals, Gender, Race, age and ethnicity. As Eversley, et al. (1982) states, the key to the analysis of consequences of change in demographic for welfare policies lies not in the aggregate of number, but in the structure of the population. Taking an example like a change in the population may be represented by a proportional reduction of households of all types, or a similar reduction in average households size, or a combination of both of these, and if otherwise the population were similar in structure, composition and distribution, then under that assumption of ''change in policy'', expansion of infrastructure would be constant, these assumptions are sometimes quite unrealistic, which calls for disaggregated analysis.
    2.1.2.1 Demographic data aggregation problem
    In demographic analysis the higher/bigger levels are produced by aggregation of lower levels; if different resolution data exist, they are integrated usually by aggregating all data to the level of the highest-level dataset (provided that they refer to the same class of spatial units). Population aggregation becomes a critical problem when it comes to allocation planning; among these are economic resource allocation, facility location, and recreation location planning; which all require detailed population spatial distribution with demographic characteristics for special planning (Planes, et al, 1994). There are three basic types of Locational problem which need spatial population planning (Openshaw, 1991). 1) Pure location problem: which involves findings the optimum geographical or spatial location of a single facility to serve a fixed set of demand. For example to locating a youth centre. 2) Location problem: here it is assumed that the location of demand points (viz. people) and the location of two or more facilities are both known and fixed. The problem is to determine an optimal allocation of the demand points to facilities so as to satisfy a particular objective; for example determining which people go to the youth centre. 3) Location-allocation problem: this combines the above two. That is given a set of fixed demand points determine the optimum locations for two or more facilities so that they best serve the demand points. For example taking the location of more youth centres given the population in the study area.
    Before we look/seek for different ways of analysing population to avoid such analysis fallacy, it important to know why analysis is done at such aggregation level, so that advantages of aggregated geographical analysis are incorporated in our developments and improvement. The justifications for this analysis could be seen as (Openshaw, 1991):
    ã It is important to have some consistent measure of sparsity through the development of block grant indicators by which the government''s (department) standard spending assessment
    ã The density index is simple and so can readily be understood by policy makers.
    ã Political subdivisions (zones) are the smallest geographical unit for which this index could be accurately calculated because the zone areas are known.
    ã Zones have been claimed to possess some local significance as neighbourhoods and therefore to provide a natural building block
    ã Zones have been used for a number of other key indicators with resource implications index like defining deprivation areas for health service resource allocation.
    ã Zones boundaries are statutorily defined and posses a legal significance- this is important because public expen***ure has been conventionally been allocated only through processes that recognise official geographical areas.
    ã Those are manageable given the computer; and In the absence of much (or any relevant research there was no obvious alternative approach)
    2.1.2.2 Shift to disaggregated analysis
    Although demographic aggregation may have the above justifications and the following four main advantages i.e. aggregating data does not provide much burden on computing resources; do give sufficient insights into system-wide behaviour by facilitating the understanding of the behaviour of groups of people (Fotheringham and Rogerson, 1993), spatial aggregation is a form of simplification, which furthers our understanding of a complex problem, and by aggregating spatially, errors in poor quality data will tend to cancel.
    But the computing limitations is now history as modern electronic computers are able to handle large volumes of data when a highly disaggregated spatial representation is adopted especially when the GIS technology is capable of handling the finest level of resolution required.
    Disaggregate models enable to learn about individual behaviour and from this the aggregation can be performed where the planner is not interested in individual behaviour.
    Although by aggregating spatially, errors in poor quality data will tend to cancel. Research evidence, however, suggests that for a given set of data, aggregating data into spatial units generates errors called Modifiable Areal Unit Problem (MAUP) whereby possibly false interpretations are made from analyses purely as a result of arbitrary aggregations of the data (Openshaw, 1984; Fotheringham and Rogerson, 1993; Casillas, 1987; and Lee, 1995) and may even produce relationships, which are non-existent (Thomas and Huggett, 1980). In ad***ion results of aggregation vary according to the planner. Thus, spatial aggregation is likely to create more problems than the benefits derived from its cancelling of errors. In any event, the benefit occurs only when the data quality is poor.
    Tra***ionally population are collected mainly using the field survey method where information about each individual is recorded, but this population data is later aggregated mainly according to zones to be used in planning analysis. This leads to hiding important spatial information mostly about individuals and end up by not using data of spatial allocation of people, which is very needed for efficient social planning. We aught to change and the question of resources should not be the main setback as the same data collected tra***ional can be utilised in disaggregated spatial analysis. Even though the data have not been released at the micro-data level because of privacy protection issues, the planner has to analysis and takes advantages of using non-aggregated data. Software control can be used to protect privacy after the planners have analysed the data at the micro-data level.
    2.1.3 Need for demographic spatial analysis
    Although the physical appearance and functioning of the city are the tra***ional focus of city planning (Solesbury, 1974) and city planners may report to mayors, city managers, or other officials, their true clients are the people and businesses of the city. Their plans must reflect the interests and priorities of these two groups and also the programs that are implemented, at the same time help the city survive and maintain the quality of life that these groups desire. The city''s population is an important concern and in planning analysis, demographic data is termed as being very important and in sustainable development, which is, ultimate planning goal; it is declared as the ultimate requirement.
    On the side of a planner s/he needs to know the location of different demographic characteristics, their quantities, how they vary from one location to the next, and which demographic characteristic to be considered for which planning analysis.
    Finally, demographic spatial analysis is needed more in this 21st century, as the newest generation of adults, younger than most city residents are becoming the majority (Listokin, 1999); cities have to responding by directing public services and capital improvements toward upgrading the quality of life in those areas that have unique attractions for this new population. Also different groups of city residents have become more sophisticated in pursuing their special interests. They are better informed, understand laws and procedures, have greater political skills, and are more militant and persistent. They have learned that planning brings order to change and, thus, they want to influence the planning. In turn, city planners have to balance the demands of competing interests into a dynamic community consensus sufficient to allow decisions to be made. This calls for a more understanding of the population demographic composition and spatial distribution, which is done more efficiently in GIS. But before going into details starting from section 2.4 up to chapter five, first take a look a demographic statistical analysis in section 2.2, followed by GIS data analysis and modelling in section 2.3.
    2.2 Demographic Statistical Analysis
    2.2.1 Introduction

    Demographic analysis is predicated on accurate and systematically recorded population data for the area. The methods, which can be used, include (Chapin, 1965): 1) complete periodic census enumeration, 2) continuous population registration, and *****pplement these, a third major means of obtaining population data is by estimation.
    The methods of statistical data analysis fall into Multivariate data analysis and univariate data analysis. Univariate analysis involves the examination across cases of one variable at a time. There are three major characteristics of a single variable that are look at: the distribution, the central tendency, and the dispersion. Univariate statistical techniques represent a variety of basic descriptive statistics and include: Poisson process, nearest neighbour analysis, refined nearest neighbour analysis, K-function, weighted K-function, space-time Knox, Join-Count statistics, Global Moranõ?Ts I and Gearyõ?Ts c, general Getis-Ordõ?Ts G, local Moranõ?Ts, local K-function, spatial autocorrelation, autocorrelograms, and variograms (Haining, 1990; Cressie, 1991; and Fotheringham, et al, 1994)
    As Trevor (1994) observe; spatial econometric modelling, geostatistical and spatial general linear modelling are concerned with modelling the relationship between one response variable of particular interest and others that may explain its spatial variation. There are situations where several possible response variable needs to be dealt with simultaneously and this bring into consideration multivariate statistical techniques. Multivariate statistics provide the ability to analyse complex sets of data. Multivariate statistics provide for analysis where there are many independent (IVs) and possible dependent variables (DVs), which are correlated to each other to varying degrees. The most commonly used methods of modelling multivariate data include (Fotheringham, et al. 1994; Plane, et al. 1994, pp. 308-321; and Trevor, 1994) descriptive statistics, multivariate statistical analysis, multivariate spatial correlation, Clustering, Geostatistical, Spatial econometric modelling, factorial ecology and spatial general linear modelling.
    2.2.2 Spatial statistical analysis
    Under spatial analysis, the focus is a spatial data set i.e. a data set in which each observation is referenced to a site or area (geographical location). Much of demographic data is collected in spatial context and requires statistical analysis for interpretation. Methods of analyses of spatial data include data description, map interpolation, exploratory data analyses (descriptive statistics), explanatory analyses and confirmatory data analyses (statistical inference and development and testing of models) (Haining, 1990).
    There are several reasons why spatial analysis is key to integrated assessment framework. First, there is a strong link between humans and their environment. Spatial analysis techniques and methods help to incorporate spatial elements so that develop a clearer picture of this human/environment link. Second, for population study, different group''s outcomes require varying spatial resolution of population model. Last but not least, people''s actions and activities are spatial. Adding a spatial perspective can often add an important dimension to a study. For instance, using spatial analysis researchers could identify geographic clusters, define service areas for facilities, as well as develop models to calculate the impact of changes in populations.
    Spatial statistics is the area of statistics concerned with data collected at various points in space. Spatial statistics summarize and describe numerically a variety of spatial patterns. Spatial statistics fall into three categories: Point pattern analysis, spatial autocorrelation, and Geostatistics (include descriptive spatial statistics) (Cressie, 1993)
    2.2.2.1 Spatial Pattern analysis
    Generally, analysis of spatial data involves the usage of either the connectivity or the similarity of spatial objects. A data set consisting of irregularly distributed points within a region is referred as (spatial) point pattern. In point pattern analysis the spatial properties of points are studied rather than the individual entities (quality of the point). Points are one-dimensional features, thus the valid measures of point distribution are the number of occurrences in the pattern and respective geographic location (Chou, 1997). The objective of analysis of a point pattern may involve test of complete spatial randomness (CSR), estimation of intensity, stochastic model fitting (Involving or containing a random variable or variables) etc., to provide an explanation of the underlying processes. Point pattern analysis is concerned with the location of events, and with answering questions about the distribution of those locations, specifically whether they are clustered, randomly or regularly distributed (Bailey and Gatrell (1995); Cressie (1993)). to determine the relationships between points in geographic space is accomplish by using a number of statistical techniques including the use of basic descriptive statistics (i.e. mean, standard deviation, etc.), Poisson process using the chi-square test statistic, Nearest neighbour distance using the R test statistic, quadrat analysis, and Spatial autocorrelation using Geary''s C and Moran''s I test statistic (Chou, 1997)
  10. lan0303

    lan0303 Thành viên mới

    Tham gia ngày:
    24/05/2003
    Bài viết:
    2.622
    Đã được thích:
    0
    b]2.2.2.2 Nearest Neighbour Analysis
    Nearest neighbour analysis examines the distances between each point and the closest point to it (Fotheringham, et al 1994 and Wulder, 1999). The Nearest neighbour is a method of exploring pattern in Locational data by comparing graphically the observed distribution functions of event-to-event or random point-to-event nearest neighbour distances, either with each other or with those that may be theoretically expected from various hypothesized models, in particular that of spatial randomness (Upton, 1985), i.e. it describe distribution of points according to their spacing.
    The Nearest neighbour index measures the degree of spatial dispersion in the distribution based on the minimum of the inter-feature distances (Chou, 1997), i.e. it is based on the distance between adjacent point features. Such that the distance between point features in a clustered pattern will be smaller than in a scattered (uniform) distribution with random falling between the two. The equation for the nearest neighbour is computed through the following steps
    Ad = (sigma[sub]i[/sub]d[sub]i[/sub])/n.
    d[sub]i[/sub] is the distance from point i to its nearest neighbour; Ad is the average of nearest neighbour distance of the point pattern; n is the total number of points in the chosen map area.
    Ed=1/2sqr(A/n)
    Expresses the expected value of the average nearest distance; A denotes the map area
    NNI=Ad/Ed
    Equation for the nearest neighbour index, it is defined as the ratio of Ad to Ed
    The values of NNI range between two theoretical extremes, 0 and 2.1491. When all the points in a pattern fall at the same location, the pattern represents the theoretical extreme of spatial concentration, in this case, Ad = 0 and NNI = 0. The more closely the points are clustered together, the closer to 0 NNI will be, since the average nearest neighbour distance decreases. The closer NNI gets to 1, the more randomly spaced the points are. The value of NNI approaches 2.1491 for perfectly uniformly spaced points. Hence, the closer NNI is to 2.1491, the more uniformly spaced the data are.
    2.2.2.3 Spatial Autocorrelation
    Spatial autocorrelation may be defined as the relationship among values of a single variable that comes from the geographic arrangement of the areas in which these values occur. It measures the similarity of objects within an area, the degree to which a spatial phenomenon is correlated to itself in space (Cliff and Ord 1973, 1981), the level of interdependence between the variables, the nature and strength of the interdependence, i.e. spatial autocorrelation is an assessment of the correlation of a variable in reference to spatial location of the variable. Assess if the values are interrelated, and if so is there a spatial pattern to the correlation, i.e. is there spatial autocorrelation.
    Spatial autocorrelation tools test whether the observed value of a variable at one locality is independent of values of the variable at neighbouring localities. Spatial autocorrelation may be classified as either positive or negative. Positive spatial autocorrelation has all similar values appearing together, while negative spatial autocorrelation has dissimilar values appearing in close association. A positive spatial autocorrelation refers to a map pattern where geographic features of similar value tend to cluster on a map, whereas a negative spatial autocorrelation indicates a map pattern in which geographic units of similar values scatter throughout the map. When no statistically significant spatial autocorrelation exists, the pattern of spatial distribution is considered random (Chou, 1997)
    There are many measures/indicators of spatial autocorrelation (Cliff and Ord 1973, 1981; Goodchild, 1986; Haining, 1990; and Chou, 1997): 1) Global indicators of spatial association, join count statistics; Moran''''s I (Moran, 1948) and Geary''''s c (Geary, 1954); the null and the alternative hypothesis; general cross-product statistics; normal, randomisation and permutation approach; and spatial Correlogram. 2) Local indicators of spatial association -- LISA Gi and Gi* statistics; LISA statistics; local Moran; inference for LISA; spatial outliers. 3) The variogram approach to spatial association the geostatistical perspective; variogram and semi-variogram; variogram vs. correlogram; fitting a variogram model; robust estimates of a variogram; interpretation of a variogram; variogram and spatial sampling.
    2.2.2.4 Descriptive Statistics
    Descriptive statistics addresses itself *****mmarizing in brief form the information contained in a distribution. They are used to describe the basic features of the data in a study. They provide simple summaries about the sample and the measures, present quantitative descriptions in a manageable form and help us to simply large amounts of data in a sensible way. Descriptive statistics are divided into basic descriptive statistics (these are aspatial- include central tendency (shows the trend in the distribution: include mean, median, and mode) and dispersion (shows the extent of dispersion about the central tendency: three common measures of dispersion, the range, the standard deviation, The entropy is an index of uncertainty representing in a quantitative way how well we can predict which value a random variable will take on, Skewness measures the extent to which the bulk of the values in a distribution are concentrated to one side or the other of the mean, and Kurtosis measures the extent to which values are concentrated in one part of a frequency distribution)) and descriptive statistics for spatial data (Chou, 1997; Willemain, 1980).
    2.2.2.4.1 Descriptive statistics for spatial data
    The section dealt with a simple set of numbers, made no reference to geographic location, x, y coordinates or anything spatial. What would we need to do to understand spatial relationships among points? Although there is an entire sub-discipline devoted to Geostatistics, I touch upon only a few of the techniques that can be used to explain spatial patterning. The distribution of point features can be described by frequency, density, geometric center, spatial dispersion, and spatial arrangement (Chou, 1997).
    Geometric center: The geographical properties of a point pattern are characterized by the geometric center, the dispersion, and spatial arrangement (Chou, 1997). This shows how points are distributed over the map area and whether the points are near each other, near the center of a demarked area (say occupied by certain ethnic group) or clustered near the corner.
    Spatial Mean: This statistic locates the "centre of mass" of the data. If you consider the area of study as being a thin plate (of zero mass), and the value of each data point as being a point mass on the plate, the spatial mean is the location you''''d have to put your finger under to have the plate balance on it. Each coordinate of the spatial mean is computed separately, using the grouped data mean formulae:
    [​IMG]
    If the spatial mean of the data is significantly different from the geographic centre of the region, this indicates a non-uniform distribution. If the individual x and y coordinates of the data points are not known, the spatial mean can be estimated, at the cost of introducing measurement error, by the following procedure: Impose a rectangular grid on the area. The grid spacing must be uniform on the x and y-axis, but need not be the same for both. Assign values (odd integers, beginning with 1) to the midpoints of the spaces on both axes. We do this so that zero doesn''''t come in to complicate things. Sum the frequencies (i.e. data point values) in each column along the x-axis and row along the y-axis.
    Standard Distance: This is the two-dimensional equivalent of the standard deviation, and is a common measure of dispersion. a large value of the standard distance means that the points are relatively scattered, while a small value means they are relatively clustered.
    [​IMG]
    2.2.3 Multivariate Demographic Analysis
    Multivariate analysis is explored in this research as it has a big family of techniques and it is promising for GIS demographic data in planning. Each technique has its own special capabilities and unique instances of applicability. The family of techniques can assist in the accomplishment of 1) description (find patterns of relationships where the human eye and even univariate or bivariate statistics fail to do so), 2) explanation (other techniques have special capabilities to explain or to help explain relationships for instance, they can isolate the impact of one variable on another; show relative differences between the magnitudes of impact for two or more variables; or even reveal how one set of variables impinges on another set, 3) prediction (Certain multivariate analyses are explicitly designed to yield predictive models with specific levels of accuracy) and 4) control (the techniques themselves will not institute control, but their application can help a decision maker develop cause-and-effect relationships and models, which will ultimately enhance their ability to control events to some degree).
    As data sets for demographics are always big sized, a factor analysis, which is an interdependence technique (i.e. the variables are left in a single set, rather than being divided into two sets) is desired to study the interconnections (correlations) among the variables), helps in assessment of performance or attitude of different variables, i.e. grouping variables which tend to lead to same conclusion, ending up with few factors.
    Linear Regression estimates the coefficients of the linear equation, involving one or more independent variables that best predict the value of the dependent variable. Example, Is the location of residence of person related to the ethnic group? A scatterplot may indicate that these variables are linearly related. The number of new people of coming to a particular location and total population also linearly related. These variables may have a negative relationship. As the number of population increases, the average number of people coming to the place decreases. With linear regression, you can model the relationship of these variables (SPSS, 1998). A good model can be used to predict how many people will come to the area.
    Discriminant analysis: Using the example of location of youth centre, there are many demographic characteristics, which have to be input in the analysis process. There is need to group the characteristics in different groups according to their influence on the target decision. We may find that age and *** have greater effects in determining the youth centre location and facilities than race and religion, then we assign them greater weight and group them differently.
    Multiple regression could identify a few significant predictor variables. MANOVA might reveal some cases of significant differences. Multiple discriminant analysis (a body of techniques for classifying (assigning, allocating) each individual in a sample to one of a number of prescribed groups) perhaps would find few significant variables. Also multivariate techniques automatically assess the significance of all linear combinations of the observed variables i.e. how certain combination is not more important than other or the variables themselves.
    2.2.3.1.1 Cluster analysis
    Cluster analysis (CA) classification is based upon the placing of objects into more or less homogeneous groups, in a manner such that the relationship between groups is revealed. Cluster analysis identifies and classifies objects individuals or variables on the basis of the similarity of the characteristics they possess, it seeks to minimize within-group variance and maximize between-group variance, the result of cluster analysis is a number of heterogeneous groups with homogeneous contents: There are substantial differences between the groups, but the individuals within a single group are similar; Cluster analysis partitions the set of observations into mutually exclusive groupings in order to best represent distinct sets of observations within the sample.
    Clustering methods may be Divisive Method i.e. top down and employ logical division, or Agglomerative Method i.e. bottom up and undertake aggregation. Agglomerative Method (this hierarchic procedure begins with n clusters (each object makes one cluster), which are united step by step, until we get one single cluster. Divisive clustering is mostly hierarchic. The contrasting direction of the functioning is the main difference from the agglomerative method. It starts from one cluster, and with each step we divide one cluster into two smaller ones until each one contains only one object. (Rudolf Dutter, 1996) Aggregation procedures, which are based upon combining cases through assessment of similarities, are the most commonly used. Methods of clustering techniques include: K-means, Diversity measures, segregation measures, and methods like ward''''s method (Davis, 1986).
    Hierarchical cluster analysis is a statistical method for finding relatively homogeneous clusters of cases based on measured characteristics. It starts with each case in a separate cluster and then combines the clusters sequentially, reducing the number of clusters at each step until only one cluster is left. When there are N cases, this involves N-1 clustering steps, or fusions. This hierarchical clustering process can be represented as a tree, or dendrogram, where each step in the clustering process is illustrated by a join of the tree. "Divisive" clustering begins with one large cluster and proceeds to split into smaller clusters items that are most dissimilar) and Nonhierarchical clustering (is partitioning of the sample. Each cluster has a seed point and all objects within a prescribed distance are included in that cluster e.g. K-means clustering) are used. Start with hierarchical to generate and profile the clusters and then use nonhierarchical to fine-tune the cluster membership with its switching ability. In this case, the centroids from hierarchical clustering are taken as the seeds for nonhierarchical clustering.
    K-means is one of the popular clustering techniques. It aims to minimize the sum of the squares of the distances from all the data points in the cluster to their nearest cluster centers (Parker, 1995). Moh?Td Al-Daoud and Stuart Roberts outlines the K-means method as follows. The k-means algorithm starts with initializing the clusters represented by K cluster center. The data points are then allocated (assign) to one of the existing clusters according to Euclidean distance from the clusters, choosing the closet. The mean (centroid) of the each cluster is then computed so to update the cluster center. This update occurs as a result of the movement of the cluster centers towards data points. The processes of re-assigning of the data points and the update of the clusters are repeated until the change in the value of the entire cluster means (centroid) are within some predefined limits.
    Diversity measures: Diversity is about measuring the amount of heterogeneity of an areâ?Ts population (Plane, 1994). A diversity index is a single number that indicates the relative amount of heterogeneity of a population. The commonly used indexes are the entropy index and the interaction index. The high values indicate that the sub groups of the population are equally present; where as lower values indicate the predominance of a single subgroup e.g. identification of the dominant ethnic group in the study area.
    Segregation measures: According to David A. Plane and Peter A. Rogerson (1994), segregation is about gauging the extent to which persons with different demographic characteristics are geographically clustered. i.e. segregation indexes can be used to reflect the extent to which the various subgroups (ethnic groups) of the total population are clustered within the geographic sub area (study area).
    2.2.4 Presentation techniques
    Presentation techniques cover different approaches to the visualisation and presentation of demographic datasets. These approaches are designed around the concept of data spaces, and present the user with a series of tables, pictures, or graphics, each describing a data space, and with tools to explore the synergy between data spaces data presentation and visualisation.
    For pictures and graphic for demographic presentation, the task is relating people to where they actually occur on the ground. In most cases this means mapping the distribution of people in terms of their place of residence. Tra***ional this has been accomplished in many ways: using data tables, Data pictures and Graphics (symbols for location e.g. circle, cubes); Choroplethic maps, cartograms or Lorenz curves (Hornby, 1984; Witherick, 1990; Indiana State University)
    2.2.4.1 Choropleth technique
    This involves mapping the distribution in terms of the relationships between the numbers and the area, a measure usually referred to as population density. The disadvantage with this; is that none of them relate to the actual areal units to be used in the analysis and maps represent average values for the chosen areal units (Witherick, 1990). The spatial aggregation according to the imposed arbitrarily zones tend to persist and indeed they often dominate subsequent analyses (Hearnshaw, et al, 1994). Also their interpretation may give false impression; this happens particularly where adjacent areas show significant different density values; the map indicate, quite erroneously; a marked break in the continuity of population distribution occurring along the boundary between two areas, when in fact there is a smooth transition in densities. There is also some technical problems encountered in the compilation of population density maps i.e. how many different classes should be recognised and how should these classes be delimited? Also as Witherick (1990) put it, population density per unit area is a very crude measure, as it does not put into consideration the inhabitable land (areas) and other physical considerations. Another shortcoming of this method as it is based on areal units (zones) is that of variable size of the spatial units and also the implied assumption that all attributes of a zone are informally spatially distributed throughout the zone (Wegener, 1999); not accounting for the topographical relationships and ignore the fact that demographic characteristics and activities are continuous in space.
    2.2.4.2 Cartograms[/b]
    The visualisation of demographic data has always been done by use of cartograms (maps in which a particular exaggeration is deliberately chosen). Although a population cartogram is an appropriate basis for seeing how something is distributed spatially across groups of people, such cartogram is not a distortion of the world, but a representation of some particular aspect of it (Dorling, 1994), but makes spatial analysis difficult, as some details cannot be retrieved making them inappropriate for detailed local population spatial analysis. Also it makes it difficult to judge density, as the appearance of a cartogram of the same population will vary from one person to another. Also the scale of visualisation becomes more local, the quality of representation of the demographic data and its spatial distribution begins to break down (Bracken, 1994) making interpretation of results dependent on scale of visualisation.
    Được lan0303 sửa chữa / chuyển vào 04:56 ngày 22/11/2005

Chia sẻ trang này