Application Development in Web Mapping 1.

Similar documents
Application Development in Web Mapping 2.

Spatial Databases by Open Standards and Software 1.

Announcements. 1. Class webpage: Have you been reading the announcements? Lecture slides and coding examples will be posted

Spatial Databases by Open Standards and Software 3.

Announcements. 1. Class webpage: Have you been reading the announcements? Lecture slides and coding examples will be posted

User Interaction: XML and JSON

HTML. Mohammed Alhessi M.Sc. Geomatics Engineering. Internet GIS Technologies كلية اآلداب - قسم الجغرافيا نظم المعلومات الجغرافية

Regarding the quality attributes, the architecture of the system must be:

Tutorial 1 Getting Started with HTML5. HTML, CSS, and Dynamic HTML 5 TH EDITION

Introduction to Information Systems

A network is a group of two or more computers that are connected to share resources and information.

Beyond PostGIS. New developments in Open Source Spatial Databases. Karsten Vennemann. Seattle

Introduction to the Internet and World Wide Web p. 1 The Evolution of the Internet p. 2 The Internet, Intranets, and Extranets p. 3 The Evolution of

MRK260. Week Two. Graphic and Web Design

The Nature of the Web

Web-centric Computing 2008: 1.What is computing? 1.What is computing? CSCI 3172 Fall Computing, Hypertext, & the WWW

User Interaction: XML and JSON

Web Engineering (CC 552)

Web Design and Application Development

Web Design and Development ACS-1809

Chapter 1 Introduction to HTML, XHTML, and CSS

Objectives. Introduction to HTML. Objectives. Objectives

Developing Ajax Web Apps with GWT. Session I

SERVO - ACES Abstract

Hypertext Markup Language, or HTML, is a markup

Developing a Basic Web Page

Web Information System Design. Tatsuya Hagino

Using ESRI data in Autodesk ISD Products

Introduction to Web Technologies

Grade 9 :The Internet and HTML Code Unit 1

Introduction to Autodesk MapGuide EnterpriseChapter1:

User Interaction: XML and JSON

CNIT 129S: Securing Web Applications. Ch 3: Web Application Technologies

Web Design. Basic Concepts

CS50 Quiz Review. November 13, 2017

5/19/2015. Objectives. JavaScript, Sixth Edition. Introduction to the World Wide Web (cont d.) Introduction to the World Wide Web

HTML/CSS Essentials. Day Three Ed Crowley

Notes beforehand... For more details: See the (online) presentation program.

Introduction to Autodesk MapGuide EnterpriseChapter1:

Leveraging OGC Services in ArcGIS Server. Satish Sankaran, Esri Yingqi Tang, Esri

Introduction to XML. Asst. Prof. Dr. Kanda Runapongsa Saikaew Dept. of Computer Engineering Khon Kaen University

CS WEB TECHNOLOGY

CS/COE 1520

Cleveland State University Department of Electrical and Computer Engineering. CIS 408: Internet Computing

INTRODUCTION TO WEB USING HTML What is HTML?

XML: Introduction. !important Declaration... 9:11 #FIXED... 7:5 #IMPLIED... 7:5 #REQUIRED... Directive... 9:11

ISO INTERNATIONAL STANDARD. Geographic information Simple feature access Part 1: Common architecture

Introduction to XML 3/14/12. Introduction to XML

CTI Higher Certificate in Information Systems (Internet Development)

HTML CSS JAVASCRIPT WEB PUBLISHING IN ONE HOUR A DAY SAMS TEACH YOURSELF COVERING HTML5 CSS3 AND JQUERY 7TH EDITION

Midterm 1 Review Sheet CSS 305 Sp 06

Web Applications Development

HTML, XHTML, and CSS. Sixth Edition. Chapter 1. Introduction to HTML, XHTML, and

COMS W3101: SCRIPTING LANGUAGES: JAVASCRIPT (FALL 2018)

MARKUP LANGUAGES. A brief history of Markup languages

EasyChair Preprint. Introduction to Development of Software Support for Training and Testing IT Administrators


HTML HTML/XHTML HTML / XHTML HTML HTML: XHTML: (extensible HTML) Loose syntax Few syntactic rules: not enforced by HTML processors.

CTI Short Learning Programme in Internet Development Specialist

Developing Online Databases and Serving Biological Research Data

How the Web Works. Chapter 1. Modified by Marissa Schmidt Pearson

Lecture 9 Server Browser Interactions

COMSC-030 Web Site Development- Part 1. Part-Time Instructor: Joenil Mistal

Programming the World Wide Web by Robert W. Sebesta

HTML is a mark-up language, in that it specifies the roles the different parts of the document are to play.

Web Services for Geospatial Mobile AR

Introduction to WEB PROGRAMMING

Module 2 (III): XHTML

Background of HTML and the Internet

How A Website Works. - Shobha

Web Design E M I R R A H A M A N WEB DESIGN SIDES 2017 EMIR RAHAMAN 1

Web Programming Pre-01A Web Programming Technologies. Aryo Pinandito, ST, M.MT

Unit 4 The Web. Computer Concepts Unit Contents. 4 Web Overview. 4 Section A: Web Basics. 4 Evolution

Semantic Web Lecture Part 1. Prof. Do van Thanh

Car Sounds with JavaScript

ISA Action 1.17: A Reusable INSPIRE Reference Platform (ARE3NA)

SEXTANT 1. Purpose of the Application

CSCI 6312 Advanced Internet Programming

Modern and Responsive Mobile-enabled Web Applications

Web Site Design and Development. CS 0134 Fall 2018 Tues and Thurs 1:00 2:15PM

Advanced PHP and MySQL

XML and Inter-Operability in Distributed GIS

Acceptance Test. Smart Scheduling. Empire Unlimited. Requested by:

Shankersinh Vaghela Bapu Institue of Technology

CHAPTER 2 MARKUP LANGUAGES: XHTML 1.0

Languages in WEB. E-Business Technologies. Summer Semester Submitted to. Prof. Dr. Eduard Heindl. Prepared by

INTRODUCTION TO HTML5! HTML5 Page Structure!

CARTODB: VISUALIZE SPATIAL DATA ON THE WEB Thematic Mapping of Enschede socio-economic data

Some businesses have changed in a major way because of new technology

Technology in Action. Chapter Topics. Scope creep occurs when: 3/20/2013. Information Systems include all EXCEPT the following:

Understanding and Working with the OGC Geopackage. Keith Ryden Lance Shipman

Tennessee. Business Technology Course Code Web Design Essentials. HTML Essentials, Second Edition 2010

DanubeGIS User Manual Document number: Version: 1 Date: 11-Nov-2016

University of West Hungary, Faculty of Geoinformatics. Béla Márkus. Spatial Analysis 5. module SAN5. 3D analysis

What is a web site? Web editors Introduction to HTML (Hyper Text Markup Language)

Introduction to Web Development

CSC9B1: Essential Skills WWW 1

The Internet The Internet

(1) I (2) S (3) P allow subscribers to connect to the (4) often provide basic services such as (5) (6)

OGC Simple Features (for SQL and XML/GML)

Transcription:

University of West Hungary, Faculty of Geoinformatics László Kottyán Application Development in Web Mapping 1. module ADW1 Web Technologies and Geospatial Standards SZÉKESFEHÉRVÁR 2010

The right to this intellectual property is protected by the 1999/LXXVI copyright law. Any unauthorized use of this material is prohibited. No part of this product may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage and retrieval system without express written permission from the author/publisher. This module was created within TÁMOP - 4.1.2-08/1/A-2009-0027 "Tananyagfejlesztéssel a GEO-ért" ("Educational material development for GEO") project. The project was funded by the European Union and the Hungarian Government to the amount of HUF 44,706,488. Lector: Antal Guszlev Project manager: András Szepes Professional project manager: Gábor Mélykúti, dean Copyright University of West Hungary Faculty of Geoinformatics 2010

Table of Contents 1. Web Technologies and Geospatial Standards... 1 1.1 Introduction... 1 1.2 Web technologies... 1 1.2.1 Client... 2 1.2.2 Communication... 2 1.2.3 Server... 3 1.2.4 Terms... 4 1.3 Geopatial Standards... 8 1.3.1 WMS... 9 1.3.2 WFS... 9 1.3.3 CRS... 9 1.3.4 WKT and WKB... 9 1.3.5 GML... 9

List of Tables 1-1. HTTP methods... 4 1-2. HTTP status messages... 4 1-3. CRUD operations and SQL statements... 8

Chapter 1. Web Technologies and Geospatial Standards 1.1 Introduction The subject, Application development in Web Mapping is divided into seven modules. In the series of modules we would like to give you an overview about the web application development starting from the basics of WEB to some advanced Web mapping examples. To become a web developer you need to learn about several technologies. To create custom webmapping applications you need to learn about geoinformation technologies. However writing a book which covers all the related technologies is not a good idea, it would fill thousands of pages. Moreover these pages have already written by others. Therefore the modules will highlight the most important terms, give practical examples and refer to other readings on the WEB. This series is intended to be a scaffold which helps in the steps to starting your own development. The list of topics: Module 1: Web Technologies and Geospatial Standards Module 2: Spatial Data Storage Module 3: WMS/WFS Server Module 4: Web Mapping Client Module 5: OWS application Module 6: Web Application Framework Module 7: Web Mapping Application In modules we will work with open source tools, technologies and open standards. In Module 1 an overview is given about: the client/server architecture of Web the communication between browsers and web servers some highlighted terms in web technologies OGC standards 1.2 Web technologies The World Wide Web is the most innovative and most-used part of the Internet. On Web complex contents, videos, graphics, sounds, texts are available. Behind these contents there are versatile technologies which serve data to users or to other services. A web developer should be familiar with most of the underlying technologies. Web, like other services on the Internet, operates on a client/server model. Web browser, the client, requests information or resources from web servers. Servers handle the request and pass back the result to the browser. It is the basis of the communication on the Internet or generally in client/server environment.

Application Development in Web Mapping 1. 2010 The resources requested by browser most of the time are Hypertext Markup Language (HTML) documents. And a resource can be an XML or JSON document, image or any other content. On Web, for a browser request the Hypertext Transfer Protocol (HTTP) is used. HTTP defines methods for the client/server communication (Figure 1-1.). Figure 1-1.: Client/server communication When we talk about how the Web works it is a clearer way to study the client-side, the server-side and the communication separately. 1.2.1 Client On client-side after a page loaded into the browser window, user can do basically two things to change the user interface, to do any interactivity: a. send a new request to the server (or to another one), for example the user clicks on a link and a new page is loaded, b. don't send a new request to the server but use the elements of the page for interaction, for example the user opens a drop-down menu or types a wrong value to a form text input field and an error message is displayed. In the second case the client application or the client part of the web application is developed using DHTML or Flash 1 technologies. Developing a web application the developer has to deal with both the server-side component of the application and the client-side one. The first development is generally called server programming the second is named browser scripting or client-side programming. What the user sees in the browser is the client part of the web application. In a certain context the client is named view. If the developer makes a decision to put more function to the client side the web application can become more interactive. 1.2.2 Communication The communication is initiated by the client with a request. Traditionally requests are served one by one. A modern way is using Ajax 2 techniques. Ajax allows asynchronous communication with the server. User doesn't have to wait for the response as in case of the traditional way while the page is loading. With asynchronous communication only a part of the page is refreshed the other part is still available for the user. Refreshing only a part of a page takes less time and makes it possible to enhance user experiences similar to desktop software (Figure 1-2.). 1 Wikipedia, Adobe Flash: http://en.wikipedia.org/wiki/adobe_flash 2 Jesse James Garrett: Ajax: A New Approach to Web Applications, http://www.adaptivepath.com/ideas/e000385 ADW1-2 University of West Hungary Faculty of Geoinformatics, 2010

Kottyán László Web Technologies and Geospatial Standards Figure 1-2.: Ajax (source: http://www.adaptivepath.com/ideas/e000385) Using Ajax communication there is a c) option on client-side which combines the a) and b) cases and provides more interactivity. Ajax is a key technology to build Web 2.0 websites. 1.2.3 Server An HTTP request contains a URL which tells the server what to serve. Sometimes it tells exactly the path and the name of a document, for example: http://www.example.com/documents/report.pdf http://www.example.com/documents/about.html http://info.cern.ch/hypertext/www/theproject.html If the server sends back these documents without any processing on data these are static contents. Most of the time the content is varying. The same request results different responses after a wile or occasionally. Usually the varying is in a database and the request determines what data should be served. The database backend requires additional programs on server-side which: decide how to process the request, connect to the database and select the right data or dataset, generate the document with data to be sent back. If the data of web pages is stored in database, there is possibility to create, modify or delete data, consequently change the pages or part of the pages. University of West Hungary Faculty of Geoinformatics, 2010 ADW1-3

Application Development in Web Mapping 1. 2010 1.2.4 Terms After the review of the client/server model, the web technology - related terms will be explained. The list of terms is not in alphabetical order but it follows a 'simplest to complex' kind of logic. 1.2.4.1 WWW The World Wide Web (WWW, Web) was invented by Tim Berners-Lee at CERN in 1989. 3 WWW is one of the services that run on Internet. Firstly the idea was that Web is a network of hyperlinked (connected) pages, documents. Some might think it is an old-fashion definition. After more than twenty years of evolution of Web the information sharing, collaboration and interoperability characterize it. The contents on the Web are placed on web server computers. The World Wide Web Consortium 4 (W3C) was founded for developing and maintaining Web standards in 1994. 1.2.4.2 HTTP HTTP 5 (Hypertext Transfer Protocol) is an application-level protocol for distributed, collaborative, hypermedia information systems. HTTP has been in use by the World Wide Web since 1990. It has methods related to the resources identified by URLs (Table 1-1.). Table 1-1. HTTP methods HTTP resource-related methods GET POST PUT DELETE Function Request a representation of a specified resource. Submits data to the specified resource Uploads a resource. Deletes a specified resource. HTTP has status messages that might be returned to the browser. Table 1-2. lists some messages: Table 1-2. HTTP status messages Status message Description 200 OK The request is OK. 400 Bad Request The server did not understand the request 401 Unauthorized The requested page needs a username and a password 403 Forbidden Access is forbidden to the requested page 404 Not Found The server can not find the requested page 500 Internal Server Error The request was not completed. The server met an unexpected condition 503 Service Unavailable The request was not completed. The server is temporarily overloading or down 1.2.4.3 HTML HyperText Markup Language (HTML) is referred to as a language of the Web. HTML is used to describe Web pages with markup syntax. For marking of web page content tags are used. A tag is a keyword surrounded by angle brackets like <html>. A markup normally has opening and closing tags: 3 CERN, Where the Web was born: http://public.web.cern.ch/public/en/about/web-en.html 4 W3C: http://www.w3.org 5 HTTP/1.1: http://www.w3.org/protocols/rfc2616/rfc2616.html ADW1-4 University of West Hungary Faculty of Geoinformatics, 2010

Kottyán László Web Technologies and Geospatial Standards <b>bold text </b> Closing tag is marked with an additional / character. The example on a web page displays like this: bold text Sometimes markup has no content and has only one tag like the tag which defines a single line break: <br /> Tags can contain attributes: <a href="index.htm" > This is a link </a> Attributes have a name="value" syntax. In the example href is an attribute with "index.html" value. The HTML document has two distinct parts: head and body. <html> <head> <title> Title </title> </head> <body> <p> The content is here </p> </body> </html> Elements inside <head> can include scripts, instruct the browser where to find style sheets, provide meta information and more. Elements inside <body> are displayed on web pages. HTML 4.01 became a standard in 1999. 1.2.4.4 HTML5 HTML5 is the next generation of HTML. Some elements of HTML 4.01 are deleted or re-written in HTML5. It also defines new elements for better structure, drawing, media content and better form handling. 1.2.4.5 CSS CSS (Cascading Style Sheets) used to define how to display HTML elements. A CSS style has two main parts: a selector, and one or more declarations (Figure 1-3.): Figure 1-3. CSS syntax (source: http://www.w3schools.com/css/css_syntax.asp) The selector is normally the HTML element you want to style. Each declaration consists of a property and a value. The property is the style attribute you want to change. Each property has a value. 6 1.2.4.6 JavaScript JavaScript is an object-oriented, dynamic, scripting language for client-side programming and implemented in most web browsers. 6 W3Schools, CSS Syntax: http://www.w3schools.com/css/css_syntax.asp University of West Hungary Faculty of Geoinformatics, 2010 ADW1-5

Application Development in Web Mapping 1. 2010 JavaScript: adds interactivity to HTML pages, changes Html elements, styles, used to preprocess data on the client before submission to a server, communicates with web server. JavaScript code can be placed in HTML file or in external files. 1.2.4.7 DHTML DHTML (Dynamic HTML) is not a language. It is a term to describe the combination of HTML, CSS and JavaScript. DHTML allows developers to add animations, visual effects to pages and manipulate HTML elements. 1.2.4.8 XML extensible Markup Language (XML) is to transport and store data. It uses tags like HTML but not for displaying content. XML needs processing tools for displaying the content. XML defines the structure of data and contains data. XML has strict rules: XML documents must have a root element XML elements must have a closing tag XML tags are case sensitive XML elements must be properly nested XML attribute values must be quoted XML doesn't have predefined tags it should be defined by the author, developer. It means that XML is for creating new languages for specific applications. Some XML languages: 1.2.4.9 JSON XHTML: HTML with strict XML rules Geographic Markup Language (GML): a language for describing geographical features DocBook: a markup language for technical documentation MathML: a markup language for mathematical notation JSON 7 (JavaScript Object Notation) is a lightweight data-interchange format. It is for data transfer like XML but can be read with any programming language, no need for special processing toolset to work with. JSON is built on two structures: A collection of name/value pairs. In various languages, this is realized as an object, record, struct, dictionary, hash table, keyed list, or associative array. An ordered list of values. In most languages, this is realized as an array, vector, list, or sequence. 7 JSON: http://www.json.org/ ADW1-6 University of West Hungary Faculty of Geoinformatics, 2010

Kottyán László Web Technologies and Geospatial Standards 1.2.4.10 GeoJSON GeoJSON is a data-interchange format for a variety of geographic data structures. GeoJSON can be used to represent a geometry, a feature, a collection of geometries, or a collection of features. The geometry types supported in GeoJSON are Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon and GeometryCollection. Features in GeoJSON are geometry objects with additional properties. A geometry collection represents a list of geometries and a feature collection represents a list of features. 8 Here is a sample GeoJSON data displayed in browser (Figure 1-4.): 1.2.4.11 Web Application Framework Figure 1-4.: GeoJSON dataset A web application is a software application which is accessed through a Web browser, using a http connection for information retrieval or display over a network. A framework is the foundation of a web application. It can provide several useful tools to developers, including: - database abstraction, - templating system, - serving and routing tools for client-server communication, - user session management. A framework defines the architecture of an application which structure helps the developers to build applications according to a particular logic. 1.2.4.12 MVC Model-View-Controler 9 (MVC) architecture separate three parts of an application: 8 GeoJSON draft version 6: http://wiki.geojson.org/geojson_draft_version_6 9 Trygve Reenskaug: MVC : http://heim.ifi.uio.no/~trygver/themes/mvc/mvc-index.html University of West Hungary Faculty of Geoinformatics, 2010 ADW1-7

Application Development in Web Mapping 1. 2010 Model is responsible for representing data, Controller makes the functionality or business logic, View represents the user interface. The parts communicate with each other. According to the implementation of MVC there are some different interpretations of it. One interpretation is that Controller can communicate with Model and View but Model and View are never in direct relationship. 1.2.4.13 Databases In web development, the most popular database management systems are open source. MySQL 10 was initially released in 1995 by MySQL AB. The first public version of the open source PostgreSQL 11 was released in 1989. It is developed by PostgreSQL Global Development Group community. With PostGIS 12 extension it is widely used in the GIS field. 1.2.4.14 CRUD The basic logical operations on data are create, read, update and delete (CRUD)(Table 1-3.). For example, on user level a read can be a listing, finding or any other function what reads data from database. Table 1-3. CRUD operations and SQL statements CRUD operations Create Read Update Delete SQL statements Insert Select Update Delete 1.2.4.15 ORM In MVC, the Model mostly represents one table in the application database. One table is one Model class and one record (or tuple) is one object and one column (or field) is one attribute in Model class. This kind of relationship between the relational database world and the object-oriented world is named Object-Relational Mapping (ORM). The model provides methods to create, read, update or delete data in database. Even more, a Model can handle the relationships in database. 1.3 Geopatial Standards The Open Geospatial Consortium (OGC) is an international industry consortium to develop publicly available standards in the GIS domain. Several open source and commercial applications follow these standards to store, process and visualize spatial and related data. OGC standards 13 are available at no cost to everyone. Browsing on OGC pages we find different document types: OpenGIS Implementation Standard: It is a technology dependent standard for application programming interfaces and related standards based on the Abstract Specification or domain-specific exten- 10 MySQL: http://www.mysql.com/ 11 PostgreSQL: http://www.postgresql.org 12 PostGIS: http://postgis.refractions.net/ 13 OGC standards: http://www.opengeospatial.org/standards ADW1-8 University of West Hungary Faculty of Geoinformatics, 2010

Kottyán László Web Technologies and Geospatial Standards sions to the Abstract Specification. There are five types of standard documents: Interface, Encoding, Profile, Application Profile, and Application Schema. Abstract Specification: It describes and/or models an application environment for interoperable geoprocessing and geospatial data and services products. Best Practices: It contains discussion related to the use and/or implementation of an adopted OGC document. Discussion Papers: It contains not official discussion of some technology or standard. White Papers: A publication that states a position on a social, political, technical or other subject, often including a high-level explanation of an architecture or framework of a solution. The OGC s technical activities fall into three categories: the development of an abstract specification, the development of an implementation specification, and the specification revision process. There are more than 30 standards available. 1.3.1 WMS The OpenGIS Web Map Service (WMS) is an OGC standard which produces maps of spatially referenced data dynamically from geographic information. This international standard defines a map to be a portrayal of geographic information as a digital image file suitable for display on a computer screen. 1.3.2 WFS The OpenGIS Web Feature Service (WFS) is an OGC standard which allows for requests of geographical features across the web using platform-independent calls. 1.3.3 CRS Coordinate Reference Systems are defined in the OGC Abstract Specification: Topic 2 - Spatial Referencing by Coordinates. This document also describes coordinate transformations and coordinate conversions between two different coordinate reference systems. 1.3.4 WKT and WKB OGC specification defines two standard ways to describe spatial objects: the Well-Known Text (WKT) form and the Well-Known Binary (WKB) form. Both WKT and WKB include information about the type of the object and the coordinates. Some WKT examples: POINT(0 0) LINESTRING(0 0,1 1,1 2) POLYGON((0 0,4 0,4 4,0 4,0 0),(1 1, 2 1, 2 2, 1 2,1 1)) MULTIPOINT(0 0,1 2) MULTILINESTRING((0 0,1 1,1 2),(2 3,3 2,5 4)) MULTIPOLYGON(((0 0,4 0,4 4,0 4,0 0),(1 1,2 1,2 2,1 2,1 1)), ((-1-1,-1-2,-2-2,-2-1,-1-1))) GEOMETRYCOLLECTION(POINT(2 3),LINESTRING(2 3,3 4)) The WKB representation of POINT(5 0): 010100000000000000000014400000000000000000 1.3.5 GML GML, or the Geographic Markup Language is an XML encoding for the transport and storage of geographic information, including both the spatial and non-spatial properties of geographic features. GML is intended to provide a means of encoding spatial information for both data transport and data storage, especially in a widearea Internet context. University of West Hungary Faculty of Geoinformatics, 2010 ADW1-9

Application Development in Web Mapping 1. 2010 Bibliography Gralla, P.- Troller, M.: How the Internet Works, Eighth Edition, Que Publishing, 2007 OGC: OGC Reference Model, http://www.opengeospatial.org/standards/orm W3Schools: W3Schools Tutorials, http://w3schools.com/ ADW1-10 University of West Hungary Faculty of Geoinformatics, 2010