Python Geospatial Development

Total Page:16

File Type:pdf, Size:1020Kb

Python Geospatial Development Python Geospatial Development Build a complete and sophisticated mapping application from scratch using Python tools for GIS development Erik Westra BIRMINGHAM - MUMBAI Python Geospatial Development Copyright © 2010 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. First published: December 2010 Production Reference: 1071210 Published by Packt Publishing Ltd. 32 Lincoln Road Olton Birmingham, B27 6PA, UK. ISBN 978-1-849511-54-4 www.packtpub.com Cover Image by Asher Wishkerman ([email protected]) Credits Author Editorial Team Leader Erik Westra Mithun Sehgal Reviewers Project Team Leader Tomi Juhola Priya Mukherji Silas Toms Project Coordinator Acquisition Editor Jovita Pinto Steven Wilding Proofreader Development Editor Jonathan Todd Hyacintha D'Souza Graphics Technical Editor Nilesh R. Mohite Kartikey Pandey Production Coordinator Indexers Kruthika Bangera Hemangini Bari Cover Work Tejal Daruwale Kruthika Bangera About the Author Erik Westra has been a professional software developer for over 25 years, and has worked almost exclusively in Python for the past decade. Erik's early interest in graphical user-interface design led to the development of one of the most advanced urgent courier dispatch systems used by messenger and courier companies worldwide. In recent years, Erik has been involved in the design and implementation of systems matching seekers and providers of goods and services across a range of geographical areas. This work has included the creation of real-time geocoders and map-based views of constantly changing data. Erik is based in New Zealand, and works for companies worldwide. "For Ruth, The love of my life." About the Reviewers Tomi Juhola is a software development professional from Finland. He has a wide range of development experience from embedded systems to modern distributed enterprise systems in various roles, such as tester, developer, consultant, and trainer. Currently, he works in a company called Lindorff and shares this time between development lead duties and helping other projects to adopt Scrum and agile methodologies. He likes to spend his free time with new and interesting development languages and frameworks. Silas Toms is a GIS Analyst for ICF International, working at the San Francisco and San Jose offices. His undergraduate degree is in Geography (from Humboldt State University), and he is currently finishing a thesis for an MS in GIS at San Francisco State University. He has been a GIS professional for four years, working with many local and regional governments before taking his current position. Python experience was gained through classes at SFSU and professional experience. This is the first book he has helped review. I would like to thank everyone at Packt Publishing for allowing me to help review this book and putting up with my ever-shifting schedule. I would also like to thank my family for being supportive in my quest to master this somewhat esoteric field, and for never asking if I am going to teach with this degree. www.PacktPub.com Support files, eBooks, discount offers and more You might want to visit www.PacktPub.com for support files and downloads related to your book. Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub. com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details. At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on Packt books and eBooks. http://PacktLib.PacktPub.com Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read, and search across Packt's entire library of books. Why Subscribe? • Fully searchable across every book published by Packt • Copy and paste, print, and bookmark content • On demand and accessible via web browser Free Access for Packt account holders If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access. Table of Contents Preface 1 Chapter 1: Geo-Spatial Development Using Python 7 Python 7 Geo-spatial development 9 Applications of geo-spatial development 11 Analyzing geo-spatial data 12 Visualizing geo-spatial data 13 Creating a geo-spatial mash-up 16 Recent developments 17 Summary 19 Chapter 2: GIS 21 Core GIS concepts 21 Location 22 Distance 25 Units 27 Projections 28 Cylindrical projections 29 Conic projections 31 Azimuthal projections 31 The nature of map projections 32 Coordinate systems 32 Datums 35 Shapes 36 GIS data formats 37 Working with GIS data manually 39 Summary 46 Table of Contents Chapter 3: Python Libraries for Geo-Spatial Development 47 Reading and writing geo-spatial data 47 GDAL/OGR 48 GDAL design 48 GDAL example code 50 OGR design 51 OGR example code 52 Documentation 53 Availability 53 Dealing with projections 54 pyproj 54 Design 54 Proj 55 Geod 56 Example code 57 Documentation 58 Availability 58 Analyzing and manipulating geo-spatial data 59 Shapely 59 Design 60 Example code 61 Documentation 62 Availability 62 Visualizing geo-spatial data 63 Mapnik 63 Design 64 Example code 66 Documentation 67 Availability 68 Summary 68 Chapter 4: Sources of Geo-Spatial Data 71 Sources of geo-spatial data in vector format 72 OpenStreetMap 72 Data format 73 Obtaining and using OpenStreetMap data 74 TIGER 76 Data format 77 Obtaining and using TIGER data 78 Digital Chart of the World 79 Data format 80 Available layers 80 Obtaining and using DCW data 80 [ ii ] Table of Contents GSHHS 82 Data format 83 Obtaining the GSHHS database 84 World Borders Dataset 84 Data format 85 Obtaining the World Borders Dataset 85 Sources of geo-spatial data in raster format 85 Landsat 86 Data format 86 Obtaining Landsat imagery 87 GLOBE 90 Data format 90 Obtaining and using GLOBE data 91 National Elevation Dataset 92 Data format 92 Obtaining and using NED data 93 Sources of other types of geo-spatial data 94 GEOnet Names Server 94 Data format 95 Obtaining and using GEOnet Names Server data 95 GNIS 96 Data format 97 Obtaining and using GNIS data 97 Summary 98 Chapter 5: Working with Geo-Spatial Data in Python 101 Prerequisites 101 Reading and writing geo-spatial data 102 Task: Calculate the bounding box for each country in the world 102 Task: Save the country bounding boxes into a Shapefile 104 Task: Analyze height data using a digital elevation map 108 Changing datums and projections 115 Task: Change projections to combine Shapefiles using geographic and UTM coordinates 115 Task: Change datums to allow older and newer TIGER data to be combined 119 Representing and storing geo-spatial data 122 Task: Calculate the border between Thailand and Myanmar 123 Task: Save geometries into a text file 126 Working with Shapely geometries 127 Task: Identify parks in or near urban areas 128 Converting and standardizing units of geometry and distance 132 Task: Calculate the length of the Thai-Myanmar border 133 Task: Find a point 132.7 kilometers west of Soshone, California 139 [ iii ] Table of Contents Exercises 141 Summary 143 Chapter 6: GIS in the Database 145 Spatially-enabled databases 145 Spatial indexes 146 Open source spatially-enabled databases 149 MySQL 149 PostGIS 152 Installing and configuring PostGIS 152 Using PostGIS 155 Documentation 157 Advanced PostGIS features 157 SpatiaLite 158 Installing SpatiaLite 158 Installing pysqlite 159 Accessing SpatiaLite from Python 160 Documentation 160 Using SpatiaLite 161 SpatiaLite capabilities 163 Commercial spatially-enabled databases 164 Oracle 164 MS SQL Server 165 Recommended best practices 165 Use the database to keep track of spatial references 166 Use the appropriate spatial reference for your data 168 Option 1: Use a database that supports geographies 169 Option 2: Transform features as required 169 Option 3: Transform features from the outset 169 When to use unprojected coordinates 170 Avoid on-the-fly transformations within a query 170 Don't create geometries within a query 171 Use spatial indexes appropriately 172 Know the limits of your database's query optimizer 173 MySQL 174 PostGIS 175 SpatiaLite 177 Working with geo-spatial databases using Python 178 Prerequisites 179 Working with MySQL 179 Working with PostGIS 182 Working with SpatiaLite 184 Speed comparisons 188 Summary 189 [ iv ] Table of Contents Chapter 7: Working with Spatial Data 191 About DISTAL 191 Designing and building the database 195 Downloading the data 199 World Borders Dataset
Recommended publications
  • “Web Development Using Python” 01 April 2021
    A Report on the Webinar “Web development using Python” 01 April 2021 Organized by ‘Anacron’, Students association of the Department of Computer Science and Engineering, Akshaya College of Engineering and Technology A webinar, “Web development using Python” was organized by the students’ association, ‘Anacron’ of the department of Computer Science and Engineering, on 1-4-21. A brief report of the same is given below. WELCOME ADDRESS: Welcome address was given by Dr. N. Rajkumar, HOD/CSE, ACET. INTRODUCTION OF CHIEF GUEST Ms. J. Rajichellam completed her UG degree B.E CSE in Madurai Institute of Engineering and Technology. She is having certificates of proficiency in C, C++, HTML5, CSS, Javascript, Jquery, etc.,. She is having more than 6 years of industrial experience and currently working as Technical trainer in Elysium Academy. CHIEF GUEST PRESENTATION: Ms. J. Rajichellam started her presentation with a brief note about the future for Web development using python and then explained about the career opportunities in Python. She also explained as to why students should be well versed in python. She also urged the students to have a goal for their career and for that they should envisage a plan. She opined that without a plan they can’t achieve success. She said, Web development is an umbrella term for conceptualizing, creating, deploying and operating web applications and application programming interfaces for the web. She basically gave explanation for three topics. 1. Why is web development important? The web has grown a mindboggling amount in the number of sites, users and implementation capabilities since the first website went live in 1989.
    [Show full text]
  • A Language for Functional Web Programming
    A language for functional web programming Bachelor of Science thesis Anton Ekblad University of Gothenburg Chalmers University of Technology Department of Computer Science and Engineering Göteborg, Sweden, October 2011 The Author grants to Chalmers University of Technology and University of Gothenburg the non-exclusive right to publish the Work electronically and in a non-commercial purpose make it accessible on the Internet. The Author warrants that he/she is the author to the Work, and warrants that the Work does not contain text, pictures or other material that violates copyright law. The Author shall, when transferring the rights of the Work to a third party (for example a publisher or a company), acknowledge the third party about this agreement. If the Author has signed a copyright agreement with a third party regarding the Work, the Author warrants hereby that he/she has ob- tained any necessary permission from this third party to let Chalmers Uni- versity of Technology and University of Gothenburg store the Work electron- ically and make it accessible on the Internet. A language for functional web programming Anton Ekblad © Anton Ekblad, October 2011. Examiner: Koen Lindström Claessen University of Gothenburg Chalmers University of Technology Department of Computer Science and Engineering SE-412 96 Göteborg Sweden Telephone + 46 (0)31-772 1000 Department of Computer Science and Engineering Göteborg, Sweden October 2011 Abstract Computer programs are by far the most complex artifacts ever produced by humanity, and they get more complex year by year. As complexity grows, so does the need for better tools and higher level abstractions.
    [Show full text]
  • RDF-REST: a Unifying Framework for Web Apis and Linked Data Pierre-Antoine Champin
    RDF-REST: A Unifying Framework for Web APIs and Linked Data Pierre-Antoine Champin To cite this version: Pierre-Antoine Champin. RDF-REST: A Unifying Framework for Web APIs and Linked Data. Ser- vices and Applications over Linked APIs and Data (SALAD), workshop at ESWC, May 2013, Mont- pellier (FR), France. pp.10-19. hal-00921662 HAL Id: hal-00921662 https://hal.archives-ouvertes.fr/hal-00921662 Submitted on 20 Dec 2013 HAL is a multi-disciplinary open access L’archive ouverte pluridisciplinaire HAL, est archive for the deposit and dissemination of sci- destinée au dépôt et à la diffusion de documents entific research documents, whether they are pub- scientifiques de niveau recherche, publiés ou non, lished or not. The documents may come from émanant des établissements d’enseignement et de teaching and research institutions in France or recherche français ou étrangers, des laboratoires abroad, or from public or private research centers. publics ou privés. RDF-REST: A Unifying Framework for Web APIs and Linked Data Pierre-Antoine Champin ⋆⋆ LIRIS , Universit´eClaude Bernard Lyon 1, [email protected], Abstract. There has been a lot of efforts to bridge the gap between web APIs and linked data. The RDF-REST framework, that we developed in the process of building a RESTful service using linked data, is part of them. This paper presents the approach adopted in the RDF-REST framework, and show its benefits in the design and use of web APIs. One of these benefits is an easy integration of existing APIs with each other and with linked data.
    [Show full text]
  • A Web Application Framework for Stage Final Report
    Swan A Web Application Framework for Stage Final Report Fred van den Driessche Imperial College June 14, 2010 Supervisor: Susan Eisenbach Second Marker: Tony Field ♠ Abstract Last year's release of Google Wave enforced an increasingly strong trend of feature-filled, highly inter- active Web applications with Web browsers acting as a thin client. The enhanced execution speed of JavaScript allows the creation of browser-based applications which rival traditional desktop applications in their responsiveness and usability. Such applications eschew rendering the entire page beyond the initial download instead relying on partial interface updates using data from background requests. How- ever, the development of such applications requires a very different style compared to traditional Web applications and varying implementations of JavaScript across browsers makes it hard for developers to create them. Established Web frameworks such as Django tend to focus on the creation of traditional Web applica- tions and often rely on third-party JavaScript libraries for the provision of highly interactive features. Google Web Toolkit concentrates on the creation of an interactive user interface but leaves the implementation of data storage to the user, while Lift provides an Actor-based solution to the problem of scaling to meet the server requirements for such interactivity. This report introduces Swan, a Web application framework based on Stage, a scalable, distributed, Actor language with clean, concise and expressive syntax. Swan uses these features to create a full MVC framework through which users can develop highly responsive, scalable Web applications in a single high-level language. Acknowledgements First and foremost I would like to thank Susan Eisenbach, without whom Swan would simply be an ugly duckling.
    [Show full text]
  • Functional Programming in Javascript Table of Contents
    Functional Programming in JavaScript Table of Contents Functional Programming in JavaScript Credits About the Author About the Reviewers www.PacktPub.com Support files, eBooks, discount offers and more Why Subscribe? Free Access for Packt account holders Preface What this book covers What you need for this book Who this book is for Conventions Reader feedback Customer support Downloading the example code Errata Piracy Questions 1. The Powers of JavaScript’s Functional Side – a Demonstration Introduction The demonstration The application – an e-commerce website Imperative methods Functional programming Summary 2. Fundamentals of Functional Programming Functional programming languages What makes a language functional? Advantages Cleaner code Modularity Reusability Reduced coupling Mathematically correct Functional programming in a nonfunctional world Is JavaScript a functional programming language? Working with functions Self-invoking functions and closures Higher-order functions Pure functions Anonymous functions Method chains Recursion Divide and conquer Lazy evaluation The functional programmer’s toolkit Callbacks Array.prototype.map() Array.prototype.filter() Array.prototype.reduce() Honorable mentions Array.prototype.forEach Array.prototype.concat Array.prototype.reverse Array.prototype.sort Array.prototype.every and Array.prototype.some Summary 3. Setting Up the Functional Programming Environment Introduction Functional libraries for JavaScript Underscore.js Fantasy Land Bilby.js Lazy.js Bacon.js Honorable mentions Development and
    [Show full text]
  • Using Javascript and Webcl for Numerical Computations: a Comparative Study of Native and Web Technologies
    McGill University School of Computer Science Sable Research Group Using JavaScript and WebCL for Numerical Computations: A Comparative Study of Native and Web Technologies Sable Technical Report No. sable-2014-06 Faiz Khan Vincent Foley-Bourgon Sujay Kathrotia Erick Lavoie Laurie Hendren 08-Jun-2014 www.sable.mcgill.ca Contents 1 Introduction 4 2 Background 5 2.1 JavaScript . 5 2.2 Asm.js . 6 2.3 Emscripten . 6 2.4 OpenCL . 6 2.5 WebCL . 6 3 Ostrich - an extended benchmark suite 7 3.1 Thirteen Dwarfs . 7 3.2 Rodinia and OpenDwarfs . 8 3.3 Ostrich . 8 4 Methodology 10 4.1 Research questions . 11 4.2 Experimental set-up . 12 4.3 Measurements . 13 5 Sequential Results 13 5.1 JavaScript and asm.js vs C . 13 5.2 Arrays vs Typed Arrays . 15 5.3 JavaScript vs asm.js . 17 5.4 Other Observations . 20 5.5 Summary . 20 6 Parallel Results 20 6.1 WebCL Parallel Performance Against Sequential JavaScript . 20 6.2 WebCL Specific Performance . 22 6.3 Other Performance Observations . 23 6.4 WebCL Limits and Caveats . 24 6.5 Summary . 24 7 Related Work 25 1 8 Conclusions and future work 26 A Sequential time data 27 A.1 Sequential results . 27 A.2 Parallel results . 28 2 List of Figures 1 JavaScript and asm.js vs C on Desktop . 14 2 JavaScript and asm.js vs C on MacBook Air . 16 3 Typed arrays vs regular arrays . 18 4 Asm.js vs JavaScript . 19 5 Parallel performance of WebCL and OpenCL .
    [Show full text]
  • Introduction to Python 3
    Introduction to Python 3 Chang Y. Chung Office of Population Research 01/14/2014 I slow. Shh I Python is . 1 / 23 Shh I Python is . I slow. 1 / 23 I Although you can re-write the above and make it run almost, but not quite, as fast. 1 print sum([1000 * i fori in xrange(1000)]) 2 # 499950000000 Python is slow I A tight loop like below runs 10 to 100 (or more) times slower than C or java. 1 total = 0 2 fori in range(1000): 3 forj in range(1000): 4 total += i# how many times this statement runs? 5 6 print total 7 # 499950000000 2 / 23 Python is slow I A tight loop like below runs 10 to 100 (or more) times slower than C or java. 1 total = 0 2 fori in range(1000): 3 forj in range(1000): 4 total += i# how many times this statement runs? 5 6 print total 7 # 499950000000 I Although you can re-write the above and make it run almost, but not quite, as fast. 1 print sum([1000 * i fori in xrange(1000)]) 2 # 499950000000 2 / 23 Why is Python slow I Interpreted, not compiled. I Almost no automatic optimization. I High-level, versatile programming constructs tend to be larger, more complicated, and slower. I A simple piece of code may have a huge performance implication. e.g. range(1000) creates and returns a 1000-element list every time it is called. 3 / 23 Why Python is not slow I Faster programming constructs (e.g., xrange() vs.
    [Show full text]
  • Django Mediagenerator Documentation Release 1.11
    Django Mediagenerator Documentation Release 1.11 Potato London, AllButtonsPressed, Alokin Software May 24, 2016 Contents 1 Reference 3 1.1 settings..................................................3 1.2 Templatetags...............................................5 1.3 Filter and Generators...........................................6 2 Tutorials 11 3 FAQ 13 3.1 Q: How does it relate to django-staticfiles / django.contrib.staticfiles?................. 13 3.2 Q: What are the perfect caching headers?................................ 13 3.3 Tip: How to include IE-specific stylesheets............................... 13 i ii Django Mediagenerator Documentation, Release 1.11 Improve your user experience with amazingly fast page loads by combining, compressing, and versioning your JavaScript & CSS files and images. django-mediagenerator eliminates unnecessary HTTP requests and maximizes cache usage. Also, it provides lots of advanced features required for building HTML5 web applications (e.g. HTML5 offline manifests, Sass support, etc.). Take a look at the feature comparison for a quick overview and if you like django-mediagenerator please click the I use this! button on that page. Thank you! Django mediagenerator lives on GitHub (downloads, source code and bug tracking). Contents 1 Django Mediagenerator Documentation, Release 1.11 2 Contents CHAPTER 1 Reference 1.1 settings 1.1.1 MEDIA_BUNDLES This defines all JavaScript and CSS bundles as a list of tuples where the first tuple entry denotes the bundle output name and the following tuple entries denote the input file names: MEDIA_BUNDLES=( ('main.css', # bundle name # input files 'css/reset.css', 'css/design.css', ), ('main.js', 'js/jquery.js', 'js/jquery.autocomplete.js', ), ) Internally, all input file names are converted to filters. Instead of file names you can also be more explicit and specify filters as dicts: MEDIA_BUNDLES=( ('main.css', {'filter':'mediagenerator.generators.bundles.base.FileFilter', 'name':'css/reset.css'}, {'filter':'mediagenerator.generators.bundles.base.FileFilter', 'name':'css/design.css'}, ), # ..
    [Show full text]
  • Web 2.0 Et Clients Riches
    Web 2.0 et clients riches Panorama et outils Nadir BOUSSOUKAIA v2010 SOMMAIRE 1. Introduction: L'evolution du Web 2. Le Socle technique du Web Les protocoles du Web 3. Client lourd, client Léger Architectures client/serveur multi-tiers 4. Client Riche 5. Les clients riches RIA 6. Les clients riches RDA 2 Introduction L'evolution du Web, le Web 2.0 3 Le web 2.0 c‟est quoi? Une évolution majeure du Web et de ses pratiques Le Web passe d‟une collection de sites web à une plate-forme informatique à part entière qui fournit des applications aux utilisateurs Une expression « marketing » à la mode lancée par Dale Dougherty de O'Reilly dès 2003 qui a fait du buzz à partir de 2005 avec l‟article fondateur « What Is Web 2.0 » lors d‟une conférence L’idée: les pages web permettent aux internautes d‟agir sur le contenu et la structure des pages mais aussi d‟interagir entre eux Sans connaissances techniques La Simplicité doit être la règle (pages dépouillées et ergonimie) Ref: http://oreilly.com/web2/archive/what-is-web-20.html Version francaise: http://web2rules.blogspot.com/2006/01/what-is-web-20-par-tim-oreilly-version.html 4 Le web 2.0 c‟est quoi? RSS (Rich Site Summary) Blogs & wiki Wikipedia! start pages (RSS, calendrier,notes..) Netvibes My Yahoo!, iGoogle, Microsoft Live del.icio.us: bookmarks (signets) Partage de bookmarks classer selon le principe de folksonomie par des mots clés (ou tags) et ainsi créer des nuages de mots clefs http://delicious.com/tag/ Flickr, stockage massif de photos Le classement se fait, non en rangeant la photo dans une arborescence, mais en lui associant un ou plusieurs mots-clés http://www.flickr.com/photos/tags/ social networking MySpace, Facebook Twitter(3 ans), WAYN (where are you now) hi5, last.fm LinkedIn, Viadeo, Trombi.com Video YouTube, dailymotion Applications Google Agenda, docs, RTM..
    [Show full text]
  • Django Mediagenerator Documentation Release 1.11
    Django Mediagenerator Documentation Release 1.11 Potato London, AllButtonsPressed Oct 03, 2017 Contents 1 Reference 3 1.1 settings..................................................3 1.2 Templatetags...............................................5 1.3 Filter and Generators...........................................6 2 Tutorials 11 3 FAQ 13 3.1 Q: How does it relate to django-staticfiles / django.contrib.staticfiles?................. 13 3.2 Q: What are the perfect caching headers?................................ 13 3.3 Tip: How to include IE-specific stylesheets............................... 13 i ii Django Mediagenerator Documentation, Release 1.11 Improve your user experience with amazingly fast page loads by combining, compressing, and versioning your JavaScript & CSS files and images. django-mediagenerator eliminates unnecessary HTTP requests and maximizes cache usage. Also, it provides lots of advanced features required for building HTML5 web applications (e.g. HTML5 offline manifests, Sass support, etc.). Take a look at the feature comparison for a quick overview and if you like django-mediagenerator please click the I use this! button on that page. Thank you! Django mediagenerator lives on GitHub (downloads, source code and bug tracking). Contents 1 Django Mediagenerator Documentation, Release 1.11 2 Contents CHAPTER 1 Reference settings MEDIA_BUNDLES This defines all JavaScript and CSS bundles as a list of tuples where the first tuple entry denotes the bundle output name and the following tuple entries denote the input file names: MEDIA_BUNDLES=( ('main.css', # bundle name # input files 'css/reset.css', 'css/design.css', ), ('main.js', 'js/jquery.js', 'js/jquery.autocomplete.js', ), ) Internally, all input file names are converted to filters. Instead of file names you can also be more explicit and specify filters as dicts: MEDIA_BUNDLES=( ('main.css', {'filter':'mediagenerator.generators.bundles.base.FileFilter', 'name':'css/reset.css'}, {'filter':'mediagenerator.generators.bundles.base.FileFilter', 'name':'css/design.css'}, ), # ..
    [Show full text]
  • Overview of Javascript Application Development
    Overview of JavaScript Application Development Juho Vepsäläinen Mathematical Information Technology University of Jyväskylä Tietotekniikan teemaseminaari (TIEA255) April 5, 2011 1 Abstract This article will provide an overview of JavaScript application de- velopment. CanvasDraw, an actual web based drawing application, will be used to highlight various technologies available. These tech- nologies include HTML5 Canvas and two JavaScript libraries: RightJS and RequireJS. In addition the feasibility of JavaScript based applica- tion development is discussed in some detail. 1 Introduction Software development has gone through radical changes during the last few decades. As minituarization and competition has driven the progress of hard- ware it has become commoditized, particularly in the Western world. Before computing resources were scarce. Now they have become abun- dant. These days there is often more computing power available than we are able to properly utilize. This development has made the role of a software developer crucial, even more so than before. These days it is possible even for small, agile teams to succeed. They just need to work the right way on the right market. Web development provides one feasible target for these kind of teams. Thanks to the prevalence of web it's now possible to reach millions of po- tential users with a relative ease. You could say web browser has subsumed the role of operating system and blurred the distinction between various platforms. Almost ubiquitously supported JavaScript programming language and still developing HTML5 standard combined together form the dynamic duo of web development. Throw in CSS3 and you have got a winner. In some cases amalgamation of this technology provides a signicant alternative to established Flash and Java based solutions.
    [Show full text]
  • Pyjamas and Flask Examples Release
    Pyjamas and Flask Examples Release July 18, 2015 Contents 1 Introduction 3 2 Cross-Origin Resource Sharing Between a Webserver and Flask’s Development Server5 3 Flask + Pyjamas + Celery 7 3.1 Introduction...............................................7 3.2 Dependencies...............................................7 3.3 More Fun with Asynchronicity.....................................8 i ii Pyjamas and Flask Examples, Release Note: This example assumes that you already have Flask installed and working on your system (pip install flask). Contents 1 Pyjamas and Flask Examples, Release 2 Contents CHAPTER 1 Introduction The goal is to have Flask and Pyjamas working together and make it somewhat easier to develop interactive applica- tions that have a heavy computational load. The Flask application runs on the webserver, the Pyjamas application can run in a web browser (pyjs) or as a desktop application (pyjd), and the computational work can be done anywhere you can run a daemon process (or use screen) that can connect to the broker (managing process). This document assumes that you know enough (or how to find it) with respect to configuring the web server of your choice to host the pyjs application and flask server code. Also, it expects that you understand the asynchronous nature of Pyjamas programs, and are familiar with the basics of building Flask applications. Before getting started you may wish to first understand some of the components separately by looking at the examples/jsonrpc directory, Flask‘s documentation, etc. 3 Pyjamas and Flask Examples, Release 4 Chapter 1. Introduction CHAPTER 2 Cross-Origin Resource Sharing Between a Webserver and Flask’s Development Server When building/debugging a Flask application, it is advantageous to use the built in webserver because debugging a Flask application running on a production webserver is very painful.
    [Show full text]