Final

Document Sample
Final Powered By Docstoc
					                  CO7201 Individual Project


Towards a Geographical Information System
     for the Leicestershire & Rutland
           Ornithological Society




               Final report
                       Christos Zivlas


Supervisor: Fer-Jan de Vries
Second marker: Paula Severi

                          2010-2011
Table of Contents
1.         Abstract ............................................................................................................................................. 4
2.         Declaration ........................................................................................................................................ 5
3.         Introduction ....................................................................................................................................... 6
3.1 Aims......................................................................................................................................................... 6
3.2 Objectives................................................................................................................................................ 6
3.3 Challenges ............................................................................................................................................... 7
3.4 Literature Survey ..................................................................................................................................... 7
                   3.4.1 Literature ......................................................................................................................... 7
                   3.4.2 Existing software ............................................................................................................. 9
                   3.4.2.1 Leicester and Rutland Ornithological Society web page .............................................. 9
                   3.4.2.2 British Dragonfly Society web page........................................................................... 10
                   3.4.2.3 BirdTrack.................................................................................................................... 11
4.         Technical and theoretical background ............................................................................................ 12
4.1.        Geographical information system theory ....................................................................................... 12
                   4.1.1 Map types ...................................................................................................................... 12
                   4.1.2 Grid systems .................................................................................................................. 12
                   4.1.3 Distance calculation of two points on earth................................................................... 13
4.2.        Geographical information system technologies ............................................................................. 14
                   4.2.1 Google maps .................................................................................................................. 14
                   4.2.2 Yahoo maps ................................................................................................................... 15
                   4.2.3 Openstreet maps ............................................................................................................ 15
                   4.2.4 Bing maps ...................................................................................................................... 15
                   4.2.5 Google Geocoding ......................................................................................................... 15
4.3.        Programming languages ................................................................................................................. 16
                   4.3.1 HTML5 vs Flash vs Silverlight ..................................................................................... 16
                   4.3.2 Ajax vs Actionscript ...................................................................................................... 17
                   4.3.3 PHP vs ASP ................................................................................................................... 17
                   4.3.4 My SQL vs XML .......................................................................................................... 18
5.         Software product ............................................................................................................................. 19
5.1 Maps...................................................................................................................................................... 20


                                                                                                                                                                 2
                   5.1.1 Add Entry ...................................................................................................................... 20
                   5.1.2 View Entries .................................................................................................................. 23
5.2 Analysis................................................................................................................................................. 28
5.3 Database ................................................................................................................................................ 31
6.          Testing............................................................................................................................................ 33
7.          Planning and Timescales ................................................................................................................ 35
7.1.        Work and Deadlines ....................................................................................................................... 36
8.         Critical appraisal ............................................................................................................................. 37
8.1 Problems faced ..................................................................................................................................... 37
8.2 Completed Work ................................................................................................................................... 38
8.3 Limitations............................................................................................................................................. 38
9.         Bibliography ................................................................................................................................... 39
10.        Appendix ......................................................................................................................................... 44




                                                                                                                                                                3
1. Abstract
    The current project is an online Geographical information system design and implemented specially
for bird watchers. It is an online tool aims to help not only birdwatchers in the area of Leicester but
globally. Through its intelligence interface and by the use of the Google maps technologies allows easy
organization of observations and extraction of conclusions by the use of maps and graphs. The current
report aims to analyze the main principles and technologies on Geographical information systems, it will
present a detailed description of the project (aims objectives, challenges) furthermore it will present
existing software constructions with their positive and negative characteristics. In addition the several
technologies used for the construction of such a system will be compared and then the final software
product will be presented with its interface and functionality. The developer will try to explain the
process start by the interaction of the user with the interface. Finally aspects consider as drawbacks for
the product system will be discussed.




                                                                                                        4
2. Declaration
   All sentences or passages quoted in this report, or computer code of any form what so ever used and/or
submitted at any stages, which are taken from other people's work have been specifically acknowledged
by clear citation of the source, specifying author, work, date and page(s). Any part of my own written
work, or software coding, which is substantially based upon other people's work, is duly accompanied by
clear citation of the source, specifying author, work, date and page(s). I understand that failure to do these
amounts to plagiarism and will be considered grounds for failure in this module and the degree
examination as a whole.

Name: Christos Zivlas
Signed:
Date: 3/03/2011




                                                                                                            5
3. Introduction
    The continuous evolution of technology generates the need of systems upgrade. The current
project seeks to develop a new system for LROS (Leicestershire and Rutland Ornithological
Society). It will give an idea on how modern technologies can apply and give solutions to
society’s tasks. Leicestershire and Rutland Ornithological Society use an old fashion stand alone
system to collect data about observations their members make. To be more specific the members
have to install on their computer the LROS Recorder, a standalone software that generates a file with the
observations the user made. When the observation file is generated the used has to email the file to the
LROS secretary. The secretary it is responsible to get the email and put the data on the society system.
Moreover the old not user-friendly system has limited functionality, it allows only storing
observations without providing any other service. Analysis of the observations is done monthly
by the use of a monthly report forms and external software tools, sometimes mistakes happen
during the procedures so wrong conclusions for the observations are taken at the end. By its
nature the current project makes suitable to use a Geographical Information System (GIS) for the
needs of the LROS. A Geographical Information System is a system that deals with the
presentation, analysis and management of geographical data [1]. A big advantage with GIS is
that enables people by the use of map pictures and graphs to end up with conclusions faster.

3.1 Aims
    The problems mentioned generated the need for implementing a new system that will make
the life Ornithological Society’s members and Society’s secretary easier. The new system has to
be web based in order to enable sharing information with the members and make use of GIS
technologies like Google maps or Bing maps. Its functionality will allow the society members to
add observations (this will reduce the amount of work secretary has to do) or view observations
made by the use of a geographical information system. Furthermore, it will allow members to
review or access analysis and other data easier. Moreover the analysis of data must be
implemented automatically by the system so as to reduce the amount of work for the secretary.
An automated system analysis has to be implemented with the right algorithms so as to produce
the right results. The systems functionality will be accommodated in a friendly and easy operated
graphical user interface.


3.2 Objectives
    Create and manage database with observations.
    The system should allow user to input data and select choices in an easy and user friendly way.
     Furthermore the system should behave, respond reasonably well with huge amount of data.
    Create and maintain a geographical information system for the needs of LROS.
    A user of the system should be able to:
       Add markers on a map according to an observation did.
       See observations made on a map.
       Make queries on observations made.


                                                                                                       6
             Calculate the actual distance between 2 locations on the map.
             Add or remove grid on the map.
             See grouped observations when zoom-out on the observations map.
             See ungrouped observations when zoom-in on the observations map.
             Produce automatic analysis for data they import.
             See statistical data about bird observations that are produced by the system automatically
             Export observations and statistical data on PDF format.
             Export maps according user’s preferences.


3.3 Challenges
    The current project it seems to be challenging for the following reasons:

             Needs to understand concepts on GIS.
             The following parts on the development of a GIS systems seem to be challenging:
                 Load data from a database and place markers with the appropriate colour on the
                    appropriate location on the map.
                 Update the map according to queries.
                 Update the map when dragging.
                 Draw grid on the map.
                 Group observations when zoom-out on the bird observations map.
                 Ungroup observations when zoom-in on the bird observations map.
                 System performance on large amount of data.
                 Present data and produce statistical information for the users.
                 Create a user friendly interface.
                 Recognize a location on the map according to a grid.
                 View multiple maps.
                 Create and export analysis in PDF format.
                 Export map images.


3.4 Literature Survey
     In order the current project to succeed a deep understanding in the area of geographical information
 systems and technologies around is necessary. To be more specific requires understanding in
 technologies like Google maps, Bing maps, Yahoo maps and Openstreet maps. More over a deep
 understanding on client-server and database technologies is required. In addition the research needs to
 cover similar pieces of software exist in the current area. The last will help to identify, the right
 technologies to be used, drawbacks of the existing software to avoid.



3.4.1 Literature
     http://www.lros.org.uk:


                                                                                                           7
    This is the site of Leicestershire and Rutland Ornithological Society. The mentioned site will help
    me to identify the needs of the society as the current project seeks on creating a system to fulfil
    the needs of this society.

 Fundamentals of Geographical Information System, P.L.N. Raju, Geoinformatics Division
  Indian Institute of Remote Sensing:
  The current paper gives the fundamental knowledge on GIS domain.

 Web Programming Building Internet applications, Third edition(Chris Bates):
  This source contains details on creating web applications using Html, PHP, XML, Perl,
  JavaScript and Mysql. It will be used to built the connection with the Mysql database.

    www.w3schools.com:
    One of the most popular site with online tutorials. This site includes tutorials on html, php,
    JavaScript, ajax, css, sql and more. It is an easy access to information’s on web programming.

 www.html5canvastutorials.com
  This site contains a tutorial on using the HTML5 canvas.

 Sams Teach Yourself Ajax, JavaScript, and PHP All in One (Phil Ballard):
  This is a detailed guide on Ajax JavaScript and PHP. It is composed from the theory on these
  technologies and examples.

 www.switchonthecode.com/tutorials/javascript-tutorial-the-scroll-wheel
  This is an example of how to use mouse wheels events on javascript

 Beginning Google Maps Applications with PHP and Ajax. From Novice to Professional
  (Michael Purvis, Jeffrey Sambells and Cameron Turner):
  The current book deals with the Google maps technology in pair with Php and Ajax. It is a step
  by step tutorial on building Google maps web applications.

 http://code.google.com/apis/maps/documentation/javascript/:
  This is the official site of Google maps. It is a details manual of Google maps. It includes a detail
  description of functions and objects, and tutorials for using the Google map technologies on
  JavaScript or flash.

 http://vasir.net/blog/openlayers/openlayers-tutorial-part-3-controls:
  This source contains a tutorial on how to manage map controls. It gives an examples on building
  internal and external map controls


 Map Scripting 101: A Guide to Building Interactive Maps and Mashups with Bing, Yahoo!,
  and Google Maps (Adam DuVander):


                                                                                                     8
        This book makes a comparison on the 3 leading technologies for the development of GIS
        applications. Furthermore gives examples on how to build from scratch GIS applications.

     www.sewhgpgc.co.uk/os.php:
      The current site is a reference to the British Grid Reference System. It contains a detail
      explanation of the grid reference system paired with pictures.

     www.svennerberg.com/2008/10/polylines-in-google-maps:
      This is a tutorial on gpolylines. It gives examples with gpolylines.

     http://en.wikipedia.org/wiki/Great-circle_distance:
      This is a source for the calculation of the distance between two points on a sphere.

     http://www.developer.com/article.php/3615681:
      This Website gives an introduction to Google's Geocoding service compared with an example for
      better understanding on how using the Google’s service.

        Database Systems, A practical Approach to Design, Implementation, and Management,
        Fourth Edition (Thomas Connolly, Carolyn Begg):
        The current book deals with the art of implementation and management of database systems. It
        includes all the theory on database systems paired with examples. It will give the knowledge
        needed for implementing and maintain the database needed for the current project.


3.4.2 Existing software
           In order to take an idea about the current project we need to take a look for similar projects
     exist. It is important to analyse the functionality offer and point out negative or positive aspects. This
     section will present 3 existing web projects in the area. These three web projects are system Leicester
     and Rutland Ornithological Society uses the web page of British Dragon Society and finally the Bird
     track website that is an online system for recording birds.

          3.4.2.1 Leicester and Rutland Ornithological Society web page
               This is the official web page of the Leicester and Rutland Ornithological Society. It can be
          found online at www.lros.org.uk. This is a simple web page containing a menu with 11 choices,
          Home, About LROS, Latest Bird News, Meetings and Outings, LROS News, Photo Gallery,
          Bird Recording Birding Sites, Listing, Join LROS, LROS Sales, Contacts and Links. Most of
          the pages content is static with few exceptions. In order to be a member of the society you have
          to print the registration form and post it on a street address. In order add an observation you
          have to install and use the standalone software provided by LROS (LROS Recorder) and then
          send an email to a specific email address containing the observation details [18].




                                                                                                             9
Figure 1: Main interface of LROS Recorder v7

The LROS Recorder allow the user to import data like date, number of birds, comments,
location grid reference and a path to store the product file of the observation report. Once the
user fill the input form and press the Save Records for Email button a file of the appropriate
format is generated.



3.4.2.2 British Dragonfly Society web page
     The current web page belongs to the British Dragonfly society. It is online at
www.dragonflysoc.org.uk. It contains a 12 element main menu. The current site makes use of
advance features in comparison with the LROS site. It uses drop boxes, input boxes calendars
and a mapping system to capture user’s observations. There is a mapping system that is built on
Google maps technology, it allows users to select the location for an observation thought a map
interface. To be more specific users can select a location by entering a grid reference number,
by the post code or by dragging and clicking on the map. In addition the system allows users to
zoom-in, zoom-out on a map. Furthermore they can drag the map and move to a specific map
area. In addition it provides three map modes (Map Satellite, Hybrid) .Finally a click on the map
makes a square to appear on the area selected.

     Drawbacks can be seen on the current system. First of all the system stability and reliability
is a matter. Sometimes it crashes when entering wrong inputs for post code or grid reference.
Moreover sometimes it stacks when zoom-in, finally the guide on how to use the recording tool
shows the level of complexity of the tool [19]. The recording system of Dragonfly society can
be seen in Figure 2.




                                                                                                10
Figure 2: British Dragonfly Society recording system




3.4.2.3 BirdTrack
     This is the result of a partnership between several ornithology clubs. It is a mapping system
for storing organizing and analyzing observations for Ireland and Britain [21]. It can be found
online at www.bto.org/volunteer-surveys/birdtrack. The current system enables users to add
observations, view reports of observations (see Figure 3). A user can extract reports by species
and period. In addition the use of a mapping system made on Google maps the users are able to
select the grid area for an observation. The user can select an area using a grid reference or a
post code. Furthermore the user has options about the type of map to see (Map, Satellite,
Hybrid, Terrain) or even to choose about the grid system to apply on the map (Irish or British
grid) (see figure 4).

      Some of the disadvantages can be seen in this source is reliability and complexity. A user
has to press a lot of buttons on order to get the results of the query he ask for. In addition it is
not clear how to add an observation to the system. Moreover the reports returned by the system
are mainly static images.




Figure 3: Analysis produce by BirdTrack for Bewick Swans seen in 2010




                                                                                                 11
      Figure 4: Mapping system to view observations



4. Technical and theoretical background
  4.1. Geographical information system theory
      4.1.1 Map types
            Several types of maps exist for different purposes. Each type of map presents different
      kind of information. The most common use type of map is the Street map. Its purpose is to
      provide directions to the potential users by presenting the available streets, including
      highways, important buildings and places paired with address details [71].

            Another main type of maps is the topographic map. These maps are mainly composed
      with special lines represent the shape of earth paired with the height from the level of the sea
      and emphasized physical characteristics of the topology of each area. Lakes, rivers, mountains
      and other physical characteristics appear on those maps [71].

           A political map is another type of map. Its purpose is to present the boundaries of each
      country along with the boundaries of each state, city inside each country.

           Variations of each type of map exist according to the information the designer of the
      map wants to present. Transport route maps can be design on the top of road maps,
      population maps can be design on the top of political maps. The evolutions of technology
      allowed the appearance of more map variations. Nowadays maps exist that present all kind of
      information, observations of animals, birds, Earthquakes and more.



      4.1.2 Grid systems
            Grid systems are Geographic reference systems where areas are split on equal size sections
      that are identify by a unique id. The grid reference systems are mainly use to specify geographic



                                                                                                    12
locations. Examples of such a reference systems are: the National British Grid system, the Irish
grid reference system, the Universal Transverse Mercator coordinate system [66].

                                               According to the National British grid system
                                               where UK is spitted into squares of size
                                               500Km.Each square is assign a unique id
                                               consisting of one letter (S, T, N, H, O).Each of
                                               the squares is divided further into squares of size
                                               100. Each of the smaller squares is assign again
                                               an id consisting of two letters. BT grid reference
                                               can be seen in figure 5 [67].



     Figure 5: BT coordinate system [67].




      The Irish grid system is a method used to identify locations in the Republic of Ireland
instead of using the coordinate system with latitude and longitude. The country is divided into
squares of size 100km. Each of the squares is assign a single id letter from A to Z [68].


                                             The Universal Transverse Mercator coordinate
                                            system (UTM) is a global coordinate system that is
                                            used to identify geographical locations around the
                                            world [69]. The UTM mainly used by the U.S
                                            army and the NATO [70]. The system split earth
                                            on sixty zones based on the transverse Mercator
                                            projection [69]. An advantage of such a system is
                                            that the distance between two points can be
                                            calculated by the use of Pythagorean Theorem
                                            rather than the trigonometric formulas [69]. Fiqure
                                            6 shows the UTM coordinate systems.


Figure 6: UTM coordinate systems [70].




4.1.3 Distance calculation of two points on earth
      Under the assumption that earth is a sphere and the radio of earth is a constant the
distance between two points P1 and P2 on earth’s surface can be calculated. The desire length
is the length of the arc K constructed with angle φ and earths radio as figure 7 show. It is


                                                                                               13
     proved that 2Πr is the length of circumference so the formula for the calculation of the arc K is
     given by φ*Radio of earth [63]. The value of the angle φ is given by the formula:




           is the angle between the two points and the center of the sphere,                  is the latitude
     and longtitide of the first point,                is the latitude and longitude of the second point and
           is     -      [64]. The earth’s radio is assign to 6371 km [65].




     Figure 7: Distance calculation of two points on a sphere




4.2. Geographical information system technologies
    Nowadays technologies have been developed and enable humans to capture and realize in
software all this aspects of GIS mentioned in the section 6.1. In the rest of this section an introduction
to the leading technologies will be given.

     4.2.1 Google maps
         This is a free an online service for maps provided by Google. It is one of the most popular
     services that provide map information like directions, non satellite images, street maps, live
     cameras [5], business locator, a journey planner customization of maps [6] and customized
     printout maps [10]. The service can be used by accessing the official Google maps online
     system or by the use of Google maps API. Different flavours of the Google maps API exist, API
     for JavaScript, flash, static maps [7] .In comparison with other similar technologies Google
     maps offer more features but older map data. The popularity of Google map services can be


                                                                                                          14
seen by the fact that almost all mobile companies and mobile operating systems support them
without the need of gps [5]. Moreover Google maps have a special feature called terrain view
that is not supported on other mapping services. This view gives the difference in ground height
[16].

4.2.2 Yahoo maps
     Yahoo is a free online service for maps similar to the Google maps. It enables reusing by
the use of the Yahoo map API available in Flash, Ajax and Map Image [8]. The Map Image
allows to retrieve a static map on a PNG file format. An advantage of Yahoo maps over Google
maps is that is seems to be simpler, that allows the programmer to familiarize itself with the API
and accomplish tasks quicker it offers more details street maps than other technologies. That
means more data and requests to Yahoo map server. Most of the times simplicity has a cost,
Yahoo maps gives less map image details and design features than Google maps, moreover the
geocoding is not as precise as it should be[9].

4.2.3 Openstreet maps
     Openstreet maps are a free online service by MapQuest without any restrictions or
agreements for the potential users [11], that’s because map data are collected from gps devices
and local knowledge in the same idea under wiki pages work [13]. In comparison with other
technologies like Yahoo maps and Google maps Openstreetmaps offers more map coverage,
more detailed maps and better accuracy [12]. The functionality of Openstreetmaps is limited to
street maps only and that is its big disadvantage over the rest technologies.

4.2.4 Bing maps
      Bing map is another online mapping service provided by Microsoft. This is the respond of
Microsoft to Yahoo maps and Google maps. It supports sharing of information, weather forecast
[16], a business locator, a journey planner, distance calculations and more. A big advantage of
Bing is that its map data are newer than the other mapping services [15]. Its API is supported in
Ajax and JavaScript technologies [14].By the use of Silverlight Bing maps achieve smother
Zooming features[15] in comparison with Google maps and Yahoo. Some might consider the
close relation of Bing and Silverlight as a drawback because installation of Silverlight is
required in machines in order Bing to operate in a non Microsoft environment (Windows).It is
important to say that Microsoft makes steps to drop Silverlight for the sake of html5[17].

4.2.5 Google Geocoding
      This is a free service provided by Google that enables software developers to create
applications that are able to pair coordinates to street addresses and street addresses to
coordinates [22]. The process of coordinates to street addresses is known as “reverse
geocoding” [23]. One can use the service by invoking the getLocations interface that accepts a
string that represents a street address and returns an object that contains the coordinates of that
street address or accepts coordinates and return an object contains the street address in human
visible format [22]. It is important to mention that the service has a limit on the requests
performed per day [23], as a result the number of clients per day is also limited to the maximum
of 2500.



                                                                                                15
4.3. Programming languages
   The development of the projects final product requires advance use of programming languages for
presentation of data (user interface) and background processing. This section will present the
available choices, HTML5, Flash, and Silverlight for presentation of data, JavaScript and Action
script as a client side scripting language, PHP and ASP as server side scripting language, MYSQL
for databases.

    4.3.1 HTML5 vs Flash vs Silverlight
        HTML (Hypertext Markup Language) is the most widely used presentation language for the
    past years although alternatives appear along the time [30]. HTML5 in its own allows static web
    sites to be developed, but its flexibility allows to be combined with other languages like PHP
    and JavaScript and to produce dynamic websites. The latest version of HTML version 5 has
    been improved with features like audio and video embedding, SVG elements support, dynamic
    bitmap graphics and dragging [31]

                Advantages of HTML:

                    Simple (anyone can read a tutorial and built a website).

                    Free to use.

                    Supported by all major browsers like Firefox, Google Chrome, Internet
                     explorer and Opera (no need for extra components to be installed).

                    No need for special development software [32].

                    Enables adding semantic data [33].

       Flash is a technology provided by Adobe to build dynamic web sites by the use and
    manipulation of vector graphics [34]. A user interface called Adobe Flash is used for the
    development of the flash application. It allows drawing boxes, writing text, add fancy graphics,
    doing animations and other fancy things. More dynamic features can be added on a flash
    application with the use of action script [35].

                Disadvantages of Adobe Flash:

                    Adobe flash developer tool is not free [44].

                    Requires flash player to run [36].

                    Needs to import the Google maps libraries [38].

                    Takes long time to load [36].

                    Developer needs to be familiar with the flash developer tool that seems to be
                     complicate.




                                                                                                 16
                 Search engines unable to read the content of flash websites (ranking
                  problem) [37].

Silverlight is a framework for building web applications [39]. It is provided by Microsoft and it
has a close relation with Bing maps [17]. Silverlight allows developers to build interactive
websites.

            Disadvantages of Silverlight:

                Requires a plug-in to run.

                   Is not an open source [40].

                Development is done using .NET development tools (Microsoft visual
                 studio) [40].

                Programming languages compatible with Silverlight are those in the .NET
                 framework [41].

4.3.2 Ajax vs Actionscript
     Ajax (Asynchronous JavaScript and XML) is a mixture of technologies (HTML, CSS and
JavaScript) that allows more flexibility on building web applications [45].

         Advantages of Ajax:

                Does not require any pre downloaded software in order to run [42].

                Handle server communication [45].

                Popularity increases support [42].

                Less payload (pages load faster) [46].

                Close relation with Google API [47].

                Get data from server asynchronous (increase application speed)[48].

    Actionscript is an object oriented scripting language provided by adobe [43] for Flash
platform. It works in the client side (browser). It enables developers to add Audio and video in
their flash applications [42].

           Disadvantages of ActionScript:

                Works only with flash [44].

                Requires pre installed components in order to work [44].

4.3.3 PHP vs ASP
    The nature of the current project requires the use of a scripting language that will enable the
developer to build a dynamic web site as a final product. The developer had to choose between

                                                                                                17
the most popular and powerful scripting languages for creating dynamic web sites, the PHP and
ASP.

    PHP (PHP Hypertext Processor) is a scripted programming language enables web
developers to built dynamic web sites [25]. It is a server side scripted language (it runs on a
server) [26] and can be embed into html [27].

     Advantages of PHP:

               Platform independent (runs on Windows, Mac, and UNIX without any
                software to be preinstalled) [24].

               Open source [24].

               Flexible on database connectivity (a connection to several database
                platforms can be establish) [27].

               Running Speed [27].

               No need for extra components to be installed in order to run [28].

               Syntax similar to C and JavaScript.

               Build in features like creation and management of PDF, image and
                Document files, ftp and email mechanism (no need for additional
                components) [28].

   ASP (Active Server Pages) is an alternative to PHP provided by Microsoft [29].

      Disadvantages of ASP:

               Running Speed [28].

               Syntax similar to Visual basic.

               Some features require extra components [28].

               In order to run needs a server application to be installed called Internet
                Information Services [27].

               Close relation with MS-SQL that is not available for free [28].



4.3.4 My SQL vs XML
    Although, it is rare and unorthodox to compare XML and MySQL, due to the nature of each
of the technologies, a comparison will be made for the sake of the current project. MySQL is a
database system that supports the SQL computer language [49]. Data in a MySQL database can
be accessed and altered with SQL queries [52].


                                                                                            18
               Advantages of MySQL:

                         Popular (Easy to find solutions to problems rise).

                         Performance [50].

                         Open source [50].

                         Reliability [50].

                         Easy to use [50].

                         Smaller file size [57].

                         Parsing and querying data on Server site get only the required data [58].

                         Not flat data [57].

                         Platform independent [51].

         XML is a set of rules for creating the XML files [56]. Although it is not a database system XML
         files can be used to store and manage data.

               Disadvantages of XML:

                         Hard to manage XML files. Requires the use of XML parsers.

                         Parsing and querying data on client site [58].

                         File size of xml files is usually increased because of the tags define the
                          structure of the file [57].

                         Flat format of data that requires more control statements [57].



         Due to the nature of the project the appropriate technology to be used is MySQL. It is required
         that the system performs fast so the use of database technology with low response time is
         compulsory. Most of the time, performance is related with the amount of data to be transferred,
         MySQL returns just the required data while XML includes also the object tags which increase
         dramatically the size of data to be transferred [57]. As a result the used of XML in a client
         server application could lead to a low performance system. Moreover the use of XML usually
         requires more control statements in order to check the type of data [57].


5. Software product
         The current section will present the progress made on the project, how the developer uses the
available technologies to meet the goals of the current project. The section is composed of three sub
sections: the map section that describes the interface and the background process related with Maps, the


                                                                                                      19
Analysis sub section that presents the interface and gives an idea about the background process related
with the Observations analysis and report. The final sub section will present the database (table and
fields) uses the achieved software.

      5.1 Maps
          5.1.1 Add Entry

                 5.1.1.1 Interface
                      The current section enables the user to add an observation. The Add Entry interface
                 allows the user to interact with the mouse in order to add an observation. To be more
                 specific, he can find the location where he did the observation with the mouse and click
                 on this location. A single click blows a Google info window that contains the
                 appropriate input fields for a complete observation report (see figure 8). It allows the
                 user to select a date, the bird species and enter a number of birds that have been seen.
                 The user can save the observation on the system by clicking the save button. In addition,
                 the system provides the user with the potential to move the mouse cursor to a position
                 and by double click on the mouse to zoom in and make a more precise selection of the
                 location where he made the observation. Additionally the user can zoom out by click on
                 the right button of the mouse. Moreover the user can drag the map with the mouse
                 cursor and move to another area. The user can take an advice from the address field on
                 the top of the map to ensure that he is in the right area/location. The address field shows
                 the street address of the road the mouse is over.




                 Figure 8: Add entry interface.




                 5.1.1.2 Background process
                      The HTML5, the Google maps technology, JavaScript, PHP and SQL were
                 blended for the implementation of the interface described in section 9.1.1.1. HTML was

                                                                                                         20
used in the layout of the Add Entries interface. JavaScript is used to retrieve and
manage the Google maps through the Google maps API, to retrieve data from the input
forms, to update the Street address label and to send the observation data to the PHP.
The PHP and SQL are used to insert the observation into the database.

      Initially, a call in the AddObservation function implemented in JavaScript is being
called when the addentry.html page loads. The AddObservation function creates and
sets up a Google map. It sets the initial zoom level, the center point and the controls of
the map. Once the map is set up the addgrid function is called to add the grid on the
visible area of the map. The addgrid function gets the bounds of the visible area of the
map and dynamically draws squares inside that bounds (A square is actually composed
of four lines).The size of the area of the square drawn is not constant, it is calculated
every time the state of the map changes (zoom, unzoom). The size of the square is given
by the formula (PAx1-PDx2/10)^2. Moreover the Listeners are added to the map in
order to give an interactive meaning. Specifically, a mousemove listener, a doubleclick
listener, a leftclick listener, a mouseout listener, a closeclick listener, a dragstart listener,
a map dragend listener and a click listener are added to the map. The mousemove
listener fires when the mouse moves over the map element. While the mouse cursor
moves, its current position (the mouse position is described with longitude and latitude)
is stored on a global variable and the blue cross which follows the mouse cursor is
drawn. The idea of calculating the edges of the lines which compose the cross can be
seen in figure 9.




               Figure 9: The idea for calculating the line edges of the cross in the Add entry section.

      The street address of the mouse location on the map is requested by the geocoding
service of Google maps while the mousemove listener fires.

       The mouseout listener fires when the mouse leaves the map area. Its purpose is to
remove the cross which follows the mouse cursor from the map. The mouseclick listener
fires with a right click on the mouse. Once the listener fires the position of the mouse is
stored on a local variable and an HTML DOM object is created. The DOM object is
used to create the layout of the input form in the Google maps Ginfo window. It is

                                                                                                    21
     composed from drop boxes, a button and an input box. The Dom object is added to a
     Google map info window as it appears in figure 8. A click on the save button will make
     a call to the saveobsMarker function that gets the data from the forms of the HTML
     DOM object and passes them to PHP in order to be saved on the database.

            The doubleclick listener fires with a double click on the mouse and makes a call
     to the zoomin function. The function takes the position of the mouse in latitude and
     longitude in order to find the bounds of the grid which contains the position of the
     mouse. The appropriate zoom level of the map is calculated by the use of the Google
     API function getBoundsZoomLevel in order to make the grid bounds as bounds of the
     visible area of the map. The zooming capabilities of the map are implemented in the
     same way as in the View entries section. Once the map is loaded the bounds of the
     map(A,B,C,D as presented in figure 10) are stored and dynamically an array containing
     the individual points (a, b, c, d as presented in figure 10) which compose the map grids,
     is created. The index of the individual grid is calculated using the mouse position when
     the user moves the mouse cursor on the map. The bounds of the grid that are stored in
     the index position that was calculated earlier, are set as the new bounds for the visible
     map and the zoom level changes to the appropriate when the user double clicks on the
     map. Figure 8 presents the idea on which the zoom in feature is based. The left picture
     shows the original map with bounds A,B,C,D, and the grids with bounds a, b, c, d. The
     area inside the circle appears on figure 6 is the target zoom area. The picture on the right
     shows the resulted map when the user double clicks on a position inside the grid that
     resides at the center of the left map. As the picture shows, the new bounds of the visible
     area of the map are those of the grid the mouse was over (a, b, c, d).




Figure 10: The logic in zoom in

     The rightclick listener fires with a double click on the mouse and makes a call to the
     zoomout function. The zoomout function gets the current bounds of the map (E, F, G, H)
     and calculates a new expanded version (e, f, g, h) by addition and subtraction of a
     preselected value. The function uses the getBoundsZoomLevel function and calculates
     the appropriate zoom level so that the calculated bounds fit in the visible area. Finally
     the zoom level is updated. Figure 9 shows an example of how zoom out is applied.



                                                                                              22
   Figure 11: The logic on zoom out

    The dragstart listener fires when the user starts dragging the current map. The listener
    calls the removegrid function that removes the grid which is currently drawn on the map.

    The dragend listener fires when the user stops dragging on the current map. The listener
    calls the addgrid function that redraws the grid on the map.

5.1.2 View Entries

     5.1.2.1 Interface
          The current section of the software provides the user with the ability to view and
     query the observations available in the database in a graphical and interactive
     environment. The environment can be seen in Figure 12.




     Figure 12: View entries section.


                                                                                         23
The coloured squares indicate that an observation was made in that area. The colour of
each square indicates how many observations were made (the colour scale of the
observations paired with the number of observations van be seen on the right, bottom
area of the environment). The size of the squares is indicated at the top area of the
interface in Km2 .The user is able to use the panel in the right hand site of the
environment and filter the observations. He might choose to filter by family or by time
with starting date and ending date. The details of the observation made in the area of
each square can be seen by clicking on the specific square. Another feature available in
this section is the Zoom In. The user is able to zoom in or zoom out on a specific area of
the map by using the mouse. A double click zooms in the area where the mouse is over,
but a right click zoom out this area. Figure 13 shows an example of the environment
when zoom in is applied. Another feature offered in the current section is the distance
calculator that allows the user to calculate the distance between two points on the map
in Km. A line is drawn when user clicks on a point and moves the mouse as shown in
figure 12. While the mouse is moving the distance is updated on the bottom section of
the interface. The User can remove the line from the map by clicking on it. A user can
see the list of observations in an area by scroll the mouse when the mouse cursor is on
that area. An example of the observation list can be seen in Figure 13. In the green area
the info window is blown 2 observations made with total number of birds 5.




Figure 13: Zoom in.

Finally the user is able to view observation markers in the exact point of observations
as shown in figure 13. The Show marker check box allows him to enable or disable the
feature. When the box is check the markers appear while when the box is not check
the markers do not appear.




                                                                                       24
5.1.2.2 Background process
      The implementation of the interface presented in figure 12 requires a combination
of HTML, JavaScript Ajax and MySQL and the Google maps technology, the same
technology as the Add entry interface presented in the section 8.1.2.1. At the initial
stage when the viewentry.html page loads the ViewObservation function that is
implemented in JavaScript fires. The function set up a Google map with its initial
properties (zoom level, center, dimensions, enabled or disabled map controls),the initial
coloured grids, and the associated listeners. Specifically, the View observation map is
associated with a mouse doubleclick and rightclick listener to control the zoom level in
the same way as in the add observation listener, a mouse startdrag listener, a mouse
dragend listener, a mousemove listener to track the mouse position and a mouseclick
listener that is responsible for presenting a list with observations when the user clicks on
a coloured grid. The grids are coloured dynamically according to the observation data
that are available to the database. The ViewObservation function using the Ajax Http
object makes a call to the viewopservations.php in order to retrieve the list of
observations made in the visible area of the map from the database. The
findMarkersgrid function is called for each entry of the available observations. It returns
the index of the grid where the location of the observation resides. Once the index of the
current observation is known a check if a coloured square does not exist in that
particular index. If it does not exist the algorithm move forward on the observation
array and finds all the observations reside on the same grid index as shown in figure 13.
Once an observation found that resides on the same index all its details are concatenated
to the current observation details string and a delimiter is added at the end. Finally the
current index is coloured by adding a Gpolygon according to the observation scale
defined (the observation scale can be seen in figure 13). It worth of mention that the
colour of the grid is decided by the use of the observation details string and the
delimiter. The split function with input the delimiter is applied on the string, it returns
an array of strings where each string represents one observation, the length of the array
is calculated and the final decision about what the colour of the square should be is
taken .The process repeats for the next observation in the list. If a colour grid already
exist in the grid index the observation reside it mean that the details of the current
observation are already check so there is no reason to do anything and move in the next
observation. It is important to mention that during this process a check is made if the
Show markers box is checked. This is done by getting the value of the property check of
the current checkbox state. If the box is checked a marker is added for each of the
observation in the exact location the observation made.




Figure 14: Selection of observations in a specific area



                                                                                         25
Figure 15 represents the data structure of observations when the whole process ends.
For each of the colour grids a struck exist with the details of the observations in that
particular area




Figure 15:Data structure of observations

       When the user enters his preferences and enters the Query button the querymap
JavaScript function is called. The function is responsible for updating the map
according to the user’s preferences (starting date and ending date, bird species). The
querymap function retrieves the values of the HTML input boxes located at the
ViewObservations.html and uses them in order to decide which grids to colour
comparing the position of each observation with the bounds of each of the grids. When
the user zoom in the process is repeated in the same way and we get the coloured inner
grids as shown in figure 13.

     When the user zoom in or zoom out the grids (the squares without colour) and the
observations grids (the coloured gids) are updated. During the update all the grids on the
map (coloured grids and non coloured) are removed, according to the new bounds of the
zoomed map and a request for observations that are available inside those bounds is sent
to the server. Once the server response the grids are redrawn again. The same process
applies when the user drags the map.

     The distance calculation is based on the formulas mentioned in section 8.1.3.Once
the user click on the map the position of the mouse (latitude and longitude) is stored.
While the mouse is moving a new line starting from the clicked position to the current
position is drawn (the previews line is remove so only one line appears).The position of
the moving edge of the line is stored and the function calculates the distance between
the two points is called.

    When the user check or uncheck the Show markers checkbox as we mentioned
earlier markers for each observation appear or disappear. In order the developer to
achieve this behaviour when user interacts with the checkbox a click listener was assign
to the checkbox. A user click cause initially the removegrid function to remove the grids
from the map,then the removegrid is called to remove the coloured squares. Once the
map is clear the addgrid and addcolourgrid functions are called, if the checkbox is check
the colourgrids and markers added on the map.




                                                                                       26
5.1.3 Members area – Login -Register

     5.1.3.1 Interface
          Each user has to register and login in order to gain access and use the View entries,
     the Add entry and the Analysis interface. The login interface can be seen in figure 16.
     There are two fields available to the user, the username and password, once he enter the
     prober inputs and press the lock ate the right of the login panel automatically he will
     directed to the members area shown in figure 18.




     Figure 16: Login

      If the current user does not hold a username and password to gain access to the site the
     register interface allow him to register to the system by entering his details. Once he
     register a welcome email will be send automatically to client and a notification email for
     a new user will be send to the administrator of the system. Figure 17 present the
     Register interface.




     Figure 17: Register




                                                                                            27
      As it was mentioned earlier in this section once the user logs in the appropriate
menus on the right become available and the member’s page is show. The member’s
page is composed from a map that shows all the observations register to the users
account. A list at the bottom of the map enable user to select an observations. Once the
user select an observation from the list the center location of the map changes to the
location of the selected observation and an arrow point the observation appear. Every
time the user makes a selection from the list the map is updated




Figure 18: Members area

5.1.3.2 Background process
   User login

      When the user press the lock as shown in figure 16 the logincall function is
      called. The function retrieve the values incert as username and password from the
      user and call the login function that passes the input on the login.php on the
      server to perform a check about the given input. If the given details exist on the
      systems database a new cookie contains the users details is created. On the client
      site a check for the existence of a cookie contains the details of the user is made.
      If the cookie exist the memberpage.html loads else the login page appears again.

   User register

      Once the user enters his details and press the submit button the register function
      is called. The function retrieves the values from the input fields and makes a call
      to the register.php by passing the input data. In the register.php a connection to
      the database is made and by the use of sql (INCERT INTO) the members table is
      updated. It is important to mention that while user enters a username several calls
      to the server are made in order to know if the username already exist in the
      database.




                                                                                       28
           Members area

               When the members.html load the locationmap function is called. The function
               generates a Google map contains all the observations added by the user. First it
               retrieves all the observations using an Ajax request to the
               viewuserobservations.php with parameter the username of the current user. The
               Ajax response contains a string with all the observations made by the current
               user. An array contain the observations is constructed and for each observation
               exist in the array a new option is added to a dom list box. A click listener is
               assign to the list box. When a user perform a click the observation location in the
               specific is taken and the center of the google map is assign to that location. In
               addition an arrow points to that location is drawn on the map.

5.2 Analysis
        5.2.1 Interface
            The main purpose of this section is to present the observation data exist in the
        database of the system and to allow the user to make comparisons. The system allows
        the user to choose a period of time (year or month of a year), a bird species, an area of
        his interest to retrieve a visual report or a PDF file that contains the report. The system
        presents the observation report in a way that enables user to make comparisons between
        different periods of time.

            The Analysis interface can be seen in figure 19. It is composed of three sections. On
        the top there are two graph areas. The graph area is the one that will accommodate the
        graphs constructed dynamically by the system once the user enters his preferences and
        presses the view button. If the user enters only a year, a year report will be constructed
        dynamically and presented in the appropriate month layout (month layout is the one that
        shows the results in month scale). If the user enters a year and a month then the system
        will construct the report by using the appropriate layout in day scale. Under on each of
        the graphs area there is a control panel where the user can enter his preferences and
        view a report graph or get the PDF version of the report where an example can be seen
        on figure 20. At the bottom section there is a map interface that allows the user to select
        the area of his interest just by the use of the mouse. The user selects a graph (left or
        right graph) and draws a rectangle as presented in figure 19. Different colours of
        rectangles are drawn according to the users’ preference: A green rectangle for the right
        graph and a black rectangle for the left graph. On the top of the map the real area for
        each of the rectangles is available in Km2.




                                                                                                29
Figure 19: Analysis section.




Figure 20: Example of a PDF report created by the system.




5.2.2 Background process
     A combination of several technologies is used to allow the programmer to produce
the analysis features. HTML5 is used for the presentation of data and accepts data from
the user. JavaScript is used to make the drawings in the data analysis an Ajax is used for
the communication with the server (sends request from client to the server). PHP is used
for applying SQL queries (retrieves data from the database) and sends the data back to



                                                                                       30
           the client, generates the report picture which is contained in the PDF documents and the
           PDF file.

                At the initial stage, when the Analysis page loads, JavaScript is used to access the
           HTML5 canvas element and manipulate it (draw lines, text, fill the background of the
           graph with a colour) in order to get the appropriate layout for the graph. A click on the
           view button fires the viewanalysis() function that takes the user’s preferences for the
           Month, Year and the bounds of the area of his interest according to the rectangle drawn
           in the map interface. A decision is made about the type of the report which will be
           presented according to the user’s input (two types of report are available: the month
           report layout and the year report layout). The layout changes into the decided type.
           Once the graph layout is updated Ajax makes a call of a PHP function (analysis.php)
           that uses an SQL query which involves user’s input to retrieve the appropriate data from
           the observation database. When the SQL query is executed the resulted data are sent
           back to the client. At the client’s site JavaScript takes care of the resulted data. It
           calculates the observations were made per time unit and updates the graph. (The
           implementation of the functions mentioned can be found on the code reference at the
           end of this document).

                At a later stage when the user requests for a report in a PDF file the
           sentDatatoserver() function is called. The function takes one parameter of type int. The
           parameter is used to identify which of the two buttons was clicked. If the left Analysis
           button was pressed then the contents of the left canvas will be used for the generation of
           the report. If the right button was pressed the right canvas contends will be used for the
           generation of the analysis. On the client side javascript extracts the contents of the
           canvas and stores them in an array with the use of the toDataURL() function. The data
           are sent to the server by using the POST method of PHP (topdf.php). On the server side
           an image of jpeg type is constructed and placed on a PDF file with other observation
           data. The current software uses the FPDF library which is an external PHP library. The
           FPDF library is used for the generation and manipulation of PDF files [59].




                   Figure 21: Analysis background.

5.3 Database
    The organisation and management of data requires a database system where observations will
be stored at the initial stage and queried at a later stage according to the user’s preferences. The

                                                                                                  31
following data need to be stored in order to describe an observation made, the location of the
observation that is a point with Latitude and Longitude, the date the observation was made (month,
day and year), the number of birds have been seen and the bird species. In order to address the
requirements mentioned a database with name lros was created on MySQL. The database
accommodates a table with name observations. The table has the following fields as presented in
the Figure 22.




Figure 22: Table observations.

The latitude and longitude fields accept data of type double and with 15 digits length the most.
Day, month and year fields are of type text although they accommodate data that are actually of
type int. The length of accepted values in the day and month fields is two characters, in the year
field the length of accepted values is four characters. The numberofbirds field requires data of type
int and the bird specie field requires data of type text.

       Another table contained in the database of the system is the members table. The table is used
to store all the users details included the number of observations each member did so far, its email,
id username, password, age, gender, name and surname.




Figure 23: Table of users




                                                                                                  32
6. Testing
         The development of a software product is important but the testing of the software seems to be
   more important. The Testing face is the one that will give developer an idea about how its
   development works, reveal possible bugs and allow him to make improvements. The current section
   aims to present the results of the major functional and non functional specifications. The software was
   test on Browser compatibility, the response of the software on the several allowed user actions and the
   performance.

        Browser compatibility

           Browser          Test Description              Input                    Response

           IE9              Load the page with IE9.       Navigation using the Main menus Load
                                                          mouse and keyboard as planed but
                                                                               maps and Canvas
                                                                               elements do not
                                                                               load properly.

           Firefox 4.0.1    Load the page with Firefox.   Navigation using the Page seems to
                                                          mouse and keyboard operate Well. All
                                                                               sections load as
                                                                               planned.

           Ghrome 11.0      Load the       page     with Navigation using the Main      menus,
                            Ghrome.                      mouse            and maps and Canvas
                                                         keyboard.            Load as planed
                                                                              but scroll does
                                                                              not work.

           Safari 5.0.4     Load the page with Safari.    Navigation using the Main      menus,
                                                          mouse and keyboard maps and Canvas
                                                                               Load as planed
                                                                               but scroll does
                                                                               not work.



        Operation Test

Test Description   Input                          Response

Add              Location: New Walk,
observations     Leicester, Uk
through the user
                 Bird Specie: Aleutian tern


                                                                                                       33
interface.        Number of birds: 3           UI

                  Date: 01/January/2000.


                                               DB




View              Scroll with the mouse over
observation       the Location: New Walk,
details on map.   Leicester, Uk.




Calculate the     Location 1:
distance
                  52.9462,-1.14031                  36.019Km
Between two
locations.        Location 2:

                  52.62556,-1.13344

View              Time period:
observations
made in a         01/02/2005-31/01/2009
specific period   Specie: All
of time.




                                                               34
View                Time period:
observations
made in a           01/02/2005-31/01/2009
specific period     Specie: African Collared
of time and         Dove
about Specie.



Check the           Observation with 72 birds
colouring of the
Squares. If
match the
colouring scale
defined.


Produce
observation
analysis on       a Area:
specific area
                    Period of time:Year 2009


Produce a pdf
file with analysis
on a specific Area:
area.
                   Period of time:Year 2009




7. Planning and Timescales
          The good management and organization of our time can lead to the success of the current project.
    It is important to make a plan according to the deadlines given by the customer. A good approach is
    to split the project into smaller sub problems and define a deadline for each one of them. The current
    project requires coding and the use of technologies requires time for the author to be familiar with.
    The current project has 3 months duration starting from the 21/02/2011 and ends the 20/05/2011. The
    author decided to follow the strategy where work is done in both, Literature and software in parallel.


                                                                                                       35
     7.1. Work and Deadlines
              The sub problems paired with the specified deadlines of the developer will be presented in
         this section. Figure 24 shows the sub problem paired with start and end date. Figure 25 shows a
         timeline of the project.




Figure 24: Detail Work Plan




Figure 25: Plan Chart


                                                                                                     36
8. Critical appraisal
       The main reason I involved in the implementation of the current project was not only my interest
   in nature but also because it enables me to expand my knowledge and get experience in GIS
   technologies, client-side technologies and server-side technologies that I haven’t use before. More
   over the project enables me to understand the GIS background theory. Another reason for making this
   choice of project is that I perceive the experience and knowledge gained will be benefit me at a later
   stage of my career.

  8.1 Problems faced
       The onload function in HTML5 seems to be unreliable. It is supposed to fire when the web
        page loads but it does not [53]. A small research on the problem was made and showed that
        the problem is universal and many developers face the same problem [54]. A proposed
        solution was the function to be called just after the page request with Ajax. This solution
        worked on Firefox but not in all the other browsers. The reason was that the function loads the
        maps was looking to find the dom object to add the google map before the actual html page
        loads. The final solution for this problem was to set a delay in the execution of the javascript
        algorithm in order to allow the html page to load first.

       The developer was finding hard to follow the schedule defined in the planning due to technical
        problems occur during the development phase.

       Working with MySQL on a virtual server. The developer’s initial approach was to implement
        the software on a local machine with the use of a virtual server like XAMPP or WAMPP [55].
        At the final stage the software should be transferred and setup on a proper online host. The
        developer was not able to proceed with the database construction because the virtual servers
        reset all the data (databases and tables) created on the phpMyAdmin. The time the server was
        restarting or shutting down all the data were being lost. The developer having that problem
        decided to continue the development of the project online.

       The toDataURL function is a JavaScript function that converts the canvas graphics to an array
        of data of a specific picture type (JPEG or PNG). An error occurred when the developer had
        used this function. Due to lack of support in this area it was difficult to figure out what was the
        problem. As other users claim the function is not working properly when the opacity level is
        specified [61]. It is important to mention that canvas element is one of the new elements
        appear in the latest version of HTML. Due to this fact the support and sources are limited.

       While the developer was implementing function that was meant to generate the PDF for the
        analysis, find out that the FPDF library does not support transparent pictures (pictures with
        alpha channel) so the picture containing the canvas data could not be added to the PDF file.
        An attempt was made to remove the alpha channel from the picture with an external PHP
        library called GD library was made but failed. The solution was to convert the canvas data to a
        jpeg picture format. It is important to mention that the resulted data in jpeg format have bigger
        size than the data in PNG format. Due to this fact a change at the way (POST or Get method)
        the data were sent to the server was necessary because of the limited size of data can be sent
        with the GET method [62].

                                                                                                        37
  Performance problems were faced. The View observations section of the software seemed to
   operate slowly when the user was dragging the map. The main cause of this problem was the
   fact that it requires time to send a request to the server and to get a response that contains data.
   Generally if the size of data is not large, the respond time is not considerable. If there is a huge
   amount of data to be sent from the server to client as a respond, then the respond time
   increases. Two options are available during the development of a client-server application that
   involves a non local database. The first option is to select and request the whole amount of
   data when the application loads. This choice has as an impact the loading time of the system to
   increase but the delay time to decrease. A logical argument is that the requests of system to the
   server are limited and the response time depends on the local’s machine performance. The
   second choice is to load nothing when the application loads, that option makes the application
   to load fast but the number of requests to the server increase. As a conclusion a client server
   application that involves a database system needs to have a balance on the data available on
   the client site in order to perform quickly.

  The software developer of the current project was working online using FTP technologies in
   order to update and publish his work. Internet connection problems that occur made FTP
   technologies to operate faulty. This caused troubles while was working online. Sometimes
   achieved work was not uploaded properly on the host so the software was not operating as it
   was supposed to operate.

8.2 Completed Work
    The constructed software thought its user interface allows the users:

    Find an area on a map store observations made.

    View observations made on a map.

    Query the available observations and view a map contains the query results.

    Global zoom and navigation control on the map.

    Group observations When zoom out/Ungroup observations when zoom in.

    Calculate the distance between two points on a map.

    Produce Analysis according to user’s preferences (Area of his interest, Date, Specie).

    Produce PDF files with the analysis result.



8.3 Limitations
     The current section deals with the limitations of the software product. All the limitations
     discovered during the testing process will be presented and analyzed.



                                                                                                    38
        Browser support

           The most important limitation found on the software was the browser support. The current
           software can run normally on any version of Mozilla Firefox. It was discovered that the
           software in other browsers like internet explorer or Google chrome does not operate well.
           More specific the maps do not operate well when the software operates on other browsers
           rather than Firefox. In internet explorer the map does not load at all while in google chrome
           and in safari the scroll does not fire. The main reason scroll does not fire is that different
           listener must be added in the software code in order the scroll to function properly.

        Area selection accuracy on analysis

           As it was mentioned earlier on this report the user is able to select the area of his interest
           by drawing rectangles on a map and retrieve an analysis. By drawing rectangles it does not
           allow the user to select areas of other shapes, for example if the user is interested on
           observations inside the bounds of a lake then by selecting the area in the way the software
           allows it will include areas that are not desired by the user (small areas probably outside
           the bounds of the lake).

        Performance

           The performance of the system is related with the amount of data and internet connection.
           The effects of those two factors are visible mainly in the view observations section when
           the internet connection is slow and large amount of data are available.

        Distance calculation accuracy

           The Assumption that earth is a sphere and that the radio of earth is a constant allow us to
           calculate the distance between two points. The measurements do not seem to be accurate
           because in reality earth is not a sphere and the radio in each point in earth differs.




9. Bibliography

[1] The Guide to Geographical Information Systems Website: http://www.gis.com/content/what-gis
(accessed 27/02/2011).



                                                                                                      39
[2] Geographic Information Systems: http://www.bestpricecomputers.co.uk/glossary/geographic-
information-system.htm (accessed 27/02/2011).

[3] Fundamentals of Geographical Information System, P.L.N. Raju, Geoinformatics Division Indian
Institute of Remote Sensing, Dehra Dun, Website: http://www.wamis.org/agm/pubs/agm8/Paper-6.pdf ,
(accessed 27/02/2011).

[4] Wikipedia, Geographical information system, Website: http://en.wikipedia.org/wiki/Geographic_
information__system#Advantages_#Advantages_and_disadvantages, (accessed 01/03/2011).

[5] Wikipedia, Google maps, Website: http://en.wikipedia.org/wiki/Google_Maps, (accessed 01/03/2011).

[6] Google maps official site, Website: http://www.google.co.uk/help/maps/tour/, (accessed 01/03/2011).

[7] Google maps API, Website: http://code.google.com/apis/maps/index.html, (accessed 01/03/2011).

[8] Yahoo maps web services, Website: http://developer.yahoo.com/maps/, (accessed 01/03/2011).

[9] Yahoo vs Google maps, Website: http://www.klauskomenda.com/archives/2007/07/22/google-maps-
api-vs-yahoo-maps-api/, (accessed 01/03/2011).

[10] Google Maps vs Yahoo Maps vs MapQuest - Which is the best? ,Website:
http://hubpages.com/hub/Google_Maps_vs_Yahoo_Maps_vs_MapQuest, (accessed 01/03/2011).

 [11] Wiki,Openstreetmap,Website:        http://wiki.openstreetmap.org/wiki/Feature_Index,    (accessed
01/03/2011).

[12] Why openstreet maps when Google maps exist, Website: http://ruk.ca/content/why-openstreetmap-
when-theres-google-maps,(accessed 01/03/2011).

[13] Wikipedia, Openstreetmap , Website: http://en.wikipedia.org/wiki/OpenStreetMap,(accessed
01/03/2011).

[14] Microsoft, Bing Map Website: http://msdn.microsoft.com/en-us/library/dd877180.aspx , (accessed
01/03/2011).

[15] Pcworld, Microsoft tries to Leapfrog GoogleMaps, Website: http://www.pcworld.com/businesscenter

/article/183571/microsofts_bing_tries_to_leapfrog_google_maps.html, (accessed 01/03/2011).

[16] Microsoft,,Website: http://blogs.msdn.com/b/springboard/archive/2010/03/17/bing-vs-google-the-
showdown-of-the-maps-a-student-perspective.aspx,(accessed 01/03/2011).

[17] The next web, Website: http://thenextweb.com/microsoft/2010/11/02/bing-maps-dropping-
silverlight-for-html5/ , (accessed 01/03/2011).

[18] Leicester and Rutland Ornithological, Society Website: www.lros.org.uk, (accessed 01/03/2011).

[19]       British      dragon         society,       Observation         recording,          Website:
http://www.ghmahoney.org.uk/bds/recording/simpleentry.aspx, (accessed 03/03/2011).

                                                                                                      40
[20] BTO/RSPB/BWI/SOC 2011, BirdTrack, Recording system, Website: http://www.bto.org/volunteer-
surveys/birdtrack, (accessed 03/03/2011).

[21] BTO/RSPB/BWI/SOC 2011, BirdTrack,              About,    Website:     http://www.bto.org/volunteer-
surveys/birdtrack/about, (accessed 03/03/2011).

[22]    Developer.com,        Introducing     Google’s        Geocoding          Service,      Website:
www.developer.com/article.php/3615681, (accessed 10/03/2011).

[23]        Google       maps,Google       Maps        API        Web        services,         Website:
http://code.google.com/apis/maps/documentation/geocoding/, (accessed 10/03/2011).

[24] Web Developers, Why PHP, Website: www.webdevelopersjournal.com/articles/why_php.html,
(accessed 14/03/2011).

[25] W3schools, PHP Tutorial, Website: www.w3schools.com/php/default.asp, (accessed 14/03/2011).

[26] PHP official website, Website: www.php.net , (accessed 14/03/2011).

[27] Wikipedia, PHP, Website: http://en.wikipedia.org/wiki/PHP, (accessed 14/03/2011).

[27] ASP vs PHP, Website: www.aspvsphp.com/ , (accessed 14/03/2011).

[28] ASP vs PHP, Website: www.webpronews.com/asp-vs-php-2005-12, (accessed 14/03/2011).

[29] GET DOT GNU, ASP vs PHP, Website: http://getdotgnu.com/asp-php.htm , (accessed 14/03/2011).

[30] Wikipedia, HTML, Website: http://en.wikipedia.org/wiki/HTML, (accessed 14/03/2011).

[31] W3schools, HTML5 differences FROM html4, Website: http://www.w3.org/TR/html5-diff/,
(accessed 14/03/2011).

[32] Wiki, What are the advantages and disadvantages of using HTML, Website:
http://wiki.answers.com/Q/What_are_the_advantages_and_disadvantages_of_using_HTML , (accessed
14/03/2011).

[33] Wikipedia, Semantic web ,Website: http://en.wikipedia.org/wiki/Semantic_Web , (accessed
14/03/2011).

[34] Wikipedia, Adobe Flash, Website: http://en.wikipedia.org/wiki/Adobe_Flash, (accessed 14/03/2011).

[35] Macromedia Flash Advanced ,Russel Chun with H. Paul Robenrtson,Visual Quickpro Guide.

[36] Articlesbase, Advantages and Disadvantages of Flash web design, Website:
http://www.articlesbase.com/web-design-articles/advantages-and-disadvantages-of-flash-web-design-
676382.html, (accessed 14/03/2011).

[37]    Advantages   and    disadvantages    of   using    Flash     on    your     site      ,Website:
http://www.html5sample.com/advantages-and-disadvantages-of-using-flash-on-your-site/ ,        (accessed
14/03/2011).

                                                                                                     41
[38]        Google       maps,      Google        maps          api       for       flash,     Website:
http://code.google.com/apis/maps/documentation/flash/tutorial-flash.html, (accessed 14/03/2011).

[39] Microsoft Silverlight, Website: http://en.wikipedia.org/wiki/Microsoft_Silverlight, (accessed
14/03/2011).

[40] Wikipedia, Silverlight,      http://en.wikipedia.org/wiki/Microsoft_Silverlight#Development_tools,
(accessed 14/03/2011).

[41]       Silverlight   Hack      ,    Silverlight     advantages     over     flash     ,     Website:
http://silverlighthack.com/post/2008/08/12/Silverlight-advantages-over-Flash-(not-another-Silverlight-vs-
Flash).aspx , (accessed 14/03/2011).

[42] Ajaxwith.com, ActionScript vs JavaScript, Website: http://www.ajaxwith.com/ActionScript-vs-
JavaScript.html, (accessed 14/03/2011).

[43] Wikipedia, Actionscript, Website: http://en.wikipedia.org/wiki/ActionScript, (accessed 14/03/2011).

[44] Adobe,     AactionScript,   Website:    http://www.adobe.com/devnet/actionscript.html,    (accessed
14/03/2011).

[45] Sams Teach Yourself Ajax, JavaScript, and PHP All in One (Phil Ballard).

[46]     Exforsys     inc,      Advantages      and      disadvantages      of       Ajax,      Website:
http://www.exforsys.com/tutorials/ajax/advantages-and-disadvantages-of-ajax.html,              (accessed
14/03/2011).

[47] Ajaxwith.com, Ajax Advantages and Disadvantages,Website: http://www.ajaxwith.com/AJAX-
Advantages-and-Disadvantages.html, (accessed 14/03/2011).

[48] Wikipedia, Ajax, Website: http://en.wikipedia.org/wiki/Ajax_(programming), (accessed 14/03/2011).

[49] thesitewizard, What is MySQL           ,Website: http://www.thesitewizard.com/faqs/what-is-mysql-
database.shtml, (accessed 14/03/2011).

[50] MySQL Official site ,Why MySQL,Website: www.mysql.com/why-mysql,(accessed 14/03/2011).

[51] Wikipedia , MySQL, Website: http://en.wikipedia.org/wiki/MySQL ,(accessed 14/03/2011).

[52] w3schools ,SQL , http://www.w3schools.com/sql/default.asp, (accessed 14/03/2011).

[53] w3schools , HTML5 , Website: http://www.w3schools.com/html5/html5_ref_eventattributes.asp ,
(accessed 15/03/2011).

[54] w3schools , HTML5 ,Schillmania! ,Whileloading & Onload not being triggered , Website:
http://getsatisfaction.com/schillmania/topics/html5_whileloading_onload_not_being_triggered_in_chrom
e, (accessed 15/03/2011).




                                                                                                      42
[55] Apache Friends, XAMPP, Website:            http://www.apachefriends.org/en/xampp.html, (accessed
19/03/2011).

[56] Wikipedia , XML,Website: http://en.wikipedia.org/wiki/XML, (accessed 19/03/2011).

[57] Tutkiun!, XML Vs MySQL , Website: http://www.tutkiun.com/2009/09/xml-vs-mysql.html,
,(accessed 19/03/2011).

[58]       Google      Webmaster      Help     ,     XML        vs          MySQL          ,    Website:
http://groups.google.com/group/Google_Webmaster_Help-chit-
chat/browse_thread/thread/fbddd1be59007af8 , (accessed 19/03/2011).

[59] FPDF, FPDF Library, Website: www.fpdf.org/, (accessed 21/03/2011).

[60] PHP, Image processing (ImageMagick), Website: http://docs.php.net/manual/en/book.imagick.php,
(accessed 21/03/2011).

[61] Stackoverflow ,Questions , Website: http://stackoverflow.com/questions/4591349/getting-error-on-
canvas-todataurlimage-jpeg-0-2, (accessed 21/03/2011).

[62]      Steven    Clark.com,   Get     and    Post     for   the     beginner            ,    Website:
http://stevenclark.com.au/2008/01/12/get-vs-post-for-the-beginner/, (accessed 21/03/2011).

[63] Wikipedia, Circle ,Website: http://en.wikipedia.org/wiki/Circle, (accessed 27/04/2011).

[64] Wikipedia, Great-circle distance ,Website: http://en.wikipedia.org/wiki/Great-circle_distance,
(accessed 21/03/2011).

[65] Wikipedia, Earth radius, Website: http://en.wikipedia.org/wiki/Earth_radius, (accessed 27/04/2011).

[66]         Wikipedia,         Ordance       Survey           National         Grid           ,Website:
http://en.wikipedia.org/wiki/Ordnance_Survey_National_Grid, , (accessed 30/04/2011).

[67] NCI, British National Grid System, Website: http://nciwormshead.org.uk/training/os-maps/61-
british-national-grid, (accessed 30/04/2011).

[68]       Sundials       in     Ireland,        The       Irish       grid      system,        Website:
http://homepage.ntlworld.com/michael.j.harley/irishgrid.htm , (accessed 30/04/2011).

[69]                          Wikipedia,                      UTM,                          Website:
http://en.wikipedia.org/wiki/Universal_Transverse_Mercator_coordinate_system, (accessed 30/04/2011).

[70] Map Tools, More details about the UTM coordinate                               systems,    Website:
http://www.maptools.com/UsingUTM/UTMdetails.html, (accessed 30/04/2011).

[71] Map Town, Types of Maps, Website: http://www.maptown.com/referencemaptypes.html, (accessed
30/04/2011).




                                                                                                      43
10.     Appendix


ViewObservation
function ViewObservation(){//function call to view the observations map

leicesterlocation = new GLatLng(52.63457,-1.12944);//location of leicester

//setup the map

viewmap=new       GMap2(document.getElementById("viewentrymaparea"));//the             map      on   the   view
observations

viewmap.addControl(new GMapTypeControl());//toggle betwwen sat/map/hyprid

viewmap.disableDoubleClickZoom();

viewmap.setCenter(leicesterlocation,1);//set the initial center location to be near leicester

viewmap.setZoom(10);//set initial zoom

viewmapbounds=viewmap.getBounds();//get the bounds of the map

addgrid(viewmap,viewmapbounds);//draw the grid

querymap(viewmapbuttonpressed);//retrieve data and add the colour grids



//MAPLISTENERS

//LISTENER FOR CLICK ON THE MAP

GEvent.addDomListener(viewmap, "click", function(overlay,latlng){

if(clickonviewmap=="false"){clickonviewmap="true";}else{clickonviewmap="false";}

mousepositionlatclick=latlng.lat();

mousepositionlngclick=latlng.lng();

startlatradians=latlng.latRadians();

startlngradians=latlng.lngRadians();

});




                                                                                                            44
//mousemove listener take the position of the mouse and store it

GEvent.addListener(viewmap,"mousemove",function(latlng){

mousepositionlat=latlng.lat();

mousepositionlng=latlng.lng();

mousepositionlatclickend=mousepositionlat;

mousepositionlngclickend=mousepositionlng;



if(mousepositionlatclickend<mousepositionlatclick){

mousepositionlatclickend=parseFloat(latlng.lat())+0.005;

mousepositionlngclickend=parseFloat(latlng.lng())+0.005;

}else{

mousepositionlatclickend=parseFloat(latlng.lat())-0.005;

mousepositionlngclickend=parseFloat(latlng.lng())-0.005;

}



endlatradians=latlng.latRadians();

endlngradians=latlng.lngRadians();

//if clicked

if(clickonviewmap=="true"){

if(lengthline!="null"){viewmap.removeOverlay(lengthline);document.getElementById("distancelabel").i
nnerHTML="Distance: ";}

//add the line

lengthline=new                                                                        GPolyline([new
GLatLng(parseFloat(mousepositionlatclick),parseFloat(mousepositionlngclick)),new
GLatLng(parseFloat(mousepositionlatclickend),parseFloat(mousepositionlngclickend))],'#ff0000',5, 0.8);

//calculate distance         using the law of cosines //taken from http://www.movable-
type.co.uk/scripts/latlong.html and http://en.wikipedia.org/wiki/Great-circle_distance



                                                                                                   45
angle=
Math.acos(Math.sin(startlatradians)*Math.sin(endlatradians)+Math.cos(startlatradians)*Math.cos(endlatr
adians)*Math.cos(endlngradians-startlngradians));

linedistancemeter=Math.round(earthR*angle*1000)/1000;

GEvent.addListener(lengthline,                                                              "click",
function(){if(lengthline!="null"){viewmap.removeOverlay(lengthline);document.getElementById("distan
celabel").innerHTML="Distance: ";}});

viewmap.addOverlay(lengthline);

document.getElementById("distancelabel").innerHTML="Distance: "+linedistancemeter+" Km";

}//end of if clicked

});//move listener ends



zoomIn Function
function zoomIn(map,movelat,movelng){

var mousegridroll=findMarkersgrid(zoomgrid,new GLatLng(movelat,movelng));

var gridzoombounds=mousegridroll.getBounds();

var KA=gridzoombounds.getSouthWest();

var PD=gridzoombounds.getNorthEast();

var PA=new GLatLng(PD.lat(),KA.lng());

var KD=new GLatLng(KA.lat(),PD.lng());

removegrid(map,zoomgrid);//revemove the grid

var zoomlevel=map.getBoundsZoomLevel(mousegridroll.getBounds());

map.setZoom(zoomlevel);//set the zoom level

map.setCenter(mousegridroll.getBounds().getCenter());

var newbounds=map.getBounds();

addgrid(map,newbounds);//update the grid

}//end of zoomIn function



                                                                                                    46
zoomOut Function
function zoomOut(map,movelat,movelng){
var mousegridroll=findMarkersgrid(zoomgrid,new GLatLng(movelat,movelng));

//get the bounds of the current map.expand the map and get the new zoomlevel to fit the newbounds
//set the new zoom level and update the grid
var oldmapbounds=map.getBounds();
var KA=oldmapbounds.getSouthWest();
var PD=oldmapbounds.getNorthEast();
var PA=new GLatLng(PD.lat()+0.1,KA.lng()-0.1);
var KD=new GLatLng(KA.lat()-0.1,PD.lng()+0.1);
var zoomoutbounds=new GLatLngBounds(PA,KD);

removegrid(map,zoomgrid);//revemove the grid
var zoomlevel=map.getBoundsZoomLevel(zoomoutbounds);//get the zoom level to fit the bounds
map.setZoom(zoomlevel);//set the zoom level
map.setCenter(mousegridroll.getBounds().getCenter());
var newmapbounds=map.getBounds();
addgrid(map,newmapbounds);//update the grid
}//end of zoomout function


FindMarkersgrid Function
//function returns the grid of the marker
function findMarkersgrid(grid,mouselocation){
var indexfound;
var z;
for(z=0; z<grid.length; z++){//find the grid the marker is in

//get the bounds of the square
var KAAR=grid[z].getBounds().getSouthWest();
var PADE=grid[z].getBounds().getNorthEast();
var sqcenter = grid[z].getBounds().getCenter();
//check if in the square
if((parseFloat(PADE.lat())>parseFloat(mouselocation.lat()))&&
(parseFloat(mouselocation.lat())>parseFloat(KAAR.lat()))&&(parseFloat(mouselocation.lng())>parseFlo
at(KAAR.lng()))&& (parseFloat(mouselocation.lng())<parseFloat(PADE.lng()))){
indexfound=grid[z];//set the value to be return to the polyline found
}//end of check
}//end of finding
return indexfound;//return the indexes found on that grid
}//end of function return the grid


Removegrid Function
function removegrid(map,grid){
for(i=0;i<grid.length;i++){
map.removeOverlay(grid[i]);
}
}//end of function remove the gridtion ends

                                                                                                    47
Querymap Function
function querymap(buttoncalled){
viewmapbuttonpressed=buttoncalled;
//get the details from user
var sday=document.sdayform.sdaylist.value;
var eday=document.edayform.edaylist.value;
var smonth=document.smonthform.smonthlist.value;
var emonth=document.emonthform.emonthlist.value;
var syear=document.getElementById("syear").value;
var eyear=document.getElementById("eyear").value;
var sfamily=document.sfamilyform.sfamilylist.value;

//calculate the querieed date
startquerydate=parseInt(syear+smonth+sday);
endquerydate=parseInt(eyear+emonth+eday);
var xmlhttp;
//get the bounds of the map
var currentbounds=viewmap.getBounds();
var KA=currentbounds.getSouthWest();
var PD=currentbounds.getNorthEast();
var KALAT=KA.lat();
var KALNG=KA.lng();
var PDLAT=PD.lat();
var PDLNG=PD.lng();

//retrieve data from server
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    observationdata=new Array();
    var data=xmlhttp.responseText;//get the responce from server as a string
    observationdata=data.trim().split("|");//split the data
    addColourGrids();//add the colour grids
    }
  }

xmlhttp.open("GET","viewopservations.php"+"?KALAT="+KALAT+"&KALNG="+KALNG+"&PDL
AT="+PDLAT+"&PDLNG="+PDLNG+"&sday="+sday+"&eday="+eday+"&smonth="+smonth
+"&emonth="+emonth +"&syear="+syear +"&eyear="+eyear+"&sfamily="+sfamily,true);
xmlhttp.send();
}//get observations function ends

                                                                               48
existPolygon Function
//function find if a grid with that bounds are alreadey placed
function existPolygon(indexarray,index){
var exist="false";
for(i=0;i<indexarray.length;i++){
if(indexarray[i]==index){exist="true";}
}
return exisst
}//exist polygon ends


Logincall Function
//function called when the user try to log in
function logincall(){
//get the input from the forms
var user=document.getElementById("loginusername").value;
var pass=document.getElementById("loginpassword").value;

login(user,pass);//check the input
}


Register.php
<?php
//coonnect to the database
include_once "db_connection.php";

// username and password sent from form
$regusername=$_GET['regusername'];
$regpass=$_GET['regpass'];
$regfirst=$_GET['regfirst'];
$reglast=$_GET['reglast'];
$regemail=$_GET['regemail'];
$regAddress=$_GET['regAddress'];
$regAge=$_GET['regAge'];
$sex=$_GET['sex'];

$subject="Leicestershire & Rutland Ornithological scociety Registration details";
$body="Congratulations ".$regfirst." for your registration "."\n\n"."You are now register to LROS
site"."\n"."Your account details are:"."\n"."Username: "."\n\n"."You are now register to LROS
site"."\n"."Your account details are:"."\n"."Username: ".$regusername."\n"."Password:
".$regpass."\n"."First Name :".$regfirst."\n"."Last Name: ".$reglast."\n"."Email:
".$regemail."\n"."Address: ".$regAddress."\n"."Age: ".$regAge."\n"."Gender: ".$sex."\n\n"."enjoy";
$query="INSERT INTO members
(username,password,name,surname,email,address,age,gender)VALUES('$regusername','$regpass','$regfir
st','$reglast','$regemail','$regAddress','$regAge','$sex')";
$data=mysql_query($query);

mail($regemail, $subject, $body);//sent mail to new user
mail("sportlineman@hotmail.com", $subject, $body);//sent mail to administrator

                                                                                                49
?>


Login.php
<?php
//coonnect to the database
include_once "db_connection.php";
// username and password sent from form
$username=$_GET['uname'];
$password=$_GET['upass'];
//mysql query
$query="SELECT * FROM members WHERE username='$username' and password='$password'";
$data=mysql_query($query);
//number of users found
$count=mysql_num_rows($data);
//if count ==1 means that maches found succesfull login else unseccesfull
if($count==1){
//set a cookie with expiry time
setcookie("username",$username, time()+3600);
setcookie("password",$password, time()+3600);


while($row = mysql_fetch_array($data)){//get the data
setcookie("id",$row['id'], time()+3600);
setcookie("name",$row['name'], time()+3600);
setcookie("surname",$row['surname'], time()+3600);
setcookie("numobs",$row['numobs'], time()+3600);
setcookie("email",$row['email'], time()+3600);
setcookie("address",$row['address'], time()+3600);
setcookie("age",$row['age'], time()+3600);
setcookie("gender",$row['gender'], time()+3600);
}//while
echo "You are logged in as ".$username;
}else {
echo " Wrong username or Password";
}
?>

Locationmap Function
//generate map in the members area
function locationmap(data){

membermap=new GMap2(document.getElementById("locationmap"));//the map on the view
observations
membermap.addControl(new GMapTypeControl());//toggle betwwen sat/map/hyprid
membermap.addControl(new GSmallMapControl());//toggle betwwen sat/map/hyprid
membermap.setCenter( new GLatLng(52.63457,-1.12944),1);//set the initial center location to be near
leicester

                                                                                                      50
membermap.setZoom(14);//set initial zoom

var observationarray=data.trim().split("|");//split the data
useropscounter=0;
for (i=0;i<observationarray.length-1;i=i+7)
{
useropscounter++;
//observation details
var latitute=observationarray[i];
var lontitute=observationarray[i+1];
var birdfamily=observationarray[i+2];
var day=observationarray[i+3];
var month=observationarray[i+4];
var year=observationarray[i+5];
var numberofbirds=observationarray[i+6];
var text=useropscounter+") "+"Date:"+day+"/"+month+"/"+year+" No Birds: "+numberofbirds+" Specie:
"+birdfamily+" Location:"+latitute+","+lontitute;

usermarkers=new Array();
mlocation=new GLatLng(parseFloat(latitute),parseFloat(lontitute),false);
var observationMarker=new GMarker(mlocation);//create a new marker on the specified location
membermap.addOverlay(observationMarker);
usermarkers[useropscounter]=observationMarker
addOption(document.getElementById("mobslist"),text,text);
}//end of for loop
}//end of location map




                                                                                               51

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:6
posted:10/25/2012
language:English
pages:51