Matt Bertrand. Project Goal Compare expected turnout to actual turnout per voting ward on election day Prioritize last-minute get-out-the vote efforts.

Slides:



Advertisements
Similar presentations
A Roadmap of Open Source components for GI Web Services and Clients A Paul R Cooper MAGIC.
Advertisements

In Production Juan Marin. Agenda Introduction Reliability Availability Performance Data optimizations Runtime optimizations Measuring your environment.
Web GIS Oregon Explorer Marc G Rempel Oregon State University The Valley Library Oregon Explorer
Amazon Web Services (aws) B. Ramamurthy. Introduction  Amazon.com, the online market place for goods, has leveraged the services that worked for their.
© 2010 VMware Inc. All rights reserved Amazon Web Services.
TileMill Quickly and Easily Design Maps for the Web Shaky Sherpa Matt Berg Modi Research Group The Earth Institute. Columbia University.
1 NETE4631 Cloud deployment models and migration Lecture Notes #4.
1. Topics Is Cloud Computing the way to go? ARC ABM Review Configuration Basics Setting up the ARC Cloud-Based ABM Hardware Configuration Software Configuration.
Building an online tool for spatial joins using open source software Karsten Vennemann Seattle.
Development of Java plug-in for Geoserver to read Oracle GeoRaster Data Authors Baskar Dhanapal CoreLogic Bangalore, India Perumal Chinnuswamy CoreLogic.
GTRI_B-1 FalconView for First Responders 2010 FalconView Symposium David Millard & Steve Cuzzort Georgia Tech Research Institute (GTRI) 24 August 2010.
Electrical and Computer Engineering Vitaly Gordievsky Alex Trefonas Scott Richard Matt Beckford Final Project Review.
NREL is a national laboratory of the U.S. Department of Energy Office of Energy Efficiency and Renewable Energy operated by the Alliance for Sustainable.
19 th Advanced Summer School in Regional Science An introduction to GIS using ArcGIS.
Matt Bertrand Building GIS Apps in the Cloud. Infrastructure - Provides computer infrastructure, typically a platform virtualization environment, as a.
Mapserver The Oregon Experience David Percy Geospatial Data Manager, Geology Department Portland State University Digital Mapping Techniques, 2006 Conference.
Nikolay Tomitov Technical Trainer SoftAcad.bg.  What are Amazon Web services (AWS) ?  What’s cool when developing with AWS ?  Architecture of AWS 
Introduction to DoC Private Cloud
Web Feature Service and Web Map Service WATER FOR A HEALTHY COUNTRY FLAGSHIP SISS Workshop v2.3 Pavel Golodoniuc, Josh Vote 8 May 2013.
Amazon EC2 Quick Start adapted from EC2_GetStarted.html.
Web Design Basic Concepts.
A Brief Overview by Aditya Dutt March 18 th ’ Aditya Inc.
OCLC Online Computer Library Center CONTENTdm Migration Training Craig Yamashita Vice President, Technology and Product Development DiMeMa, Inc. July 2005.
Customized cloud platform for computing on your terms !
GeoNode Installation and Configuration
GIS technologies and Web Mapping Services
Cloud Computing. What is Cloud Computing? Cloud computing is a model for enabling convenient, on-demand network access to a shared pool of configurable.
Accessing the Amazon Elastic Compute Cloud (EC2) Angadh Singh Jerome Braun.
HTML+JavaScript M2M Applications Viewbiquity Public hybrid cloud platform for automating and visualizing everything.
Web Programming: Client/Server Applications Server sends the web pages to the client. –built into Visual Studio for development purposes Client displays.
David Blasby The Open Planning Project New York. Goals Explain what a WFS and WMS are, and when to use them Be able to create simple spatial web applications.
An Introduction To Building An Open Standard Web Map Application Joe Daigneau Pennsylvania State University.
Cloud Computing & Amazon Web Services – EC2 Arpita Patel Software Engineer.
Webscale Computing Mike Culver Amazon Web Services.
Tutorial: Using ArcGIS Server and ESRI ArcGIS API for Javascript Peter Sforza March 7, 2013.
The 2000 Decennial Census School District Project: Using Census Data for the School District Mapping System **** Development and Implementation Tai A.
Best Practices for Designing Effective Map Services Tanu Hoque.
Development of Dynamic SLD and Understanding WCS Using Geo-server Supervisor Prof N.L Sarda Dept. of Computer Science & Engg. IIT-Bombay Bharti M.Tech.
Exploring Spatial Data Infrastructure in an Open Source World Jacqueline Lowe UNC-Asheville National Environmental Modeling and Analysis Center Jacqueline.
A GeoSpatial Mapping Architecture
Dean Anderson Polk County, Oregon GIS in Action 2014 Modifying Open Source Software (A Case Study)
Web Design and Development. World Wide Web  World Wide Web (WWW or W3), collection of globally distributed text and multimedia documents and files 
Cloud Computing is a Nebulous Subject Or how I learned to love VDF on Amazon.
AWS Usage Tips SCS APAC MAR Agenda About Amazon Web Service Sign up the AWS account AWS Management Oracle Apps AMI – Siebel CRM – EBS R
Introduction TO Network Administration
©2010 AIR WORLDWIDE 1 Using ArcGIS Server Web Map Services in Web Map Mash-Ups Benjamin Spaulding, Ph.D. AIR Worldwide Esri Boston Dev Meet-Up 12/8/2010.
Guofeng Cao CyberInfrastructure and Geospatial Information Laboratory Department of Geography National Center for Supercomputing Applications (NCSA) University.
Launch Amazon Instance. Amazon EC2 Amazon Elastic Compute Cloud (Amazon EC2) provides resizable computing capacity in the Amazon Web Services (AWS) cloud.
Uploading Data Matthew Hanson  GeoNode made up of several components  Web Framework – Django  OGC Server – GeoServer  Database – PostGIS.
MARPLOT: Building a Desktop GIS for Emergency Response from FOSS Components May 3, 2016 Michael Katz, Software Engineer 6/12/20161.
GeoServer Prof. Wenwen Li School of Geographical Sciences and Urban Planning 5644 Coor Hall
Creating and Sharing Geospatial Data January 28, 2010 presentation to the Bedford Institute of Oceanography Geographic Information Systems Special Interest.
OpenLayers Prof. Wenwen Li School of Geographical Sciences and Urban Planning 5644 Coor Hall
© 2015 MetricStream, Inc. All Rights Reserved. AWS server provisioning © 2015 MetricStream, Inc. All Rights Reserved. By, Srikanth K & Rohit.
Amazon Web Services. Amazon Web Services (AWS) - robust, scalable and affordable infrastructure for cloud computing. This session is about:
INTRODUCTION TO AMAZON WEB SERVICES (EC2). AMAZON WEB SERVICES  Services  Storage (Glacier, S3)  Compute (Elastic Compute Cloud, EC2)  Databases (Redshift,
A Web Based Job Submission System for a Physics Computing Cluster David Jones IOP Particle Physics 2004 Birmingham 1.
Flood Map Library MD. M. HAQUE DWR-HYDROLOGY. Building a Flood Map Library Indexing existing flood maps and geospatial data for search and retrieval Separate.
SEMINAR ON.  OVERVIEW -  What is Cloud Computing???  Amazon Elastic Cloud Computing (Amazon EC2)  Amazon EC2 Core Concept  How to use Amazon EC2.
Course: Cluster, grid and cloud computing systems Course author: Prof
Understanding and Improving Server Performance
Amazon Web Services (aws)
Web Services application that operates over a network
Introduction to PHP FdSc Module 109 Server side scripting and
Platform as a Service.
Web Based Spatial Decision Support System for Western Ghats
AWS COURSE DEMO BY PROFESSIONAL-GURU. Amazon History Ladder & Offering.
Lecture 1: Multi-tier Architecture Overview
Electronic Field Study Advanced User Training
Building an online tool for spatial joins using open source software
Presentation transcript:

Matt Bertrand

Project Goal Compare expected turnout to actual turnout per voting ward on election day Prioritize last-minute get-out-the vote efforts. Assess reliability of expected turnout estimates. Analyze effectiveness of campaign’s get-out-the vote effort.

Requirements Enter, edit, and view expected and actual votes cast per ward Display data on a map and table simultaneously Import and export vote data Click a ward on the map to bring up its data for editing/viewing Click a ward in the table to zoom in & highlight that ward on map Refresh map as soon as data is edited

Requirements Choose between displaying expected turnout, actual turnout and expected:actual turnout ratio on the map Automatically calculate ratio from entered data Security: require login to the site. Two separate login accounts - one for editing, one for viewing only Support ??? users (scalable).

Components Virtual Server Machines Amazon Web Services Open Source GIS tools PostgreSQL & PostGIS OpenLayers GeoServer Other Open Source Tools Apache web server Tomcat Java application server PHP DataGrid

Amazon Web Services Elastic Compute Cloud (EC2) Provides resizable computing capacity Designed to make web-scale computing easy & accessible to developers Create and use “Amazon Machine Images” (AMI) Virtual server machines Many templates available Choose your operating system (Linux, Windows) Choose your horsepower (RAM, processor, etc).

Amazon Web Services Elastic Block Store Persistent storage for Amazon EC2 instances (AMI’s). Ideal for databases Easily switch an EBS from one AMI to another Use to swap database from a small AMI to a faster, more powerful AMI

PostgreSQL and PostGIS PostgreSQL Relational database system PostGIS Spatial objects for PostgreSQL Store, query, and manipulate spatial data objects

GeoServer Open source geospatial server Written in Java and the J2EE platform Includes a graphical user interface for configuration Web Mapping Service Web Feature Service

Web Map & Feature Services Web Mapping Service (WMS) Request: specifies the geographic layer(s) and area of interest to be processed. Response: returns geo-registered map images (JPEG, PNG, etc), and/or layer attributes. Web Feature Service (WFS) Request: specifies the geographic layer(s) and feature subset of interest based on spatial and/or non-spatial queries Response: return description and/or attributes of the specified layer features. Also capable of updating, creating, and deleting features

OpenLayers JavaScript library for displaying map data Provides an API (Application Programming Interface) for building web-based geographic applications. Makes use of map “tiles” Pre-rendered small sections of map, improves performance Can load data from many sources: Google Maps, Yahoo Maps, Virtual Earth GeoServer, MapServer Any Web Map Service or Web Feature Service

PHP DataGrid Free data-bound grid control written in PHP View, edit, and export data Customizable – select which database fields to display, turn editing on/off for each field, etc.

Putting it all together AWS GeoServer OpenLayers Apache/ Tomcat PostGIS ? = PHP DataGrid

Architectural Overview Client ServersData PostgreSQL/ PostGIS GeoServer WMS Request WFS Request Apache Web Server Standard Web Request Amazon Web Services Tomcat OpenLayers

AWS Scalability Data PostGreSQL GeoServer Apache Data PostGreSQLGeoServer Apache EBS Small AMI EBS X-Large AMI Light Load SetupPotential Heavy Load Setup Small AMI: 1.7 GB RAM 1 32-bit Virtual Core = 1 EC2 Compute Unit Extra Large AMI: 15 GB RAM 4 64-bit Virtual Cores = 8 EC2 Compute Units

AWS Setup 1. Register for an account Not free - cost is based on use of AMI’s and storage ~ $2/day for a small running AMI instance 2. Pick a management console ElasticFox addon for Firefox Amazon now provides its own online console Manage AMI and EBS instances

AWS Setup 3. Select and start an AMI Operating System: Ubuntu Linux Size: small instance (1.7 GB RAM, 160 GB drive, 1 virtual CPU equivalent to 32-bit 1.2 GHz Intel Xeon) 4. Log in to the AMI using SSH (secure shell) 5. Install and configure required software Tomcat, Apache, Apache-Tomcat Connector, GeoServer, PostgreSQL, PostGIS, PHP

AWS Setup 6. Create an Elastic Block Store (EBS) 1 GB – plenty enough to hold NH ward data Maximum size: 1 TB 7. Attach the EBS to the running AMI instance 8. Mount the EBS as a volume 9. Create a PostGIS database on the mounted volume

Database Setup A GIS shapefile of ward boundaries was provided by the NH campaign staff The shapefile was imported into PostgreSQL using a built- in PostGIS command (shp2pgsql) Added new fields (turnout_expected, turnout_actual, turnout_ratio) Created indexes Created a trigger to automatically calculate the ratio whenever expected or actual turnout values changed

Database Setup PostgreSQL UPDATE trigger CREATE OR REPLACE FUNCTION updateratio() RETURNS trigger AS IF NEW.turnout_expected > 0 THEN NEW.turnout_ratio = NEW.turnout_actual / NEW.turnout_expected; ELSE NEW.turnout_ratio = 0; END IF; RETURN NEW;

GeoServer Configuration Create a new DataStore Stores connection information on PostgreSQL database Create a new FeatureType Stores information on a geographic vector feature stored in the database (projection, boundaries, fields, etc). Create Styled Layer Descriptors XML format for specifying how to draw features on a map

SLD Rule Example turnout_ratio #FF6F00 1 #6E6E6E 0.4 1

Web Page Layout Requirement: Display map and table/grid simultaneously Map PHP DataGrid page (gridedit.php) Main page (index.html)

OpenLayers Requirement: Display ward data on a map var wmsnh = new OpenLayers.Layer.WMS("NH Wards 4326", “ { layers: 'topp:nh_wards4326', styles: sld, srs: 'EPSG:4326', format: 'image/png', tiled: true, transparent: true }, { 'opacity': 0.75, 'isBaseLayer': false });

OpenLayers Requirement: Click a ward on the map to bring up its data to edit/view map.events.register('click', map, function(e) { var url = "/geoserver/wfs?request=GetFeature&version=1.0.0&typeName=topp: nh_wards4326&outputFormat=json&FILTER=%3CFilter%20xmlns=%22http :// /gml%22%3E%3CIntersects%3E%3CPropertyName%3Ethe_geom%3C/Propert yName%3E%3Cgml:Point%20srsName=%22EPSG:4326%22%3E%3Cgml:coordin ates%3E" + lonlatGCS.lon + "," + lonlatGCS.lat + "%3C/gml:coordinates%3E%3C/gml:Point%3E%3C/Intersects%3E%3C/Fil ter%3E"; OpenLayers.loadURL(url, '', this, getGridPage); OpenLayers.Event.stop(e); });

OpenLayers WFS Request the_geom , 40.25

OpenLayers JSON (JavaScript Object Notation) GeoJSON: JSON for geographic data { "type": "FeatureCollection", "features": [ { "type": "Feature", "id": "nh_wards ", "properties": { "objectid": 48, "fips": 7160, "name": "Pittsburg", "twn_ward": null, "ncec_code": " ", "turnout_expected": 3000, "turnout_actual": 1000, "turnout_ratio": 0.33, }, "geometry": { "type": "MultiPolygon", "coordinates": ………… } ] }

OpenLayers Requirement: Highlight selected feature on map First, create a highlight style and empty vector layer var highlight_style = { strokeColor: 'Red', strokeWidth: 4, strokeOpacity: 1, fillOpacity: 0.0 }; //Add highlight vector layer for selected features hilites = new OpenLayers.Layer.Vector("Highlighted", { isBaseLayer: false, features: [], visibility: true, style: highlight_style });

OpenLayers Add the selected feature to the ‘Highlighted’ vector layer function highlightFeature(req) { var features = new OpenLayers.Format.GeoJSON(out_options).read(req.responseText); // have the Vector layer purge its feature list, replace them with the new one hilites.destroyFeatures(); hilites.addFeatures(features); hilites.setVisibility(true); }

OpenLayers Requirement:Click a ward in the table to zoom in & highlight on map function highlightFeature(req) { … if (zoomOnSelect) { bounds = features[0].geometry.getBounds(); map.zoomToExtent(bounds); }

OpenLayers Requirement: switch between maps of actual turnout, expected turnout, and turnout ratio function changeSLD(sldChosen) { saveBounds(); sld = sldChosen; init(); document.getElementById("legendImg").src = '/geoserver/wms?REQUEST=GetLegendGraphic&VERSION= 1.0.0&FORMAT=image/png&WIDTH=100&HEIGHT=20&LAYER= topp:nh_wards4326&sld=/geoserver/styles/' + sld + '.sld'; }

Data Import Requirement: Import voter turnout data from an external file into the database. Comma-delimited text file NCEC Code, expected turnout, actual turnout

Data Import PHP import code snippet $handle = fopen($uploadfile, "r"); while (($data = fgetcsv($handle)) !== FALSE) { $result = pg_prepare($connection, "update". $data[0], 'UPDATE nh_wards SET turnout_expected = $2, turnout_actual=$3 WHERE ncec_code = $1'); $result = pg_execute($connection, "update". $data[0], array($data[0],$data[1],$data[2])); } fclose($handle);

Security Requirement: Login with password to enter site Two login roles – edit and view Logins and passwords stored in ‘users’ table in database PHP code used to validate user input against database values User forwarded to either data edit page or view page depending on login role.

Final Step Bundle the AMI Saves current AMI setup as a new template New AMI’s based on this template will be identical with all software installed and configured. Avoid having to reinstall PostgreSQL, Geoserver, etc. all over again whenever a new instance is created.

Development Cost & Effort Cost: $ Amazon EC2 instance: $ Amazon EBS storage: $0.26 Time: 4 weeks ~ 100 hours total Energy:

Resources Amazon Web Services – aws.amazon.com GeoServer – geoserver.org OpenLayers – openlayers.org PostGIS - postgis.refractions.net PostgreSQL – postgresql.org Demo – openwebmap.com/votemap