Wireless GIS (w-GIS) for real time data logging Nitin K. Tripathi (Speaker) Asian Institute of Technology, Bangkok Nitinkt@ait.ac.th Phisan Santitamnont , CU Pakorn Apaphant , GISTDA Prasad R. Bauchkar, AIT Vasan Choengsa-ard, AIT Geo-Informatics & Space Technology Asian Institute of Chulalongkorn Development Technology University Agency Introduction • Emerging technologies, Internet, Wireless communication and mobile computing device changing way of using GIS • Growing demand for Internet due to real time information needs • Traditional static GIS became Wireless and operations possible on the fly • Wireless + Mobile Technology Ready-to-Use GIS Issues • Traditional GIS is in static environment -Limitation • GIS analysis should be possible through any browser (no GIS software needed) • Real time GIS needs data acquisition, upload, update and retrieval directly from field • Non-availability of comprehensive system for real time data updating Trend Accessibility Wireless GIS Internet GIS Desktop GIS Mainframe GIS Time Wireless GIS GPRS Network Operator TCP/IP access to GPRS network Internet PDA + GPS +Digital camera +mobile phone Web Server+ Dastabase+ Applications 3-Tiers Architecture Web Application Spatial Data Repository GIS Data PDA Web Browser GPS Autoloading Program Benefits - Open Source Software • • • • • Cut down budget Opportunity for technology exploration On-the-job training and education Prototyping and demo Excellent tools for research and development Minnesota MapServer • • • • Developed at UMN Remote Sensing Lab Funded by NASA “Mission to Planet Earth” Started as Arc/Info AML generation script Built on top of standard Open-source projects like GD, FreeType, Proj.4 and libTIFF, Shapelib • Implemented as a CGI program • Written in ANSI C • Source distribution : UNIX, Window Interfacing with MapServer Spatial Database Offerings • • • • • • • ESRI ArcSDE (on top of several different DBs) Oracle Spatial IBM DB2 Spatial Extender Informix Spatial DataBlade MS SQL Server (with ESRI SDE) Geomedia on MS Access PostGIS / PostgreSQL PostgreSQL/PostGIS = SFSQL Spatial DB • PostGIS spatially enables PostgreSQL by adding spatial objects, functions, and indexing. • PostGIS aims to be an “OpenGIS Simple Features for SQL” compliant spatial database • PostGIS is free software (GPL) • PostGIS follows the OpenGIS Simple Features for SQL • PostGIS is an important component in open and free GIS. • PostGIS is an important building block for all future open source spatial projects. PostgreSQL/PostGIS = SFSQL Spatial DB • Why choose PostgreSQL/PostGIS? – – – – – – – – – No cost (open source) Supports most of the SQL standard Ability to add new data-types No limit on column size Easy to add custom functions One of the only open, respected standards Participation by the major GIS/DB organizations Other spatial DB are at least partially compliant SFSQL provides complex functionality required by Web Feature Server / Web Map Server Wireless Spatial Data Logger Process OUTPUT Shape file PHP GPS + Attribute MapServer Wireless Network SUBMIT DATA Raster file RDBMS PostgreSQL +PostGIS Program GIS Data Web Server Map Viewer Process OUTPUT Shape file PHP Raster file MapServer Wireless Network RDBMS PostgreSQL +PostGIS Program REQUEST GIS Data Web Server Spatial Relational Database Design Hardware Profile Hardware Feature Laser itouch P600 Pocket PC 2002 ipaq 3970 Pocket PC 2002 Compact Flash GPS Inbuilt Antenna GPS Receiver Compact Flash Camera Mobile Device Camera Extension Slot Extension for Compact Flash cards Field Test 1. Locate point of interest 3. View result 2. Submit upload form 4. Query by point Samples of user interaction and available maps Using the tool Field Test Applications Flood Monitoring Forest Fire Farm Management Map Updating Environment Natural disaster and hazard management Tourism nitinkt@ait.ac.th Contact Dr. Nitin K. Tripathi Associate Professor Asian Institute of Technology, Bangkok, Thailand Phone : +66-2-5246392 Email : nitinkt@ait.ac.th Dr.-Ing. Phisan Santitamnont Assistant Professor Survey Engineering Department Chulalongkorn University, Bangkok, Thailand Tel : +66 (0) 2218-6661 E-mail : Phisan.S@eng.chula.ac.th Workshop on Wireless/Handheld Spatial Data Logger Nitin K. Tripathi Phisan Santitamnont Prasad R. Bauchkar Vasan Choengsa-ard Asian Institute of Technology Chulalongkorn University The Asian Federation of Information Technology in Agriculture Introduction Emerging technologies; Internet, Wireless communication and mobile computing device changing way of using GIS Growing demand for Internet due to real time information needs Traditional static GIS became Wireless and operations possible on the fly Wireless + Mobile Technology Ready-to-Use GIS Accessibility Wireless GIS Internet GIS Desktop GIS Mainframe GIS Time Problems Traditional GIS is in static environment GIS analysis should be possible through any browser without GIS software installed Real time GIS needs data acquisition, upload, update and retrieval directly from field. Non availability of system for real time data updating Internet GIS GIS + WWW Internet GIS Similar to the client-server architecture of the web Users can access, manipulate and retrieve GIS data without necessity of GIS software. Thick client (Client) : Display client request. Client Side Thin client ( Server) : Store information and executes client request Server Side Wireless GIS Mobility + Wireless connectivity + GIS = Wireless GIS Inexpensive hardware, standardized communication protocols and innovative software made possible to deploy GIS functionality in a mobile computing environment Provide the facility to extract particular sets of information where it is needed A Simplified Cellular Network Mobile Switching Center Web Hosts/Servers • Wireless Technologies Third Generation (3G) General Packet Radio Service (GPRS) Code Division Multiple Access (CDMA) Wireless Local Area Network (WLAN) • 3G ITU specification for the third generation of mobile communications technology. Bandwidth, up to 384 Kbps when a device is stationary or moving at pedestrian speed, 128 Kbps in a car, and 2 Mbps in fixed applications. Work over wireless air interfaces such as GSM, TDMA, and CDMA. • GPRS Standard for wireless communications Runs at speeds up to 115 kilobits per second • CDMA A digital cellular technology that uses spread-spectrum techniques CDMA does not assign a specific frequency to each user Instead, every channel uses the full available spectrum • WLAN A type of local-area network that uses high-frequency radio waves rather than wires to communicate between nodes Open Source Free to use – no licensing fees Duplicate software and installed on any machine Full Access to source code Highly responsive to end-user requirements • Web Map Service (WMS) Produces maps of georeferenced data Maps are rendered in a pictorial format such as PNG, GIF or JPEG, GetCapabilities (required): Obtain service-level metadata, which is a machine-readable (and human-readable) description of the WMS's information content and acceptable request parameters GetMap (required): Obtain a map image whose geospatial and dimensional parameters are well-defined GetFeatureInfo (optional): Ask for information about particular features shown on a map. • Web Feature Service (WFS) Retrieve geospatial data encoded in Geography Markup Language (GML) from multiple Web Feature Services Support INSERT, UPDATE, DELETE, QUERY and DISCOVERY operations on geographic features using HTTP as the distributed computing platform Client WFS Request WFS Response Web Feature Service (WFS) Minnesota MapServer • Originally developed as free map server software containing various freeware systems - Shapelib, FreeType, Proj.4, libTIFF etc. • Runs under Windows and UNIX operating systems, supports various formats both raster and vector datasets. • Relies on the CGI mode program, Map file and Template file. Library Support GD C library for the dynamic creation of images PNG, JPEG PNG PNG support Proj.4 Cartographic projection library Freetype TrueType font support OGR Simple Features Library, C++ open source library supports vector formats –ESRI Shape files, MapInfo tab, GML, Arc/Info coverage, DGN, PostgreSQL GDAL Translator library supports raster geospatial data formats – TIFF/GeoTIFF, JPEG, Arc/Info Grid, ENVI ESRI header, ERDAS Imagine. Map file • Presented as ASCII file. configures basic information for Minnesota Map Server mechanism such as map’s unit, projection and the path of the data. • Used for object definition. Every mechanism is considered as object in Map file like map object, label object, layer object, projection object, legend object, class object and so forth. Template file • Required for rendering image on user's web browser • HTML file with specially tagged replaceable parameters designated with square brackets. • When the map server receives queries from users, it reads the Template file and generates map objects to reply to the users. The parameters in the square brackets would be replaced by the exact path of the output file. MapServer Using CGI Web Browser CGI-Request (Mapserv) Map File Minnesota MapServer (WMS) HTML Template File PostgreSQL Geodatabase Desired Map Spatial Database The CGI mode program The CGI mode program of Minnesota Map Server is called Mapserv – a component to store all freeware systems. Map Server executable is called directly from CGI mode, and renders the entire HTML page based on parameters passed in the query string, and static configuration files stored on the web server. Map File Example MAP NAME "thai" STATUS ON EXTENT -231930.03916 459597.455047 1673801.76813 2365717.07906 SIZE 500 500 SHAPEPATH "/usr/local/apache/htdocs/Thailand/data/" SYMBOLSET "/usr/local/apache/htdocs/Thailand/etc/symbols.sym" FONTSET "/usr/local/apache/htdocs/Fonts/fonts.list" IMAGECOLOR -1 -1 -1 UNITS METERS IMAGETYPE JPEG WEB TEMPLATE IMAGEPATH IMAGEURL HEADER TEMPLATE FOOTER "/usr/local/apache/htdocs/indice/indice.html" "/usr/local/apache/htdocs/tmp/" "/tmp/" QHead.html main.html QFoot.html LAYER NAME "province" STATUS DEFAULT DATA 'province' TYPE POLYGON UNITS METERS TEMPLATE "QProvince.html" CLASSITEM 'PV_NAME_E' LABELITEM 'PV_NAME_E‘ CLASS NAME "province" COLOR 255 187 169 OUTLINECOLOR 150 98 255 SIZE 1 END END WMS Result PNG, JPEG, GIF Query Map PostgreSQL Object-Relational DBMS Uses a client-server model of communication PostgreSQL can be extended by the user in many ways, for example by adding new Data types Functions Operators Aggregate functions Index methods Procedural languages PostGIS Adds support for geographic objects to the PostgreSQL object-relational database Spatially enables, the PostgreSQL server, allowing it to be used as a backend spatial database for geographic information systems Spatial Data Logger • System Development PostGIS PHP PostgreSQL Minnesota MapServer Spatial Database Client Interface Application Software Data Server Software Profile Software Function Apache Server 2.0.47 HTTP Web Server Minnesota MapServer 4.0 MapServer PostgreSQL 7.3.5 RDBMS PostGIS 0.7.5 PostgreSQL extend PHP 4.3.2 Server Scripting Language Webmin System Administration for Unix Hardware Profile Hardware Feature Laser itouch P600 Pocket PC 2002 ipaq 3970 Pocket PC 2002 Compact Flash GPS Inbuilt Antenna GPS Receiver Compact Flash Camera Mobile Device Camera Extension Slot Extension for Compact Flash cards Prototype Development PostGIS PHP Wireless Network Query PostgreSQL Request HTML Pages Minnesota Mapserver Application Server Web Server GIS Data Data Server • System Flow • CGI interfaces the client’s request with the apache web server which further sends it to PHP compiler. • PHP executes the request by invoking the necessary SQL sentences for updating, uploading and deleting the information into the PostgreSQL/PostGIS database. • The request is now retrieved into the database and ready to display through MapServer. • The PostGIS layer is connected with MapServer through the internal map file configuration providing geo-database access. • PostGIS Layer LAYER # This Layer is connected to the PosetgresSQL database table stationrid by postGIS CONNECTIONTYPE postgis NAME "stationrid" CONNECTION "user=postgres password=star123 dbname=test host=localhost port=5432" DATA "the_geom from stationrid" STATUS ON DUMP TRUE TYPE POINT TOLERANCE 16 TEMPLATE "QStationrid.html" CLASSITEM “stat_name” LABELITEM “stat_name” CLASS SYMBOL 3 COLOR 75 55 200 SIZE 7 LABEL FONT toomtam COLOR 50 255 55 TYPE bitmap SIZE small POSITION AUTO END END END Upload Data Using Open GIS Function <?php $sid = $_GET["ID"]; $sname = $_GET["NAME"]; $lat = $_GET["XX"]; $lon = $_GET["YY"]; $con = pg_connect("host=localhost port=5432 dbname=test user=postgres password=star123"); $res = pg_exec("INSERT INTO stationrid(id,stat_name,the_geom,srid) VALUES($sid,'$sname',GeometryFromText('POINT($lat $lon)',23846),'$sid')"); pg_close($con); ?> Results The prototype is publicly available on the Internet at : http://203.159.10.15/bangkok/user.html Available Actions • Samples of user interaction and available maps Ratchathawi, Bangkok Map Upload Data Query Data PostgreSQL Database Database of Uploaded Points Spatial Data Logger (SDL) SDL Ready to use GIS in real time. Field Verification 1. Locate point of interest 3. View result 2. Submit upload form 4. Query by point Field Test Applications Flood Monitoring Forest Fire Map Updating Environment Natural disaster and hazard management Tourism Cost Estimation • Software No licensing fees for Open Source softwares Freeware Softwares • Hardware Device Cost (Baht) Laser P600 25000 Camera 6500 GPS 8000 Contact Dr. Nitin K. Tripathi Associate Professor Asian Institute of Technology, Bangkok, Thailand Phone : +66-2-5246392 Email : nitinkt@ait.ac.th Dr.-Ing. Phisan Santitamnont Assistant Professor Survey Engineering Department Chulalongkorn University, Bangkok, Thailand Tel : +66 (0) 2218-6661 E-mail : Phisan.S@eng.chula.ac.th