Web GIS Development using Open Source Leaflet and Geoserver Toolkit

Similar documents
pgrouting extends the postgis/postgresql geospatial database to provide geospatial routing and other network analysis functionality.

Introduction to GeoServer

Implementing Web GIS Solutions

Open Source Software: What and Why?

May 22, 2013 Ronald Reagan Building and International Trade Center Washington, DC USA

source: /boris downloaded: Version 1

No Programming Required Create web apps rapidly with Web AppBuilder for ArcGIS

An Overview of FMW MapViewer

OPEN SOURCE SOLUTIONS FOR SURVEYORS

County of Los Angeles. Chief Information Office Preferred Technologies for Geographic Information Systems (GIS) Version 2 May 2015

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

Cartoview Documentation

Welcome to the Introduction to Mapbender

1.1 INTRODUCTION 1.2 HARDWARE AND SOFTWARE SPECIFICATIONS. Hardware - Processor (two quad core processors) with 32GB RAM, 5 x146gb RAID hard drive

Building OSM based web app from scratch

Exploring Open Source GIS Programming. Scott Parker, Katie Urey, Jack Newlevant, Mele Sax-Barnett

welcome to BOILERCAMP HOW TO WEB DEV

IJSRD - International Journal for Scientific Research & Development Vol. 3, Issue 02, 2015 ISSN (online):

Chapter 6. Building Maps with ArcGIS Online

Providing Interoperability Using the Open GeoServices REST Specification

Spatial Analyst. Spectrum. Version Administration Guide

Etanova Enterprise Solutions

EDINA Workshop: Creating a Campus Map and Displaying it in OpenLayers

MapInfo Stratus. Version 41. MapInfo Stratus Administration Guide

May 22, 2013 Ronald Reagan Building and International Trade Center Washington, DC USA

VINEPILOT. Project Design Specification. v2.0 - The Savvy-gnon Team

Agenda. Introduction. Supported Formats. Creating a Custom REST Service. What s Next

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

Community Health Maps Lab Series

[ ]..,ru. GeoServer Beginner's Guide. open source^ software server. Share and edit geospatial data with this open source.

SAW Stand-alone Application for Web GIS Configuration and Deployment. PhD. Bogdan Cheveresan Esri Romania

Who are we? Randal Hale. Nathan Saylor. GIS Coordinator for Hardin Co. Owner of North River Geographic Systems. Consultant. Owner of Saylor Mapping

Introduction to ArcGIS Online and Story Maps

Lab Assignment 4 Basics of ArcGIS Server. Due Date: 01/19/2012

Mobile Application Of Open Source Stack To Geo-Based Data Visualisation On E-Government Web Framework

Design and Implementation of File Sharing Server

Appendix Z Basic ArcMap and GDSE Tools

NFMS web portals Focus on monitoring functions

D4.5 Public Information System. FORCIP+: Forest Roads for Civil Protection

Lab 1: Getting Started with IBM Worklight Lab Exercise

WebGIS exercise Land Change Viewer. Elisabeth Weinke Department of Geoinformatics University of Salzburg

Mapping, Visualization, and Digitization of the Geo-Referenced Information: A case study on Road Network Development in Near Real Time

Open Source Cloud Map User Guide

Visual System Implementation

CSCI 201 Lab 1 Environment Setup

Regular Forum of Lreis. Speechmaker: Gao Ang

Getting Started with the ArcGIS Server JavaScript API

Building Mashups Using the ArcGIS APIs for FLEX and JavaScript. Shannon Brown Lee Bock

Map Functions August 3, 2015 Triangle Homes Group

Open source technologies and INSPIRE network services in Slovak environmental agency

GeoNode Integration with SDIs and Community Mapping

Fact-Finding with MapViewer By Liujian Qian and Jayant Sharma

Using the Computer Programming Environment

ewater SDI for water resource management

WebEasy GIS is a cloud computing application for the web consultation of maps and geographic data.

Terratype Umbraco Multi map provider

Guide to Mapping Website (Public) December 2016 GC_236594

Overview. Setting Up. Geospatial Centre University of Waterloo May 2014

Development of Java Plug-In for Geoserver to Read GeoRaster Data. 1. Baskar Dhanapal CoreLogic Global Services Private Limited, Bangalore

The Event Visualization Tool (evis) User's Guide. For use with QGIS version 1.2.0

Lab 2 Examine More Development Features in IBM Worklight

Getting Started with the ArcGIS API for JavaScript. Julie Powell, Paul Hann

All India Council For Research & Training

DEVELOPMENT OF A MOBILE DATA COLLECTION AND MANAGEMENT SYSTEM

Interactive Web Mapping: Overview

Settings. Overview. OU Campus Settings Page 1 of 13

IBM TRIRIGA Application Platform Version 3 Release 4.0. Connector User Guide

EXERCISE: Publishing spatial data with GeoServer

CUSTOMER PORTAL. Custom HTML splashpage Guide

Terratype Umbraco Multi map provider

Introduction to Autodesk MapGuide EnterpriseChapter1:

Training courses. Course Overview Details Audience Duration. Applying GIS

Create-A-Page Design Documentation

BEST PRACTICES HTML5 SPECIFICATIONS. what's next in data-driven advertising. File Types. HTML5: HTML, JS, CSS, JPG, JPEG, GIF, PNG, and SVG

Find nearest dealer. Users guide

Accessing OGC Services To access OGC WMS and WFS open the service in the directory that you want to consume, and click on either WMS or WFS.

Dreamweaver MX The Basics

Introduction to JavaScript. Evan Caldwell & James Tedrick

Introduction to Autodesk MapGuide EnterpriseChapter1:

MapInfo2Leaflet. User Guide TWIAV.NL

Creating Web Mapping Applications. Nikki Golding

Working with Feature Layers. Russell Brennan Gary MacDougall

Desarrollo de una herramienta de visualización de datos oceanográficos: Modelos y Observaciones

HCA ArcGIS. Online Tool - How To Guide V1.0 2/15/2016 HAWAII CONSERVATION ALLIANCE AGOL

Municipal Connect TM GIS Viewer

EnterSpace Data Sheet

An Oracle White Paper April Oracle Application Express 5.0 Overview

Introduction to QGIS

Introduction to QGIS: Student Workbook

What's New in ActiveVOS 7.1 Includes ActiveVOS 7.1.1

Introduction to ArcGIS Server 10.1

6 Attribute actions to vector layer

Pre-Incident Planning ( PIP )

Deliverable D3.12. Contract number: OJEU 2010/S Deliverable: D3.12 Author: Igor Antolovic Date: Version: Final

Bluehost and WordPress

Working with demographic grids in QGIS

JBoss Portal Quickstart User Guide. Release 2.6.6

LearnOSM. PostgreSQL & PostGIS. Installing PostgreSQL and PostGIS. Reviewed

The figure below shows the Dreamweaver Interface.

What s s Coming in ArcGIS 10 Desktop

Transcription:

Web GIS Development using Open Source Leaflet and Geoserver Toolkit 1 Taranjot Singh Bhatia, 2 Harpinder Singh, 3 P.K Litoria, 4 Brijendra Pateriya 1,2,3,4 Punjab Remote Sensing Centre, Ludhiana, Punjab, India Abstract Popularity of location based web and mobile applications is increasing day by day. The visualization of locations is bit complicated than tabular data. Specialized software are required to build a web GIS (Geographic Information Systems) application providing easy access to geo-spatial data to a large number of people. This paper reviews a simple and easy to use methodology to create a web GIS application using open source tools. Leaflet, Geoserver and PostgreSQL have been used to create the application. Leaflet is used to create the GUI (Graphical user interface), Geoserver acts as a middleware and PostgreSQL is used as a backend data store. The web GIS has basic functionalities like pan, zoom, home, info window, measure, legend button, geo-location, search bar, layer selection, mini map, attribution, mouse position etc. Keywords Web-GIS, Leaflet, GeoServer, PostgreSQL, QGIS. I. Introduction Popularity of location based web and mobile applications is increasing day by day. The visualization of locations is bit complicated than tabular data. Specialized software are required to build a web GIS (Geographic Information Systems) application providing easy access to geo-spatial data to a large number of people. There are many software both commercial and FOSS (Free and Open Source Software) available on the internet to develop a web GIS application. In this study an attempt has been made to develop a web GIS application using the open source javascript library Leaflet, Geoserver and PostgreSQL database. Usually, a web GIS (Geographic Information System) mapping application has a three layer architecture, PostgreSQL in addition with PostGIS is used in the backend to store the geospatial data, Geoserver is used to create services of the data in the database and symbolize them, while the leaflet library is used to create the GUI. Leaflet is a javascript library for building web GIS applications across web browsers, desktops, and mobile devices. GeoServer is an open source software server written in Java that allows users to share and edit geospatial data. Designed for interoperability, it publishes data from any major spatial data source using open standards. PostgreSQL is a powerful, open source object-relational database system that has bindings for many programming languages such as C, C++, Python, Java, PHP, and Ruby. It runs on all major operating systems. PostGIS adds support to store geographic objects in the PostgreSQL database. Leaflet [1] is an open source JavaScript (js) library. It helps to create mobile-friendly interactive maps. It is simple, easy to use, light weight and provides enhanced performance. It works efficiently across all major desktop and mobile platforms. As it is open source, the developer community has contributed to create a lot of free plugins [2] to accomplish various tasks and add different kind of tools to the web map application. It has a well-documented API (Application Programming Interface) [3] and a simple, readable source code. Qgis2web a plugin for QGIS (Quantum GIS) has been used to prepare a basic web GIS application. The basic application can be enhanced and customized by adding various leaflet plugins. In addition to leaflet another popular javascript library for creation of maps is openlayers [4]. As compared to openlayers leaflet (approx 38 KB ) is light weight due to which it provides better performance. Leaflet is more mobile friendly than openlayers. Leaflet has been used worldwide for the preparation of web mapping applications. [5] has implemented a free web mapping service for the mobile tourist guide based on OpenStreetMap, Leaflet, PostGIS, pgrouting, and Nominatim projects. [6] has designed a search engine which helps to extract the WMS (Web Mapping Service) services hidden in the javascript code, this engine represents an important step towards realizing land cover information integration for global mapping and monitoring purposes. Leaflet has been used in this project for the visualization of the WMS services. It has also been used for the rendering of maps for the project involving the Land cover change map comparisons using open source web mapping technologies by [7-8] has also prepared time series proportional symbol maps with Leaflet and JQuery. II. Objectives The objective of this study is to create a web GIS application using open source tools. Leaflet, Geoserver and PostgreSQL have been used to create the application. The web GIS has basic functionalities like pan, zoom, home, info window, measure, legend button, geo-location, search bar, layer selection, mini map, attribution, mouse position etc. While building a web GIS, major efforts are utilized in the creation of the GUI (Graphical User Interface), therefore this paper focuses more on the Leaflet Javascript Library. This paper proposes a simple, easy to use and a fast process to create a web GIS. III. Tools & Methodology Tools Used: Geoserver 2.12, PostgreSQL 9.4, QGIS 2.18.15, Apache Tomcat 9.0 and Leaflet 1.3. A. Installation and Configuration of PostgreSQL Database Download and Install PostgreSQL from [9]. Refer [10] for the installation process. Change the Port number to 5433 while installation. Also download the PostGIS extension using stack builder by checking Spatial Extension option during the installation of PostgreSQL. Loading Shape files into the PostgreSQL Database: Before importing the shape file to the database, add PostGIS extension in the database. Open pgadmin III, Connect to Database Server in Object Explorer, Explore Database then right click on Extensions and click on New Extension, select the extension PostGIS from dropdown. Else, run the following command in SQL Editor: CREATE EXTENSION PostGIS; Open PostGIS Shape file Import/Export Manager and establish a connection by clicking on view connection details and w w w.i j c s t.c o m International Journal of Computer Science And Technology 29

ISSN : 0976-8491 (Online) ISSN : 2229-4333 (Print) provide the connection parameters like Username, Password, Database, Server. Usually the values will be Host= localhost and Port= 5433. Browse Shape file(geo spatial data) using Add File button and click on Import button. B. Installation and Configuration of Geoserver Install the Java Development Kit (JDK) downloaded from [11]. JDK is required to run and develop Java application on the computer system. Install the Apache Tomcat Server. Install the GeoServer package in Apache Tomcat, download it from [12]. Refer [13] for the installation process. Open any internet browser and type http://localhost:1234/ dashboard/ to open the dashboard of Geoserver. (1234 is the port and may be changed) Login to the GeoServer using the address http://localhost:1234/ geoserver/web/ (Default username is admin and password is geoserver ). Add a new Workspace in GeoServer using the link in the left panel. Workspaces: Add new Workspace and Type the Workspace Name in Name and Namespace URI text field and click Submit. Add a new PostGIS store in GeoServer using the link in the left panel. Fill the basic store information and connection parameters. Click on the Publish tab and select the GIS layer projection system in Declared SRS and then compute the coordinates from Bounding Boxes and provide other details like styling (If required). Now layer can be viewed in the Layer Preview option. C. Creation of a Basic Application Using QGIS and QGIS2Web Plugin Install QGIS (Quantum GIS). Install the qgis2web [14] plugin in QGIS. Create the map with the desired layers and symbology in QGIS. Import basic map view with the help of qgis2web plugin. Add inbuilt controls (zoom in/out, location, measure, layerselector, geocoder search) in the qgis2web plugin view. Preview the added layers in the application (in browser). To zoom at a particular location on the added layer by default, change the center points in map section and zoom level can also be increased or decreased by editing the zoom property in map component of the same section. Export with the leaflet option (Figure 1). The basic start-up web GIS application is as shown (Figure 2) in the browser D. Customization of the Basic Application In addition to the tools added in the basic application, we can add other tools with the help of leaflet plugins. Some useful plugins are : Mouse Position tool: This tool [15] can be added to the application by referring the js (javascript) and css (cascading style sheets) files in the html page (index.html). This tool provides the current position of the mouse in longitude and latitude. CSS- To add url of CSS file in html page <link rel= stylesheet href= css/l.control.mouseposition. css > <script src= js/l.control.mouseposition.js ></script> To declare a variable with script tag in html file than to write a script or code, var mouseposition1; mouseposition1 = L.control.mousePosition().addTo(map); Zoom and Home tool: Zoom/Home tool [16] can be added to the application by referring the JS (Javascript) and CSS (Cascading Style Sheets) files in the html page (index.html). The Zoom tool provides the zoom in (+) and zoom out (-) of map. Home button is used for back to original view of map. Minimap tool: A minimap [17] shows the map at a different scale to aid navigation. This is a simple minimap control that you can drop into your leaflet map, and it will create a small map in the corner which shows the same map, as the main map with a set zoom offset. Panning tool: Pan tool [18] is used to change the way the user is moving around the map i.e. up, down, left and right. CSS- To add url of CSS file in html page <linkrel= stylesheet href= css/l.control.pan.css > <script src= js/l.control.pan.js ></script> To declare a variable with script tag in html file than to write a script or code, var pan1; (declare variable) map.addcontrol(new L.Control.Pan()); Attribution tool: The attribution control allows you to display attribution data in a small text box on a map. It is put on the map by default unless you set its attribution Control option to false, and it fetches attribution texts from layers with the get attribution method automatically. Code- Var basemap0 = L.tileLayer( http://{s}.tile.openstreetmap.org/ {z}/{x}/{y}.png, { attribution: <a href= http://abc/ > Name </a> contributors, <a href= http://xyz/ > Name </a>, maxzoom: 28 basemap0.addto(map); function setbounds() { map.setmaxbounds(map.getbounds()); } Add a button to open a legend (jpg file): A button is created in javascript which helps to open a jpg file. Basically, the jpg file contains the symbology of the layers added to the map. The jpg can be created using MS-Power point or any other image processing software. 30 International Journal of Computer Science And Technology www.ijcst.com

Code to add a button (js)- <script type= text/javascript > $(document).ready(function() { $( #inner_div ).hide(); $( button ).click(function(){ $( #inner_div ).toggle(); </script> Code to add legend image (jpg) in html (index) file- <div id= legend > <button><b>l</b></button> <div id= inner_div > <img src= images/legend.jpg > </div> </div> Info tool: Info tool functionality for WMS layers is not inbuilt in leaflet. To get the feature attributes from a WMS layer is bit complicated. For this Better WMS plugin [19] is required. This plugin will help to get the attributes of the features on clicking it. <script src= L.TileLayer.BetterWMS.js ></script> Code- Var url = http://ip_address:8080/geoserver/abc/wms ; L.tileLayer.betterWms(url, { layers: dwss_tm, transparent: true, format: image/png }).addto(map); And, Go to Better WMS javascript (js) file, To add layers and query layers statement parameters in getfeatureinfourl function. Final view of the application after adding all the desired control/ tools is as shown in Figure 3. IV. Varients of Leaflet ESRI Leaflet [20] A lightweight set of tools for using ArcGIS services with Leaflet. Esri Leaflet is a collection of API plugins for the open-source javascript mapping library leaflet. It is not a replacement for Leaflet, but rather additional code aimed at making it convenient, intuitive to mix data and services from ArcGIS Server and ArcGIS Online in Leaflet applications. Leaflet for R [21] Leaflet is one of the most popular open-source JavaScript libraries for interactive maps. This R package makes it easy to integrate and control Leaflet maps in R. A programmer can create maps right from the R console or RStudio. V. Conclusion From, this study we can conclude that powerful web GIS applications can be created within a short period of time, using free and open source tools. Even a person with less or no programming skills can create a web GIS application using the step by step methodology provided in this paper. If the amount of data is less then instead of using a database like PostgreSQL, data can be used in the form of JSON files, which makes the application setup even more quick and easy. Basic geoprocessing tools can also be added to the GIS application using turf.js [22], an open source javascript library. References [1] Anonymous, Leaflet - a JavaScript library for interactive maps". [Online] Available: https://leafletjs.com. [Accessed:15- Jun- [2] Anonymous, Leaflet Plugins. [Online] Available: https:// leafletjs.com/plugins.html. [Accessed:15-Jun- [3] Anonymous, Leaflet API References. [Online]. Available: https://leafletjs.com/reference-1.3.0.html. [Accessed:15-Jun- [4] Anonymous,"Openlayers-Welcome. [Online] Available: https://openlayers.org/. [Accessed:15-Jun- [5] Teslya, N, Web mapping service for mobile tourist guide, In Open Innovations Association FRUCT, Proceedings of 15th Conference of IEEE, pp. 135-143, 2014. [6] Hou, D., Chen, J., Wu, H, Discovering land cover web map services from the deep web with javascript invocation rules. ISPRS International Journal of Geo-Information, Vol. 5, No. 7, pp. 105, 2016. [7] Lindblom, E., Housman, I., Guay, T., Finco, M., Megown, K, Land cover change map comparisons using open source web mapping technologies. In: Stanton, Sharon M.; Christensen, Glenn A., comps. 2015. Pushing boundaries: new directions in inventory techniques and applications: Forest Inventory and Analysis (FIA) symposium 2015. 2015 December 8 10; Portland, Oregon. Gen. Tech. Rep. PNW- GTR-931. Portland. Vol. 931, pp. 220, 2015. [8] Donohue, R. G., Sack, C. M., Roth, R. E, Time series proportional symbol maps with Leaflet and JQuery, Cartographic Perspectives, no. 76, pp. 43-66, 2014. [9] Anonymous, PostgreSQL Download. [Online] Available: http://www.enterprisedb.com/products-services-training/ pgdownload#windows. [Accessed:15-Jun- [10] Anonymous, Install PostgreSQL. [Online]. Available: http://www.postgresqltutorial.com/install-postgresql/. [Accessed:15-Jun- [11] Anonymous, Java SE Development Kit 8 - Downloads - Oracle. [Online] Available: http://www.oracle.com/ technetwork/java/javase/downloads/jdk8-downloads- 2133151.html.[Accessed:15-Jun- [12] Anonymous, Download GeoServer. [Online]. Available: http://geoserver.org/release/stable/.[accessed:15-jun- [13] Anonymous, Geoserver Web Archive Installation. [Online]. Available: http://docs.geoserver.org/stable/en/user/in stallation/war.html.[accessed:15-jun- [14] Anonymous, qgis2web Plugin - QGIS Python Plugins Repository. [Online]. Available: https://plugins.qgis.org/ plugins/qgis2web/. [Accessed:15-Jun- [15] Anonymous, Leaflet mouse position. [Online]. Available: https://github.com/ardhi/leaflet.mouseposition. [Accessed:15-Jun- [16] Anonymous, Leaflet zoomhome. [Online]. Available: https:// github.com/torfsen/leaflet.zoomhome. [Accessed:15-Jun- w w w.i j c s t.c o m International Journal of Computer Science And Technology 31

IJCST Vol. 9, Issue 3, July - September 2018 [17] Anonymous, Leaflet-Minimap. [Online]. Available: https:// github.com/norkart/leaflet-minimap [Accessed:15-Jun ISSN : 0976-8491 (Online) ISSN : 2229-4333 (Print) [18] Anonymous, Leaflet Pan Control. [Online]. Available: http:// kartena.github.io/leaflet.pancontrol/. [Accessed:15-Jun Fig. 1: Creation of a Basic Application Using qgis2web Plugin Fig. 2: Basic Application View in Browser 32 International Journal of Computer Science And Technology w w w. i j c s t. c o m

Fig. 3: Final Application w w w.i j c s t.c o m International Journal of Computer Science And Technology 33